aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdb-gdb.py.in
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2021-12-06 11:25:04 +0000
committerAndrew Burgess <aburgess@redhat.com>2021-12-13 11:37:02 +0000
commit7eb1526a8096133aae3164aea6388d186608ae74 (patch)
tree1c42c2cacf81f387608d7cab321d049fa68969e1 /gdb/gdb-gdb.py.in
parent20ac1cdb8c76397a314c248c3db733d7db1f8339 (diff)
downloadgdb-7eb1526a8096133aae3164aea6388d186608ae74.zip
gdb-7eb1526a8096133aae3164aea6388d186608ae74.tar.gz
gdb-7eb1526a8096133aae3164aea6388d186608ae74.tar.bz2
gdb: update gdb-gdb.py.in for latest changes to struct field
This commit updates uses of 'loc' and 'loc_kind' to 'm_loc' and 'm_loc_kind' respectively, in gdb-gdb.py.in, which is required after this commit: commit cd3f655cc7a55437a05aa8e7b1fcc9051b5fe404 Date: Thu Sep 30 22:38:29 2021 -0400 gdb: add accessors for field (and call site) location I have also incorporated this change: https://sourceware.org/pipermail/gdb-patches/2021-September/182171.html Which means we print 'm_name' instead of 'name' when displaying the 'm_name' member variable. Finally, I have also added support for the new TYPE_SPECIFIC_INT fields, which were added with this commit: commit 20a5fcbd5b28cca88511ac5a9ad5e54251e8fa6d Date: Wed Sep 23 09:39:24 2020 -0600 Handle bit offset and bit size in base types I updated the gdb.gdb/python-helper.exp test to cover all of these changes.
Diffstat (limited to 'gdb/gdb-gdb.py.in')
-rw-r--r--gdb/gdb-gdb.py.in18
1 files changed, 11 insertions, 7 deletions
diff --git a/gdb/gdb-gdb.py.in b/gdb/gdb-gdb.py.in
index 15dbf38..a60ad01 100644
--- a/gdb/gdb-gdb.py.in
+++ b/gdb/gdb-gdb.py.in
@@ -153,8 +153,8 @@ class StructMainTypePrettyPrinter:
"""Return an image of the loc component inside the given field
gdb.Value.
"""
- loc_val = field_val["loc"]
- loc_kind = str(field_val["loc_kind"])
+ loc_val = field_val["m_loc"]
+ loc_kind = str(field_val["m_loc_kind"])
if loc_kind == "FIELD_LOC_KIND_BITPOS":
return "bitpos = %d" % loc_val["bitpos"]
elif loc_kind == "FIELD_LOC_KIND_ENUMVAL":
@@ -166,7 +166,7 @@ class StructMainTypePrettyPrinter:
elif loc_kind == "FIELD_LOC_KIND_DWARF_BLOCK":
return "dwarf_block = %s" % loc_val["dwarf_block"]
else:
- return "loc = ??? (unsupported loc_kind value)"
+ return "m_loc = ??? (unsupported m_loc_kind value)"
def struct_field_img(self, fieldno):
"""Return an image of the main_type field number FIELDNO."""
@@ -175,9 +175,9 @@ class StructMainTypePrettyPrinter:
if f["artificial"]:
label += " (artificial)"
fields = []
- fields.append("name = %s" % f["name"])
- fields.append("type = %s" % f["m_type"])
- fields.append("loc_kind = %s" % f["loc_kind"])
+ fields.append("m_name = %s" % f["m_name"])
+ fields.append("m_type = %s" % f["m_type"])
+ fields.append("m_loc_kind = %s" % f["m_loc_kind"])
fields.append("bitsize = %d" % f["bitsize"])
fields.append(self.struct_field_location_img(f))
return label + "\n" + " {" + ",\n ".join(fields) + "}"
@@ -241,9 +241,13 @@ class StructMainTypePrettyPrinter:
"scaling_factor: <opaque> (call __gmpz_dump with "
" _mp_num and _mp_den fields if needed)"
)
+ elif type_specific_kind == "TYPE_SPECIFIC_INT":
+ img = ("int_stuff = { bit_size = %d, bit_offset = %d }"
+ % (type_specific["int_stuff"]["bit_size"],
+ type_specific["int_stuff"]["bit_offset"]))
else:
img = (
- "type_specific = ??? (unknown type_secific_kind: %s)"
+ "type_specific = ??? (unknown type_specific_kind: %s)"
% type_specific_kind
)
return img