Commit Graph

877 Commits

Author SHA1 Message Date
Omar Sandoval
c625845a62 coredump: add containerof() to CoredumpObject 2018-03-07 21:07:19 -08:00
Omar Sandoval
16b3e672e1 coredump: use Type.format() for CoredumpObject.__str__() 2018-03-07 02:07:11 -08:00
Omar Sandoval
7d21255007 type: add format() to type classes
For formatting read values nicely in C syntax.
2018-03-07 02:04:09 -08:00
Omar Sandoval
4f7e35181e coredump: add support for casting types 2018-03-07 00:31:14 -08:00
Omar Sandoval
adeeca927b type: add TypeFactory.from_type_name() 2018-03-07 00:31:00 -08:00
Omar Sandoval
5eac4fe225 coredump: support array and pointer indexing 2018-03-06 01:44:21 -08:00
Omar Sandoval
f71d2a8fd9 type: add read() to type classes
For reading a value out of memory.
2018-03-06 01:22:14 -08:00
Omar Sandoval
84e0910342 type: remove all DWARF-specific code from type classes 2018-03-06 00:42:03 -08:00
Omar Sandoval
1717c060cd type: further improve type handling
Make specific type classes which are separate from the type name
classes.
2018-03-03 02:14:09 -08:00
Omar Sandoval
ec75400cc0 type: improve type handling
Add a parser for C type names and push the type logic out of the
CoredumpObject class.
2018-02-24 19:37:51 -08:00
Omar Sandoval
3c7c5f0035 dwarf: add optimized index by name 2018-02-20 21:55:59 -08:00
Omar Sandoval
c1671d6ae7 dwarf: merge dwarfdefs into drgn.dwarf 2018-02-20 20:28:38 -08:00
Omar Sandoval
c19f5d90cc dwarf: use flat array for abbreviation codes 2018-02-19 20:25:14 -08:00
Omar Sandoval
16c5cff47c Prototype of "crash" utility 2018-02-19 00:46:39 -08:00
Omar Sandoval
a04e7c7bbe cli/probe: implement struct member fetching
The parser is minimal and kinda jank, but it works. With a real parser
this could be extended to do pointer dereferencing, array subscripting,
and casting.
2017-09-05 00:27:14 -07:00
Omar Sandoval
89c2861e2b cli/probe: for filename:lineno, probe all matching addresses
Instead of just the first one. Also omit variables that cannot be
fetched instead of erroring out.
2017-09-04 23:15:17 -07:00
Omar Sandoval
0013015f2c cli/probe: better error messages 2017-09-04 22:35:59 -07:00
Omar Sandoval
c677749bcb cli/probe: implement variable fetching by name
This supports fetching both at a function and at an arbitrary
filename:lineno. It still needs better error messages and some other
extras.
2017-09-04 22:17:23 -07:00
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