← 返回命令列表

Linux command

arm-none-eabi-gdb 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Start debugging an ARM firmware binary

arm-none-eabi-gdb [firmware.elf]

Connect to a remote target

arm-none-eabi-gdb -ex "target remote localhost:3333" [firmware.elf]

Start with a command script

arm-none-eabi-gdb -x [commands.gdb] [firmware.elf]

Load and run firmware on target

arm-none-eabi-gdb -ex "target remote :3333" -ex "load" -ex "continue" [firmware.elf]

Start in TUI mode

arm-none-eabi-gdb -tui [firmware.elf]

说明

arm-none-eabi-gdb is the GNU Debugger configured for bare-metal ARM targets (Cortex-M, Cortex-A without OS). It enables source-level debugging of firmware running on microcontrollers and embedded systems through JTAG/SWD debug probes. The debugger connects to hardware targets via debug servers like OpenOCD, J-Link GDB Server, or ST-Link utilities. These servers provide the bridge between GDB's remote protocol and the physical debug interface on the microcontroller. With an ELF file containing debug symbols, arm-none-eabi-gdb provides full source-level debugging: setting breakpoints, inspecting variables, stepping through code, and examining memory and registers. It supports ARM-specific features like viewing special registers and peripheral memory regions.

参数

-ex _command_
Execute a GDB command after loading the program.
-x _file_
Execute commands from a script file.
-tui
Start in Text User Interface mode with source window.
-q, --quiet
Suppress introductory and copyright messages.
-batch
Run in batch mode for non-interactive use.
-cd _directory_
Change to directory before running.
-s _file_
Read symbols from the specified file.
--args
Pass remaining arguments to the program.

FAQ

What is the arm-none-eabi-gdb command used for?

arm-none-eabi-gdb is the GNU Debugger configured for bare-metal ARM targets (Cortex-M, Cortex-A without OS). It enables source-level debugging of firmware running on microcontrollers and embedded systems through JTAG/SWD debug probes. The debugger connects to hardware targets via debug servers like OpenOCD, J-Link GDB Server, or ST-Link utilities. These servers provide the bridge between GDB's remote protocol and the physical debug interface on the microcontroller. With an ELF file containing debug symbols, arm-none-eabi-gdb provides full source-level debugging: setting breakpoints, inspecting variables, stepping through code, and examining memory and registers. It supports ARM-specific features like viewing special registers and peripheral memory regions.

How do I run a basic arm-none-eabi-gdb example?

Run `arm-none-eabi-gdb [firmware.elf]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -ex _command_ do in arm-none-eabi-gdb?

Execute a GDB command after loading the program.