Consider the following loop:
28: while (true) {
29: chThdSleepMilliseconds(1);
30: txbuffer[1] = num_zero + offset;
31: spiExchange(&SPID1, 2, txbuffer, rxbuffer);
32: // we want to examine rxbuffer at this point
33: }
I want to examine contents of rxbuffer
in GDB after spiExchange
function is executed. The following doesn't work:
(gdb) break main.c:32
(gdb) continue
GDB doesn't hit above breakpoint (probably as expected). If I put a breakpoint main.c:31
and then execute next
, context is totally changed, so there is no rxbuffer
at that point.
Currently I insert an unused variable and put a breakpoint at that point:
31: spiExchange(&SPID1, 2, txbuffer, rxbuffer);
32: int x; // we want to examine rxbuffer at this point
33: }
How can I put a breakpoint at that point without defining the temporary variable?