Debug the firmware with GDB.
pbl debug
The board’s first runner with debug support starts its GDB server, then GDB on the build’s ELF, attached to the running firmware and with the repository’s GDB extensions loaded. Quitting GDB stops the server.
Runner |
GDB server |
Port |
|---|---|---|
|
Proxy to the emulator, with the kernel’s threads |
1233 |
|
OpenOCD |
3333 |
|
probe-rs |
1337 |
|
None: runs the simulator under gdb or lldb |
On QEMU boards the emulator has to be running already, e.g. with
pbl run in another terminal. A server already listening on the port,
e.g. one started with pbl debugserver, is used as it is; --gdb-port
picks another port.
Platforms with a serial-based debugger, e.g. over the programmer’s debug
UART, need its port, given with --tty:
pbl debug --tty /dev/cu.usbmodem5B7A1355001
--probe selects one of several debug probes, as VID:PID[:SERIAL].
Debugging covers the
setup, and GDB tutorial walks through a
session.
pbl debug [-h] [-b DIR] [--dry-run] [--lab FILE] [--watch NAME]
[--wait [SECONDS]] [--gdb-port PORT]
[-r {native,nrfutil,openocd,phone,probe-rs,qemu,sftool,wasm}]
[--tty TTY] [--probe VID:PID[:SERIAL]] [--keep-flash-image]
[--decoration NAME] [--sunlight] [--bt-hci CHARDEV]
[--bt-addr ADDRESS] [--http-port HTTP_PORT] [--no-browser]
[--via {adb,cloud,ip}] [--address ADDRESS] [--adb-serial ADB_SERIAL]
--gdb-port PORTPort of the gdb server (default: the runner’s)
-r, --runner {native,nrfutil,openocd,phone,probe-rs,qemu,sftool,wasm}Override the board’s runner
--tty TTYSerial port for the sftool and probe-rs runners (default: the lab’s)
--probe VID:PID[:SERIAL]Debug probe for the probe-rs runner (default: the lab’s)
--keep-flash-imageKeep the emulator’s SPI flash image, and the apps and data in it, instead of rebuilding it
--decoration NAMESDL decoration the emulator draws around the screen, or ‘none’ (default: the build’s first)
--sunlightShow the colors as a watch’s panel does in sunlight
--bt-hci CHARDEVH4 Bluetooth controller for builds with CONFIG_NIMBLE_HCI_UART, e.g. the serial port /dev/cu.usbmodem1101
--bt-addr ADDRESSRandom static Bluetooth address the watch uses, e.g. C0:00:00:00:00:01, instead of its controller’s
--http-port HTTP_PORTPort the wasm runner serves the page on (default: 8000)
--no-browserDo not open the page the wasm runner serves in a browser
--via {adb,cloud,ip}How the phone runner reaches the phone’s Developer Connection: adb (Android, the default), cloud (signed in with ‘pebble login’) or ip (implied by –address)
--address ADDRESSPhone address (Developer Connection) for the phone runner
--adb-serial ADB_SERIALSerial of the Android phone for the phone runner, when adb sees several
Generated from PebbleOS 7416f78a1. This page is maintained in the pebbleos repository: docs/pbl/debug.md.