Difference between revisions of "Orchard gdb cheatsheet"
(Created page with "If you're not familiar with gdb, here are some commands to get you started. ==Starting GDB== To start GDB with Orchard, use these commands: pi@raspberrypi ~/orchard-src/orc...") |
(No difference)
|
Revision as of 09:52, 27 May 2015
If you're not familiar with gdb, here are some commands to get you started.
Starting GDB
To start GDB with Orchard, use these commands:
pi@raspberrypi ~/orchard-src/orchard $ gdb build/orchard.elf
Note that you're starting it in the same directory where you'd type make to build the executable.
Once GDB is started, you want to first execute
target remote localhost:3333
This establishes a connection between gdb and the orchard CPU.
Debugging with GDB
- To stop execution, hit ctrl-c. This will break you to a prompt.
- 'c' will continue execution
- 'mon reset' will reset the board
- 'b <function name>' will set a breakpoint at a given symbolic function name
- 'step' will step one source line
- 'info reg' will give you the register dump
- 'info threads' will give you the status of all threads running on chibiOS
- 'bt' will give you the current backtrace
- 'l' will list the current source line that's running
- 'disas' will show you the assembly code of the current code that's running
- 'print <expression>' will print the value of a variable in the current stack frame