summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@strace.io>2021-04-20 08:00:00 +0000
committerDmitry V. Levin <ldv@strace.io>2021-04-20 08:00:00 +0000
commit8b5e75605aad165497402448361119dc7d9e1762 (patch)
tree838283813a613a252ee50afa60f6a41a34958fed
parent200cc2cc65ea4560915c3ccb4ced85404631802a (diff)
downloadstrace-8b5e75605aad165497402448361119dc7d9e1762.tar.gz
mpers.awk, ioctls_sym.awk: add binutils 2.36 support
The output format of "readelf --debug-dump=info --wide" changed in binutils 2.36, breaking mpers.awk and ioctls_sym.awk scripts. * src/mpers.awk: Extend regexps to handle the output format of "readelf --debug-dump=info --wide" produced by binutils 2.36. * maint/ioctls_sym.awk: Likewise. * NEWS: Mention this change. Resolves: https://github.com/strace/strace/issues/171 Resolves: https://github.com/strace/strace/issues/180
-rw-r--r--NEWS3
-rw-r--r--maint/ioctls_sym.awk21
-rw-r--r--src/mpers.awk31
3 files changed, 33 insertions, 22 deletions
diff --git a/NEWS b/NEWS
index 94e734c03..2daf2a75b 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,9 @@ Noteworthy changes in release ?.?? (????-??-??)
* Bug fixes
* Fixed build using bionic libc.
+* Portability
+ * Added binutils 2.36 support to --enable-mpers builds.
+
Noteworthy changes in release 5.11 (2021-02-17)
===============================================
diff --git a/maint/ioctls_sym.awk b/maint/ioctls_sym.awk
index d3a12956c..4617c9b3c 100644
--- a/maint/ioctls_sym.awk
+++ b/maint/ioctls_sym.awk
@@ -42,21 +42,24 @@ function dir2str(dir, \
parent[level] = idx
}
/^DW_AT_name/ {
- match($0, /:[[:space:]]+([[:alpha:]_][[:alnum:]_[:space:]]*)/,
- temparray)
- array[idx]["name"] = temparray[1]
+ match($0, /:[[:space:]]+(\([[:alpha:]][[:alnum:]]*\)[[:space:]]+)?([[:alpha:]_][[:alnum:]_[:space:]]*)/,
+ temparray)
+ array[idx]["name"] = temparray[2]
}
/^DW_AT_type/ {
- match($0, /:[[:space:]]+<(0x[[:xdigit:]]*)>(, .*)?$/, temparray)
- array[idx]["type"] = temparray[1]
+ match($0, /:[[:space:]]+(\([[:alpha:]][[:alnum:]]*\)[[:space:]]+)?<(0x[[:xdigit:]]*)>(, .*)?$/,
+ temparray)
+ array[idx]["type"] = temparray[2]
}
/^DW_AT_upper_bound/ {
- match($0, /[[:digit:]]+/, temparray)
- array[array[idx]["parent"]]["size"] = temparray[0]
+ match($0, /:[[:space:]]+(\([[:alpha:]][[:alnum:]]*\)[[:space:]]+)?([[:digit:]]+)/,
+ temparray)
+ array[array[idx]["parent"]]["size"] = temparray[2]
}
/^DW_AT_count/ {
- match($0, /[[:digit:]]+/, temparray)
- array[array[idx]["parent"]]["size"] = temparray[0] - 1
+ match($0, /:[[:space:]]+(\([[:alpha:]][[:alnum:]]*\)[[:space:]]+)?([[:digit:]]+)/,
+ temparray)
+ array[array[idx]["parent"]]["size"] = temparray[2] - 1
}
/^Abbrev Number:[^(]+\(DW_TAG_/ {
if (match($0, /member|subrange_type|variable/, temparray)) {
diff --git a/src/mpers.awk b/src/mpers.awk
index 25a212f68..425ab65ab 100644
--- a/src/mpers.awk
+++ b/src/mpers.awk
@@ -156,30 +156,35 @@ BEGIN {
array[idx, "location"] = temparray[1]
}
/^DW_AT_name/ {
- match($0, /:[[:space:]]+([[:alpha:]_][[:alnum:]_[:space:]]*)/, \
- temparray)
+ match($0, /:[[:space:]]+(\([[:alpha:]][[:alnum:]]*\)[[:space:]]+)?([[:alpha:]_][[:alnum:]_[:space:]]*)/,
+ temparray)
array_names[idx] = 1
- array[idx, "name"] = temparray[1]
+ array[idx, "name"] = temparray[2]
}
/^DW_AT_byte_size/ {
- match($0, /[[:digit:]]+/, temparray)
- array[idx, "byte_size"] = temparray[0]
+ match($0, /:[[:space:]]+(\([[:alpha:]][[:alnum:]]*\)[[:space:]]+)?([[:digit:]]+)/,
+ temparray)
+ array[idx, "byte_size"] = temparray[2]
}
/^DW_AT_encoding/ {
- match($0, /[[:digit:]]+/, temparray)
- array[idx, "encoding"] = temparray[0]
+ match($0, /:[[:space:]]+(\([[:alpha:]][[:alnum:]]*\)[[:space:]]+)?([[:digit:]]+)/,
+ temparray)
+ array[idx, "encoding"] = temparray[2]
}
/^DW_AT_type/ {
- match($0, /:[[:space:]]+<0x([[:xdigit:]]*)>(, .*)?$/, temparray)
- array[idx, "type"] = norm_idx(temparray[1])
+ match($0, /:[[:space:]]+(\([[:alpha:]][[:alnum:]]*\)[[:space:]]+)?<0x([[:xdigit:]]*)>(, .*)?$/,
+ temparray)
+ array[idx, "type"] = norm_idx(temparray[2])
}
/^DW_AT_upper_bound/ {
- match($0, /[[:digit:]]+/, temparray)
- update_upper_bound(parent[level - 1], temparray[0] + 1)
+ match($0, /:[[:space:]]+(\([[:alpha:]][[:alnum:]]*\)[[:space:]]+)?([[:digit:]]+)/,
+ temparray)
+ update_upper_bound(parent[level - 1], temparray[2] + 1)
}
/^DW_AT_count/ {
- match($0, /[[:digit:]]+/, temparray)
- update_upper_bound(parent[level - 1], temparray[0])
+ match($0, /:[[:space:]]+(\([[:alpha:]][[:alnum:]]*\)[[:space:]]+)?([[:digit:]]+)/,
+ temparray)
+ update_upper_bound(parent[level - 1], temparray[2])
}
/^Abbrev Number:[^(]+\(DW_TAG_/ {
if (match($0, /typedef|union_type|structure_type|pointer_type\