back icon indicating copy to clipboard operation
back copied to clipboard

linux: parse ELF and DWARF to remove libc dependency

Open laytan opened this issue 1 year ago • 2 comments

laytan avatar Jan 27 '24 01:01 laytan

  • [x] figure out why the line program has direntry 0 (no directory) for the first / main.odin file
  • [ ] clean up a lot lot
  • [ ] ~~relocate dwarf sections (does this have a use for Odin?)~~ (it does not)
  • [ ] make more use of iterators over allocations in the dwarf package
  • [ ] make an encapsulating package, similar to the darwin CoreSymbolication API, handles caching, resolving, parsing etc. and just provides symbol info from an address
  • [ ] same thing for unwinding, make it a package, probably nice to have an unwind package, with implementations for each target
  • [ ] unwinding stops as soon as a libc proc is hit, backtrace keeps going and gets back to useful info, need that too
  • [ ] make bufio.Reader support seeking and use it (massive perf gains)
  • [ ] debug -use-separate-modules, seems to have some stuff going wrong and is a good stress test of compile units

laytan avatar Feb 13 '24 21:02 laytan

So for going through libc I am thinking we have to hardware unwind instead of virtual unwind, because there are no cu/fde frames in the debug info for it. Not 100% but that is my theory.

OR, there is some kind of link in the ELF that links to the libc file, which we then need to parse separately?

laytan avatar Feb 27 '24 18:02 laytan