gdb/testsuite/
* gdb.python/py-prettyprint.c (struct hint_error): New. (main): New variable hint_error. * gdb.python/py-prettyprint.exp (run_lang_tests): New testcase "print hint_error". * gdb.python/py-prettyprint.py (class pp_hint_error): New. (register_pretty_printers): Register it.
This commit is contained in:
parent
ed0d9c711c
commit
e1ab1f9c66
4 changed files with 31 additions and 0 deletions
|
@ -161,6 +161,18 @@ class pp_ls:
|
|||
def display_hint (self):
|
||||
return 'string'
|
||||
|
||||
class pp_hint_error:
|
||||
"Throw error from display_hint"
|
||||
|
||||
def __init__(self, val):
|
||||
self.val = val
|
||||
|
||||
def to_string(self):
|
||||
return 'hint_error_val'
|
||||
|
||||
def display_hint (self):
|
||||
raise Exception("hint failed")
|
||||
|
||||
class pp_outer:
|
||||
"Print struct outer"
|
||||
|
||||
|
@ -246,6 +258,9 @@ def register_pretty_printers ():
|
|||
pretty_printers_dict[re.compile ('^struct outerstruct$')] = pp_outer
|
||||
pretty_printers_dict[re.compile ('^outerstruct$')] = pp_outer
|
||||
|
||||
pretty_printers_dict[re.compile ('^struct hint_error$')] = pp_hint_error
|
||||
pretty_printers_dict[re.compile ('^hint_error$')] = pp_hint_error
|
||||
|
||||
pretty_printers_dict = {}
|
||||
|
||||
register_pretty_printers ()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue