GDB Commands
GDB basic commands, classified with respect to their purpose.
Program Flow
nextstep one line over.continueorc: continue executing up to next break point.break fn_name: break point at function name.- There may be many with same name. So we need the path.
- For example:
break gdb_hello_world::__risc_v_rt__main
- For example:
- There may be many with same name. So we need the path.
break lineno: break point at line number of currently-focused file.- Example:
break 19, orbr 19.
- Example:
break my_file.rs:lineno: examplebreak main.rs:17.monitor reset halt: restarts and halts it.load: if we only usecargo build, then we canflashusingload.- Within
gdbtypeload. It'll flash the file to the MCU.
- Within
Layout
layout src: shows source code and CLI.layout asm: shows assembly source and CLI.tui disable: to disable the layout.
Overviews
info break: to show breakpointsinfo locals: to show variables.print x: to print variablex. Alsoprint &xprints the address ofx.listorlist main: will show our program with numbered lines.