summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.python/py-prettyprint.py
diff options
context:
space:
mode:
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 85c50aaae17..9a0d1072b2d 100644
--- a/gdb/testsuite/gdb.python/py-prettyprint.py
+++ b/gdb/testsuite/gdb.python/py-prettyprint.py
@@ -112,6 +112,18 @@ class pp_ns:
def display_hint (self):
return 'string'
+class pp_ls:
+ "Print a std::basic_string of some kind"
+
+ def __init__(self, val):
+ self.val = val
+
+ def to_string(self):
+ return self.val['lazy_str'].lazy_string()
+
+ def display_hint (self):
+ return 'string'
+
class pp_outer:
"Print struct outer"
@@ -184,6 +196,9 @@ def register_pretty_printers ():
pretty_printers_dict[re.compile ('^struct ns$')] = pp_ns
pretty_printers_dict[re.compile ('^ns$')] = pp_ns
+ pretty_printers_dict[re.compile ('^struct lazystring$')] = pp_ls
+ pretty_printers_dict[re.compile ('^lazystring$')] = pp_ls
+
pretty_printers_dict[re.compile ('^struct outerstruct$')] = pp_outer
pretty_printers_dict[re.compile ('^outerstruct$')] = pp_outer