Finding a call stack programmatically (unwind?).

I am attempting to write a routine that monitors the heap in order to track down a memory leak.  I've seen similar tools on other platforms and found them quite helpful.  To make this even more effective, I want to record the caller to malloc() that made the request. To do this, the routine would need to read the call stack (sometimes called unwind).  I've been googling and found clues for the GNU compiler, and other platforms but nothing that seems pertinent to my platform: nRF52840/ARM/IAR/FreeRTOS.

I realize this is extremely unportable, but this is only needed for debugging on occasion.

Anyone have any suggestions?  I've seen references to unwind.h, but they appear to only be for GNU.

Parents Reply Children
Related