aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdb-gdb.py
diff options
context:
space:
mode:
authorUlrich Weigand <ulrich.weigand@de.ibm.com>2016-09-06 17:29:15 +0200
committerUlrich Weigand <ulrich.weigand@de.ibm.com>2016-09-06 17:29:15 +0200
commita9ff5f12cff6cd06f74ecf387ac5468984c94c6f (patch)
tree020d432b910dacca794b4b486327d4e40b36c902 /gdb/gdb-gdb.py
parent19f392bc2a93d9e64d063b884cd6eca547c8dad0 (diff)
downloadgdb-a9ff5f12cff6cd06f74ecf387ac5468984c94c6f.zip
gdb-a9ff5f12cff6cd06f74ecf387ac5468984c94c6f.tar.gz
gdb-a9ff5f12cff6cd06f74ecf387ac5468984c94c6f.tar.bz2
Remove obsolete TYPE_FLAG_... values
Now that init_type no longer takes a FLAGS argument, there is no user of the TYPE_FLAGS_... enum values left. This commit removes them (and all references to them in comments as well). This is mostly a no-op, except for a change to the Python type printer, which attempted to use them before. (As best as I can tell, this wasn't really needed anyway, since it was only used to pretty-print type *instance* flags, which only use the instance flags.) gdb/ChangeLog: * gdbtypes.h (enum type_flag_value): Remove. Remove references to TYPE_FLAG_... in comments throughout. * gdbtypes.c (recursive_dump_type): Do not print TYPE_FLAG_... flags, print the corresponding TYPE_... access macro names. Remove references to TYPE_FLAG_... in comments throughout. * infcall.c: Remove references to TYPE_FLAG_... in comments. * valprint.c: Likewise. * gdb-gdb.py (class TypeFlag): No longer consider TYPE_FLAG_... values, only TYPE_INSTANCE_FLAG_... values. (class TypeFlagsPrinter): Likewise. gdb/testsuite/ChangeLog: * gdb.cp/hang.exp: Remove reference to TYPE_FLAG_STUB in comment. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
Diffstat (limited to 'gdb/gdb-gdb.py')
-rw-r--r--gdb/gdb-gdb.py32
1 files changed, 9 insertions, 23 deletions
diff --git a/gdb/gdb-gdb.py b/gdb/gdb-gdb.py
index 9a12baf..07a3b0d 100644
--- a/gdb/gdb-gdb.py
+++ b/gdb/gdb-gdb.py
@@ -24,29 +24,26 @@ class TypeFlag:
In the GDB sources, struct type has a component called instance_flags
in which the value is the addition of various flags. These flags are
- defined by two enumerates: type_flag_value, and type_instance_flag_value.
- This class helps us recreate a list with all these flags that is
- easy to manipulate and sort. Because all flag names start with either
- TYPE_FLAG_ or TYPE_INSTANCE_FLAG_, a short_name attribute is provided
- that strips this prefix.
+ defined by the enumerates type_instance_flag_value. This class helps us
+ recreate a list with all these flags that is easy to manipulate and sort.
+ Because all flag names start with TYPE_INSTANCE_FLAG_, a short_name
+ attribute is provided that strips this prefix.
ATTRIBUTES
- name: The enumeration name (eg: "TYPE_FLAG_UNSIGNED").
+ name: The enumeration name (eg: "TYPE_INSTANCE_FLAG_CONST").
value: The associated value.
short_name: The enumeration name, with the suffix stripped.
"""
def __init__(self, name, value):
self.name = name
self.value = value
- self.short_name = name.replace("TYPE_FLAG_", '')
- if self.short_name == name:
- self.short_name = name.replace("TYPE_INSTANCE_FLAG_", '')
+ self.short_name = name.replace("TYPE_INSTANCE_FLAG_", '')
def __cmp__(self, other):
"""Sort by value order."""
return self.value.__cmp__(other.value)
-# A list of all existing TYPE_FLAGS_* and TYPE_INSTANCE_FLAGS_*
-# enumerations, stored as TypeFlags objects. Lazy-initialized.
+# A list of all existing TYPE_INSTANCE_FLAGS_* enumerations,
+# stored as TypeFlags objects. Lazy-initialized.
TYPE_FLAGS = None
class TypeFlagsPrinter:
@@ -86,24 +83,13 @@ class TypeFlagsPrinter:
global TYPE_FLAGS
TYPE_FLAGS = []
try:
- flags = gdb.lookup_type("enum type_flag_value")
- except:
- print("Warning: Cannot find enum type_flag_value type.")
- print(" `struct type' pretty-printer will be degraded")
- return
- try:
iflags = gdb.lookup_type("enum type_instance_flag_value")
except:
print("Warning: Cannot find enum type_instance_flag_value type.")
print(" `struct type' pretty-printer will be degraded")
return
- # Note: TYPE_FLAG_MIN is a duplicate of TYPE_FLAG_UNSIGNED,
- # so exclude it from the list we are building.
TYPE_FLAGS = [TypeFlag(field.name, field.enumval)
- for field in flags.fields()
- if field.name != 'TYPE_FLAG_MIN']
- TYPE_FLAGS += [TypeFlag(field.name, field.enumval)
- for field in iflags.fields()]
+ for field in iflags.fields()]
TYPE_FLAGS.sort()
class StructTypePrettyPrinter: