There are cases where my application runs find for days, weeks or even months, but then from time to time there is an application crash. Yes, the watchdog will recover it, but still it would be good to know what happened? One solution would be to hook up a trace probe (like the one I have described in this post: “First Steps with the P&E Tracelink“). But having such a trace probe attached all the time is first not cheap and second not always possible. So what if the application would leave ‘breadcrumbs’ behind which would tell me the flow of the program leading to the problem? I have found a functionality in the GNU tools which seems not be widely known or use, but is incredibly helpful in such cases.
So what if I could get a log like this telling me which functions get called by whom?
{ 00000E88->00000DA0 ???->DEMO_Init
} 00000E88<-00000DA0 ???<-DEMO_Init
{ 00000E8C->00000D40 ???->DEMO_Run
{ 00000D62->00000CE8 DEMO_Run:0x0022->decide
{ 00000D0E->00000C60 decide:0x0026->calcValue
} 00000D0E<-00000C60 decide:0x0026<-calcValue
{ 00000D16->00000CA0 decide:0x002E->getValue
{ 00000CC6->00000C60 getValue:0x0026->calcValue
} 00000CC6<-00000C60 getValue:0x0026<-calcValue
} 00000D16<-00000CA0 decide:0x002E<-getValue
} 00000D62<-00000CE8 DEMO_Run:0x0022<-decide
{ 00000D62->00000CE8 DEMO_Run:0x0022->decide
Continue reading →