How do breakpoints even work? | Interrupt

The idea of halting program execution was invented over 70 years ago as part of the ENIAC digital computer. At the time, to pause a program and debug, you had to physically unplug one of the cables controlling program flow, which was coined a “breakpoint”.


This is a companion discussion topic for the original entry at https://interrupt.memfault.com/blog/cortex-m-breakpoints

Hi, I compile the break example but it report a error like:
Linking library
/usr/lib/gcc/arm-none-eabi/9.2.1/…/…/…/arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/9.2.1/…/…/…/arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc.a(lib_a-abort.o): in function abort': /build/newlib-CVVEyx/newlib-3.3.0/build/arm-none-eabi/thumb/v7e-m+fp/hard/newlib/libc/stdlib/../../../../../../../../newlib/libc/stdlib/abort.c:59: undefined reference to _exit’
/

I search for a while, some post say a link flag -specs=nosys.specs should be add. But it still fail after I add this flag to LDFLAGS.

I’m on ubuntu 20.10 and use the arm-none-eabi-gcc version 9.2.1

Hi @chrisc

These days more and more embedded devices perform full firmware updates and so the practice is becoming less common. The art of flash patching deserves a post of its own so we won’t be digging deeper here.

Regarding the above statement, still lot of low cost MCUs still use it for patching the ROM code in Cortex M. There is no alternative for it. And few does not allow you to see the ROM symbols during debug because the MCU is using FPB unit for patching the buggy ROM functions by making the code point to flash code and jump back to ROM code.