Debugging Strategy: Finding Version from a Memory Dump

Have you ever had a device that's in a weird state, and you're curious what version of software is on it so you can load the correct debug symbols? Here's a strategy for figuring that out:

  • Connect to device over JTAG when it's in the desired state
  • Use your JTAG tool to dump the contents of memory into a binary file on your host
    • Example using openocd:
      • dump_image sram.bin 0x300000 0x20000
    • You will need to know where in memory your binary gets loaded, as well as the size of the binary
  • Run strings on the downloaded binary file. You will need to look for something representative for your version string.
    • For example, "buildbot" is the jenkins machine that builds nightly images for my current project.
    • strings sram.bin | grep buildbot
      master 0.1.10 Wed Sep 21 03:10:25 PDT 2016 buildbot@company.io
  • Once you know the version of software you have, you can grab the debug symbols for that build and continue on your merry way.

Happy hunting!