aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.python/py-prettyprint.py
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2011-04-11 17:40:41 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2011-04-11 17:40:41 +0000
commite1ab1f9c669fbcb1a13218823dd08592bddb90d8 (patch)
tree81a535f4901e4e6eae2107414c9884e219c5586e /gdb/testsuite/gdb.python/py-prettyprint.py
parented0d9c711c14c280d4c06bb200eaad162549efcb (diff)
downloadbinutils-e1ab1f9c669fbcb1a13218823dd08592bddb90d8.zip
binutils-e1ab1f9c669fbcb1a13218823dd08592bddb90d8.tar.gz
binutils-e1ab1f9c669fbcb1a13218823dd08592bddb90d8.tar.bz2
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.
Diffstat (limited to 'gdb/testsuite/gdb.python/py-prettyprint.py')
-rw-r--r--gdb/testsuite/gdb.python/py-prettyprint.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.python/py-prettyprint.py b/gdb/testsuite/gdb.python/py-prettyprint.py
index 831a163..92280e0 100644
--- a/gdb/testsuite/gdb.python/py-prettyprint.py
+++ b/gdb/testsuite/gdb.python/py-prettyprint.py
@@ -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 ()