U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ Core » Stack tracing
Stack tracing [message #38857] Thu, 24 January 2013 13:49 Go to previous message
Zbych is currently offline  Zbych
Messages: 332
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 436 times)

[Updated on: Fri, 03 May 2013 17:08]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Problem with some keyboard keys
Next Topic: Vector<int>::At does not return a default constructed value
Goto Forum:
  


Current Time: Thu Sep 17 04:45:35 GMT+2 2026

Total time taken to generate the page: 0.00862 seconds