PDA

View Full Version : Stack trace in MinGw 4.8 32 bit



bibhukalyana
22nd April 2015, 12:25
Hi everyone,
I want to use stack trace in my code. For this I am referring to StackWalker (http://www.codeproject.com/Articles/11132/Walking-the-callstack).
For stack trace I have implemented a class "MyStackWalker". This class is working fine in visual c++ 2010. But in qt function "SymGetSymFromAddr64" is failing with error 487(ERROR_INVALID_ADDRESS).

Can anyone please help me to solve this ?

I am using windows xp sp3(x86), Qt 5.3 (MinGW 4.8 32 bit).

Thanks.
11117.
11118.

ChrisW67
23rd April 2015, 03:28
The debughlp functions use symbol files:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa363368(v=vs.85).aspx
In a Microsoft proprietary format that cannot be generated by GCC.

bibhukalyana
23rd April 2015, 06:26
Thanks for reply.
Ok that means I cannot use 'dbghelp' for stack tracing in qt minGw.
Am I right ? If so then how can I achieve it ?

Can you please provide any information or link so that i can do this ?

Thanks.

ChrisW67
23rd April 2015, 09:55
You cannot use proprietary Microsoft mechanisms with the Gnu compiler toolchain. This has nothing to do with Qt.

Read the first two answers here
http://stackoverflow.com/questions/866721/how-to-generate-gcc-debug-symbol-outside-the-build-target
To see a rough equivalent for debugging an executable with externally stored symbol info.

bibhukalyana
23rd April 2015, 11:21
Thanks for help.
Yes it nothing to do with qt. It is all about the compiler what I am using.



http://stackoverflow.com/questions/8...e-build-target
To see a rough equivalent for debugging an executable with externally stored symbol info.


Ok I can store and attach the debug information to gdb. (Thanks for link I was not aware of it)
But If it is not possible to debug then how can I detetect the crash.

Basically on application crash I want to trace the stack to know the point where it is crashing.
If you have any suggestion please let me know.

Thanks.