diff options
author | Mark Wielaard <mark@klomp.org> | 2017-12-07 16:31:54 +0100 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2017-12-12 00:02:54 +0100 |
commit | 57b7f381e167356fa47d58c18bbc2e856f75ee16 (patch) | |
tree | 2d940044251ab49ea32192b28b5d8a1e07ba71fc /libdw/dwarf_getlocation.c | |
parent | b0654221fc2691b3ec633463285c9ef4a86267ae (diff) | |
download | elfutils-57b7f381e167356fa47d58c18bbc2e856f75ee16.tar.gz |
readelf: Handle DW_OP_call2 and DW_OP_call4 correctly.
DW_OP_call2 and DW_OP_call4 didn't correctly advance the data pointer.
This caused print_ops to produce garbage operands. Also format the
arguments as DIE offsets. That makes it easier to follow the call to the
actual dwarf_procedure DIE.
Testcase from https://sourceware.org/bugzilla/show_bug.cgi?id=22532
The testcase only checks the eu-readelf output is correct for the
byte_size attribute. But it might be interesting to write a full
expression parser to check the actual sizes.
[ 3e] structure_type
name (strp) "pck__rec"
byte_size (exprloc)
[ 0] push_object_address
[ 1] deref_size 1
[ 3] call4 [ 95]
[ 8] plus_uconst 7
[ 10] const1s -4
[ 12] and
[ 95] dwarf_procedure
location (exprloc)
[ 0] dup
[ 1] lit1
[ 2] ne
[ 3] bra 10
[ 6] lit4
[ 7] skip 31
[ 10] dup
[ 11] lit4
[ 12] ne
[ 13] bra 20
[ 16] lit0
[ 17] skip 31
[ 20] dup
[ 21] lit3
[ 22] eq
[ 23] bra 30
[ 26] lit0
[ 27] skip 31
[ 30] lit4
[ 31] swap
[ 32] drop
The "answer" depends on the Discr value (first byte at object address),
and is rounded up to 4 or 8 bytes.
Signed-off-by: Mark Wielaard <mark@klomp.org>
Diffstat (limited to 'libdw/dwarf_getlocation.c')
0 files changed, 0 insertions, 0 deletions