A tool for viewing assembly and source side by side
open sourceMITself-hostablefree
lensm is a desktop app for reading the machine code a Go binary was compiled to next to the source lines it came from, for performance work where go tool objdump makes the link hard to see. It opens a binary built on your machine, lists its functions, shows assembly and source in two columns with matching lines linked, follows jumps and calls, can watch the binary and reload it when it's rebuilt, and can overlay a pprof profile. Built with Gio by Egon Elbre, MIT licensed.
Problems it solves
- see which Go source lines produced which assembly instructions while optimising a hot function
- go tool objdump output is hard to match back to my source code
- check whether the Go compiler inlined or bounds-checked a function without reading raw disassembly
- a Compiler Explorer style view for my local Go binary instead of a snippet on a website
- reload the disassembly automatically every time I rebuild while tuning code
- see a pprof CPU profile next to the assembly to find where time goes
Features
- assembly and source side by side with linked lines
- follow jumps and calls and come back
- go to a function by name or address
- watch mode reloads the binary when it changes
- show a pprof profile next to the code
- comments on lines saved to a file
- macOS disk images built by CI
Limitations
- Can't show source for binaries built on another machine: it reads source files from the paths in the binary1
