summaryrefslogtreecommitdiff
path: root/mpers.awk
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2017-04-04 01:39:56 +0000
committerDmitry V. Levin <ldv@altlinux.org>2017-04-04 02:42:26 +0000
commita12c6a014b43040b684f65d5879fa003b2131736 (patch)
tree2ed039e8dafc4479f07350ac1d2d5a73b676bf91 /mpers.awk
parentc446d22fc64c06fdd595b80c834bee9c350a9a0e (diff)
downloadstrace-a12c6a014b43040b684f65d5879fa003b2131736.tar.gz
mpers.awk: prepare for adding support of multidimensional arrays
* mpers.awk (what_is) <case "structure_type", case "union_type">: Move formatting of array upper_bound ... <case "array_type">: ... here.
Diffstat (limited to 'mpers.awk')
-rw-r--r--mpers.awk14
1 files changed, 3 insertions, 11 deletions
diff --git a/mpers.awk b/mpers.awk
index 2283b966e..b98054214 100644
--- a/mpers.awk
+++ b/mpers.awk
@@ -104,7 +104,7 @@ function what_is(what_idx, type_idx, special, item, \
if ("" == to_return)
to_return = 0
returned_size = to_return * returned_size
- return leave(what_idx, to_return)
+ return leave(what_idx, "[" to_return "]")
break
case "structure_type":
print "struct {"
@@ -125,11 +125,7 @@ function what_is(what_idx, type_idx, special, item, \
prev_location = location
returned = what_is(item)
prev_returned_size = returned_size
- printf("%s", array[item]["name"])
- if ("" != returned) {
- printf("[%s]", returned)
- }
- print ";"
+ printf("%s%s;\n", array[item]["name"], returned)
}
}
returned_size = array_get(what_idx, "byte_size")
@@ -146,11 +142,7 @@ function what_is(what_idx, type_idx, special, item, \
if ("parent" in array[item] && \
array_get(item, "parent") == what_idx) {
returned = what_is(item)
- printf("%s", array[item]["name"])
- if ("" != returned) {
- printf("[%s]", returned)
- }
- print ";"
+ printf("%s%s;\n", array[item]["name"], returned)
}
}
printf("} ")