Measuring Stack Usage the Hard Way | Interrupt

Embedded systems often require a careful eye to where memory resources are being spent, especially runtime memory utilization like stack and heap memories.

This is a companion discussion topic for the original entry at

Great Post, really love it!
Do I miss something or is hit_breakpoint function never defined?
I would assume it would look something like this:

def hit_breakpoint() -> bool:
    locations = []
    for gdb_breakpoint in gdb.breakpoints():
        for location in gdb_breakpoint.locations:
    pc = int(gdb.parse_and_eval("$pc"))
    if pc in locations:
        return True
    return False

1 Like

Well spotted @Kaio , fixed up the example script to match the snippet in the article. Thanks for noticing the issue!

Hi. I’ve been reading this blog for a very long time. I advise all friends to read, but many miss useful articles and I would like to convey useful information to them. I ask permission to translate it for my readers and friends from Armenia, Ukraine, Russia and Georgia.

Great article Noah. I just got hip to cut and it looks like gnuplot is the ideal graphing counterpart to that. :+1:

1 Like

do you need to compile with -fpic if you relocate your bootloader from flash to ram?