Hello!
I was just wondering if anyone has implemented any chibios backtrace functions for gdb? Anything similar to the one in chibistudio?
- Kristoffer
GDB plugin for chibios backtrace
Moderators: RoccoMarco, lbednarz, tfAteba
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
-
totalkrill
- Posts: 12
- Joined: Thu Jul 09, 2015 2:21 pm
Re: GDB plugin for chibios backtrace
Yes, you can use backtrace (bt) and that will allow you to traverse the stack and check variables and stuff ( given a unwinder is present for the architecture). But from what i gather, there is a much more powerful version of this in chibistudio.
I guess this are things stored in the memory in memory allocated to the chibios kernel? If so it should be possible to create an unwinder for this information to use under GDB since the newer version alow for python scripts to view, print and manipulate to the gdb session.
I guess this are things stored in the memory in memory allocated to the chibios kernel? If so it should be possible to create an unwinder for this information to use under GDB since the newer version alow for python scripts to view, print and manipulate to the gdb session.
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: GDB plugin for chibios backtrace
OpenOCD implements a GDB server and is already able to decode the stack trace of each ChibiOS thread. What it can't do is to decode the trace buffer data, I believe GDB is not able to track events.
Giovanni
Giovanni
-
totalkrill
- Posts: 12
- Joined: Thu Jul 09, 2015 2:21 pm
Re: GDB plugin for chibios backtrace
How are you storing events in chibistudio then? GDB could be used to store events, but what would mean it has to invoke a breakpoint, then read out the event and store. This would be very slow i believe.
So what chibistudio is doing is basically decoding the trace buffer data only? If that is the case i guess I could implement a function to do that myself in gdb/python
So what chibistudio is doing is basically decoding the trace buffer data only? If that is the case i guess I could implement a function to do that myself in gdb/python
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: GDB plugin for chibios backtrace
Events are stored into a circular buffer in RAM, see the debug/trace module, the data is read through GDB by inspecting the array.
Giovanni
Giovanni