]> granicus.if.org Git - strace/commitdiff
mpers.awk: add support for DWARF version 2 format
authorDmitry V. Levin <ldv@altlinux.org>
Wed, 16 Dec 2015 01:25:10 +0000 (01:25 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 16 Dec 2015 01:25:10 +0000 (01:25 +0000)
* mpers.awk: Handle DW_AT_data_member_location in DWARF v2 format.

mpers.awk

index ca8f6fd74eb9c7893f3c8533591a19dc43874939..e45d8fb976948da33774e1473338019623fdce96 100644 (file)
--- a/mpers.awk
+++ b/mpers.awk
@@ -158,8 +158,9 @@ BEGIN {
        }
 }
 /^DW_AT_data_member_location/ {
-       match($0, /[[:digit:]]+/, temparray)
-       array[idx]["location"] = temparray[0]
+       if (!match($0, /\(DW_OP_plus_uconst:[[:space:]]+([[:digit:]]+)\)/, temparray))
+               match($0, /([[:digit:]]+)/, temparray)
+       array[idx]["location"] = temparray[1]
 }
 /^DW_AT_name/ {
        match($0, /:[[:space:]]+([[:alpha:]_][[:alnum:]_[:space:]]*)/, \