Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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: 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 296 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: Sun Apr 28 11:54:13 CEST 2024

Total time taken to generate the page: 0.06871 seconds