DbgView Output for STATUS_ACCESS_VIOLATION

Hi, i have the following problem:

1
2
3
4
  CTracing::WriteX("crazy chrizzy start");
  MyType* myvar = NULL;
  myvar->MyMethod("Mietzekatze");
  CTracing::WriteX("crazy chrizzy end");

If I run this code, the program does not crash, and it posts no debug output, only:

 
  crazy chrizzy start

But I'd like to have some debug output that reveals the code file and the code line. I need it because I want to debug a program that runs at another computer. I cannot reproduce the error with my environment system. So I want to get the error information from the log file.

The only chance I see so far is to program a smart pointer and change all pointers to that type. That is described in http://www.c-plusplus.de/forum/134971. But there are so much pointers that this alternative is not practicable.

Does anybody know a better alternative? Thanks for yout help in advance.
Last edited on
I'd like to have some debug output that reveals the code file and the code line.
http://gcc.gnu.org/onlinedocs/gcc-3.1.1/cpp/Standard-Predefined-Macros.html
Thanks for your answer, but I forgot to say, that I cannot use that macros __LINE__ and __FILE__ because the segfault occurs inside a macro. In that case the __LINE__ macros etc. are filled with undefined values, I can only use them in ASSERT-commandos inside a macro.

Do you know another way?
That isn't what you posted.

You need to post what you have.
Last edited on
segfault occurs inside a macro
If you have a massive macro then you have a massive problem...

In that case the __LINE__ macros etc. are filled with undefined values
Nope. It doesn't show the line of the macro. It's shows the line where the macro is expanded.

How do you log? What's 'CTracing'?
Topic archived. No new replies allowed.