Use mbed-find-dangling-ptrs with IAR build

I’m trying to track memory leaks in my application, I’ve followed these instructions:

The demo works very well with GCC tools, however my projet uses IAR tools. I’m seeing what looks like debug info interpretation problems.

I get the expected list of dangling pointers, with what looks like the correct memory size for each, but they are not disassembled back to source code correctly. (I presume GCC and IAR ELF files use only partially compatible DWARF formats?)

I see this sort of things:

Extracting symbols from .\BUILD\Exe\name.out
Extracting symbols OK

Found 1213 dangling pointers (17358595 bytes)

-------------------------------------------------- 0
N dangling pointers (total: B bytes): [ 20020040 (64), 20020090 (1), ...  200229f8 (4) ]
    undefined
    undefined
    undefined
    undefined
    undefined
    undefined
    undefined
    undefined
    undefined
>>> undefined
    
    .\BUILD\Exe\name.out:     file format elf32-littlearm
    
    
    Disassembly of section A0:
    
    08000000 <__vector_table>:
     8000000:	40 c6 01 20 85 ab 06 08 51 b7 06 08 7d 77 06 08     @.. ....Q...}w..
     8000010:	8b 77 06 08 99 77 06 08 a7 77 06 08 00 00 00 00     .w...w...w......
    	...

(Note that I have edited the overall list of pointers in the above log to make for an easier read.)

Question: Does mbed-find-dangling-ptrs.cmd work with IAR tools and if yes, how can I set it up?

I should add that I get this behaviour with both

  • MBED CLI builds using IAR tools, and
  • a full IAR project exported from the MBED CLI.

(Despite the apparent differences between those two ELF files.)

The video talks about using a mbed-find-dangling pointer script - where do I find such a script?