[PATCH 3/3] libdw: save startp/endp boundaries in Dwarf_CU

2014-12-10 Thread Josh Stone
Rather than looking up section data every time, we can simply save the range of each CU as pointers in Dwarf_CU. Signed-off-by: Josh Stone --- libdw/ChangeLog | 8 libdw/dwarf_child.c | 3 +-- libdw/dwarf_cuoffset.c | 4 ++-- libdw/dwarf_dieoffset.c | 4 ++-- libdw/dwarf_si

[PATCH 1/3] libdw: unify die->abbrev lookups

2014-12-10 Thread Josh Stone
Add a new internal function, __libdw_dieabbrev, which deals with checking a die for an abbrev, and setting it as needed. Signed-off-by: Josh Stone --- libdw/ChangeLog | 8 libdw/dwarf_child.c | 44 +--- libdw/dwarf_getattrs.c|

[PATCH 2/3] libdw: optimize dwarf_hasattr to just look at abbrev

2014-12-10 Thread Josh Stone
To just check the presence of an attribute, we only need to look at the abbreviation data. This optimization avoids reading over die data at all, except possibly just to get the abbrev code. Signed-off-by: Josh Stone --- libdw/ChangeLog | 3 +++ libdw/dwarf_hasattr.c | 42 +++

[PATCH 0/3] libdw: Tweaks for optimization and clarity

2014-12-10 Thread Josh Stone
While looking at performance for Mark's form-len patch, I found a few areas that I felt could be cleaned up a bit. 1. die->abbrev initialization was duplicated in a few places. 2. dwarf_hasattr needn't look at the die at all, just abbrev. 3. CU start/end boundaries don't need to be computed from s

[PATCH 2/2] addr2line: Always prefer linkage_name over plain names

2014-12-10 Thread Josh Stone
Signed-off-by: Josh Stone --- src/ChangeLog | 6 +- src/addr2line.c | 40 tests/ChangeLog | 5 + tests/run-addr2line-i-test.sh | 4 +++- 4 files changed, 33 insertions(+), 22 deletions(-) diff --git a

[PATCH 1/2] addr2line: Iterate scopes for inline's parent function

2014-12-10 Thread Josh Stone
The function which contains an inline might not be the immediate next die scope. For instance, there may be a lexical scope in between. Instead, iterate the remaining scopes until an appropriate tag is found. Signed-off-by: Josh Stone --- src/ChangeLog | 4 src/addr2line.c | 17

[PATCH 0/2] Tweak addr2line function names

2014-12-10 Thread Josh Stone
As previously discussed, these patches fix the function names for addr2line. For addr2line -i, it now walks as many scopes as necessary to find the containing function, instead of assuming it's the next scope. Also, addr2line now prefers linkage_name over the plain die name in all cases. I haven'

Re: [PATCH][V2] Change calling convention of dwarf_getmacros to allow opcode 0xff

2014-12-10 Thread Petr Machata
Pushed. Thanks, Petr

Announcing dwgrep 0.1

2014-12-10 Thread Petr Machata
I am happy to announce the first release of dwgrep, a tool for querying Dwarf graphs. Dwgrep is useful for looking up particular patterns in Dwarf files. They might be nonsensical or sub-optimal constructs produced as a result of a compiler bug, rare constructs, or some sort of relationship that y

Re: [PATCH][V2] Change calling convention of dwarf_getmacros to allow opcode 0xff

2014-12-10 Thread Mark Wielaard
On Wed, 2014-12-10 at 01:45 +0100, Petr Machata wrote: > It might happen for macro sections that are larger than half of host > address space (e.g. 2G for 32-bit libdw). The offset would then be > negative, but adding it to the data start would wrap around and do the > right thing, I think. So it