diff options
Diffstat (limited to 'gdb/python/lib/gdb/command/unwinders.py')
-rw-r--r-- | gdb/python/lib/gdb/command/unwinders.py | 94 |
1 files changed, 49 insertions, 45 deletions
diff --git a/gdb/python/lib/gdb/command/unwinders.py b/gdb/python/lib/gdb/command/unwinders.py index 0af4698..59ee67c 100644 --- a/gdb/python/lib/gdb/command/unwinders.py +++ b/gdb/python/lib/gdb/command/unwinders.py @@ -49,28 +49,29 @@ def parse_unwinder_command_args(arg): locus_regexp = argv[0] if argc >= 2: name_regexp = argv[1] - return (validate_regexp(locus_regexp, "locus"), - validate_regexp(name_regexp, "unwinder")) + return ( + validate_regexp(locus_regexp, "locus"), + validate_regexp(name_regexp, "unwinder"), + ) class InfoUnwinder(gdb.Command): """GDB command to list unwinders. -Usage: info unwinder [LOCUS-REGEXP [NAME-REGEXP]] + Usage: info unwinder [LOCUS-REGEXP [NAME-REGEXP]] -LOCUS-REGEXP is a regular expression matching the location of the -unwinder. If it is omitted, all registered unwinders from all -loci are listed. A locus can be 'global', 'progspace' to list -the unwinders from the current progspace, or a regular expression -matching filenames of objfiles. + LOCUS-REGEXP is a regular expression matching the location of the + unwinder. If it is omitted, all registered unwinders from all + loci are listed. A locus can be 'global', 'progspace' to list + the unwinders from the current progspace, or a regular expression + matching filenames of objfiles. -NAME-REGEXP is a regular expression to filter unwinder names. If -this omitted for a specified locus, then all registered unwinders -in the locus are listed.""" + NAME-REGEXP is a regular expression to filter unwinder names. If + this omitted for a specified locus, then all registered unwinders + in the locus are listed.""" def __init__(self): - super(InfoUnwinder, self).__init__("info unwinder", - gdb.COMMAND_STACK) + super(InfoUnwinder, self).__init__("info unwinder", gdb.COMMAND_STACK) def list_unwinders(self, title, unwinders, name_re): """Lists the unwinders whose name matches regexp. @@ -85,22 +86,25 @@ in the locus are listed.""" print(title) for unwinder in unwinders: if name_re.match(unwinder.name): - print(" %s%s" % (unwinder.name, - "" if unwinder.enabled else " [disabled]")) + print( + " %s%s" + % (unwinder.name, "" if unwinder.enabled else " [disabled]") + ) def invoke(self, arg, from_tty): locus_re, name_re = parse_unwinder_command_args(arg) if locus_re.match("global"): - self.list_unwinders("Global:", gdb.frame_unwinders, - name_re) + self.list_unwinders("Global:", gdb.frame_unwinders, name_re) if locus_re.match("progspace"): cp = gdb.current_progspace() - self.list_unwinders("Progspace %s:" % cp.filename, - cp.frame_unwinders, name_re) + self.list_unwinders( + "Progspace %s:" % cp.filename, cp.frame_unwinders, name_re + ) for objfile in gdb.objfiles(): if locus_re.match(objfile.filename): - self.list_unwinders("Objfile %s:" % objfile.filename, - objfile.frame_unwinders, name_re) + self.list_unwinders( + "Objfile %s:" % objfile.filename, objfile.frame_unwinders, name_re + ) def do_enable_unwinder1(unwinders, name_re, flag): @@ -129,34 +133,35 @@ def do_enable_unwinder(arg, flag): if locus_re.match("global"): total += do_enable_unwinder1(gdb.frame_unwinders, name_re, flag) if locus_re.match("progspace"): - total += do_enable_unwinder1(gdb.current_progspace().frame_unwinders, - name_re, flag) + total += do_enable_unwinder1( + gdb.current_progspace().frame_unwinders, name_re, flag + ) for objfile in gdb.objfiles(): if locus_re.match(objfile.filename): - total += do_enable_unwinder1(objfile.frame_unwinders, name_re, - flag) + total += do_enable_unwinder1(objfile.frame_unwinders, name_re, flag) if total > 0: gdb.invalidate_cached_frames() - print("%d unwinder%s %s" % (total, "" if total == 1 else "s", - "enabled" if flag else "disabled")) + print( + "%d unwinder%s %s" + % (total, "" if total == 1 else "s", "enabled" if flag else "disabled") + ) class EnableUnwinder(gdb.Command): """GDB command to enable unwinders. -Usage: enable unwinder [LOCUS-REGEXP [NAME-REGEXP]] + Usage: enable unwinder [LOCUS-REGEXP [NAME-REGEXP]] -LOCUS-REGEXP is a regular expression specifying the unwinders to -enable. It can 'global', 'progspace', or the name of an objfile -within that progspace. + LOCUS-REGEXP is a regular expression specifying the unwinders to + enable. It can 'global', 'progspace', or the name of an objfile + within that progspace. -NAME_REGEXP is a regular expression to filter unwinder names. If -this omitted for a specified locus, then all registered unwinders -in the locus are affected.""" + NAME_REGEXP is a regular expression to filter unwinder names. If + this omitted for a specified locus, then all registered unwinders + in the locus are affected.""" def __init__(self): - super(EnableUnwinder, self).__init__("enable unwinder", - gdb.COMMAND_STACK) + super(EnableUnwinder, self).__init__("enable unwinder", gdb.COMMAND_STACK) def invoke(self, arg, from_tty): """GDB calls this to perform the command.""" @@ -166,19 +171,18 @@ in the locus are affected.""" class DisableUnwinder(gdb.Command): """GDB command to disable the specified unwinder. -Usage: disable unwinder [LOCUS-REGEXP [NAME-REGEXP]] + Usage: disable unwinder [LOCUS-REGEXP [NAME-REGEXP]] -LOCUS-REGEXP is a regular expression specifying the unwinders to -disable. It can 'global', 'progspace', or the name of an objfile -within that progspace. + LOCUS-REGEXP is a regular expression specifying the unwinders to + disable. It can 'global', 'progspace', or the name of an objfile + within that progspace. -NAME_REGEXP is a regular expression to filter unwinder names. If -this omitted for a specified locus, then all registered unwinders -in the locus are affected.""" + NAME_REGEXP is a regular expression to filter unwinder names. If + this omitted for a specified locus, then all registered unwinders + in the locus are affected.""" def __init__(self): - super(DisableUnwinder, self).__init__("disable unwinder", - gdb.COMMAND_STACK) + super(DisableUnwinder, self).__init__("disable unwinder", gdb.COMMAND_STACK) def invoke(self, arg, from_tty): """GDB calls this to perform the command.""" |