I'm composing some GDB commands to make it behave like a "print()
" function:
break Core/Src/main.c:243
commands
silent
printf "write addr: %d, val: %d\n", la, value
continue
end
That'd worked great until now. I've been bitten by this approach nearly every time I place such breakpoints into an interrupt handler. If the interrupt handler is called too frequently (such as a UART receive handler), above GDB composition causes delays, which leads loss of data, thus an unpredictable behavior.
If there is a way to determine the hit of a breakpoint during an interrupt, I would like to print a warning message to the rookie user (which is me, of course) that the breakpoint may lead to unpredictable behaviors.
Is there a way for the goal?