Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8374

SDK • gdb cannot watch variable - Could not insert hardware breakpoints

$
0
0
So, I'm trying to watch a variable from gdb (pico-sdk 2.1.1 build on Ubuntu 22.04, gdb-multiarch over openocd over Picoprobe), so I try this:

Code:

(gdb) b platform_entryBreakpoint 1 at 0x1000021e: file /src/pico-sdk/src/rp2_common/pico_crt0/crt0.S, line 452.Note: automatically using hardware breakpoints for read-only addresses.(gdb) rThe program being debugged has been started already.Start it from the beginning? (y or n) yStarting program: /src/pico-examples/build/blink_simple/blink_simple.elf target halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x00000178 msp: 0x20041f00[New Thread 2]Thread 1 hit Breakpoint 1, platform_entry () at /src/pico-sdk/src/rp2_common/pico_crt0/crt0.S:452452    ldr r1, =runtime_init(gdb) 
... and then I try to set up a watch of a mutex variable:

Code:

(gdb) p malloc_mutex $1 = {core = {spin_lock = 0x0}, owner = 0 '\000'}(gdb) p &malloc_mutex $2 = (mutex_t *) 0x200096bc <malloc_mutex>(gdb) watch *(mutex_t*)0x200096bcHardware watchpoint 2: *(mutex_t*)0x200096bc(gdb) info brNum     Type           Disp Enb Address    What1       breakpoint     keep y   0x1000021e /src/pico-sdk/src/rp2_common/pico_crt0/crt0.S:452breakpoint already hit 1 time2       hw watchpoint  keep y              *(mutex_t*)0x200096bc
OK, looks reasonable so far, but then I try to continue:

Code:

(gdb) cContinuing.Warning:Could not insert hardware watchpoint 2.Could not insert hardware breakpoints:You may have requested too many hardware breakpoints/watchpoints.Command aborted.
Too many? Let's delete the first one:

Code:

(gdb) del br 1(gdb) info brNum     Type           Disp Enb Address    What2       hw watchpoint  keep y              *(mutex_t*)0x200096bc(gdb) cContinuing.Warning:Could not insert hardware watchpoint 2.Could not insert hardware breakpoints:You may have requested too many hardware breakpoints/watchpoints.Command aborted.
I hate this so much - so, how can I watch this variable in gdb?

Statistics: Posted by sdbbs — Sun May 04, 2025 6:23 pm



Viewing all articles
Browse latest Browse all 8374

Trending Articles