Commit Graph

259 Commits

Author SHA1 Message Date
Omar Sandoval
ccc9cbc862 dwarfdefs: add DW_ATE_* and move *_name() functions 2017-09-03 19:57:09 -07:00
Omar Sandoval
5f84ccfa1c drgn.dwarf: allow some DWARF sections to be missing
Not all files will have every DWARF section.
2017-09-03 09:23:27 -07:00
Omar Sandoval
97e604c05c Rewrite in Cython
The lldwarf/drgn.dwarf split wasn't working out too well, and moving all
of drgn.dwarf into lldwarf (by rewriting it into C) would be way too
much work. Instead, use Cython, which results in a parser which is just
as fast but with much cleaner code overall. It also turns out lldwarf
wasn't doing GC right, so the switch also fixed that.
2017-08-28 21:16:43 -07:00
Omar Sandoval
682fd172a4 cli/probe: start implementing variable fetching
Resolving parameters, variables with function scope, and global
variables should work. This is just the variable resolution, no fetching
yet, but a bunch of refactors snuck in here so committing it all now.
2017-08-27 23:56:14 -07:00
Omar Sandoval
e6a58f533a Store CU and parent in DIE
Back-references from the DIE to the CU and the parent DIE will make it
much easier to implement several features.
2017-08-27 11:35:38 -07:00
Omar Sandoval
64f66f747f lldwarf: get rid of explicit offset members
The parsing library shouldn't really care about keeping track of these.
Instead, add __dict__ and getattr()/setattr() to all of the lldwarf
objects so higher layers can store the offset if they want.

DwarfDie is special in two ways:

1. We want to store an offset for the DIE so we know where to parse
   sibling and children entries.
2. For some attributes, we need to store an offset so we know where to
   find them later.

Both of these are changed to be relative to the CU rather than the
buffer.
2017-08-27 10:53:04 -07:00
Omar Sandoval
72b9af2b82 Add address range table parsing 2017-08-25 23:24:38 -07:00
Omar Sandoval
bb5881243f Get rid of spurious commas in DW_* enums 2017-08-25 22:39:15 -07:00
Omar Sandoval
1fc2b6e89b Initial commit
I wrote all of this code a few months back and am just now getting
around to committing it. The low-level DWARF parsing library is pretty
solid, although it only implements a subset of DWARF so far. The CLI and
higher-level interface are experimental.
2017-08-24 22:46:16 -07:00