Home » U++ Library support » U++ Core » Stack tracing
Stack tracing [message #38857] |
Thu, 24 January 2013 13:49 |
Zbych
Messages: 327 Registered: July 2009
|
Senior Member |
|
|
Hi,
Since assertion messages aren't very helpful in hunting for bugs, I decided to add some extra help to them (at least for gcc users). Modified Core/Utils.ccp/AssertFailed displays call stack similar to this one:
Stack trace:
Upp::AddStackTrace(char*, int)
Upp::AssertFailed(char const*, int, char const*)
Upp::AString<Upp::String0>::operator[](int) const
Upp::CCTalk::GetAsciiData(int, int, Upp::String&)
Upp::CCTalk::EquipmentID(int, Upp::String&)
Upp::CCTalk::FindDevs()
Upp::CCTalk::WorkingThread()
Upp::CallbackMethodAction<Upp::CCTalk, void (Upp::CCTalk::*)()>::Execute()
Upp::Callback::Execute() const
Upp::Callback::operator()() const
clone
All you need (beside modified version of Core/Utils.cpp) is '-rdynamic' added to linker options in your application.
Disadvantages? Bigger executable, much longer linking time and of course visible function names.
Debug symbols are not necessary, all function names are kept in .dynsym section.
Without -rdynamic, call stack looks like this one:
Stack trace:
() [0x82bf968]
() [0x82bfc18]
() [0x8053fbe]
() [0x8052948]
() [0x8053c51]
() [0x80522b0]
() [0x8053009]
() [0x8054d26]
() [0x825cb0a]
() [0x8050fd3]
() [0x8241889]
(
(clone
Edit:
New version of Util.cpp is uploaded.
-
Attachment: Util.cpp
(Size: 16.75KB, Downloaded 327 times)
[Updated on: Fri, 03 May 2013 17:08] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Sat Dec 07 22:09:32 CET 2024
Total time taken to generate the page: 0.02864 seconds
|