Home » U++ Library support » U++ Core » Stack tracing
Stack tracing [message #38857] |
Thu, 24 January 2013 13:49 |
Zbych
Messages: 325 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 297 times)
[Updated on: Fri, 03 May 2013 17:08] Report message to a moderator
|
|
|
|
|
Stack tracing
By: Zbych on Thu, 24 January 2013 13:49
|
|
|
Re: Stack tracing
By: mirek on Thu, 24 January 2013 19:32
|
|
|
Re: Stack tracing
By: Zbych on Thu, 24 January 2013 19:52
|
|
|
Re: Stack tracing
By: Zbych on Fri, 03 May 2013 17:13
|
|
|
Re: Stack tracing
By: Zbych on Tue, 18 March 2014 11:17
|
|
|
Re: Stack tracing
By: mirek on Tue, 18 March 2014 11:33
|
|
|
Re: Stack tracing
By: Zbych on Wed, 19 March 2014 11:19
|
|
|
Re: Stack tracing
By: mirek on Wed, 19 March 2014 19:31
|
|
|
Re: Stack tracing
By: Zbych on Fri, 05 December 2014 12:43
|
|
|
Re: Stack tracing
By: mirek on Fri, 05 December 2014 16:50
|
Goto Forum:
Current Time: Mon Apr 29 05:19:07 CEST 2024
Total time taken to generate the page: 0.03183 seconds
|