Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(525)

Unified Diff: gdb/testsuite/gdb.python/py-prettyprint.py

Issue 11969036: Merge GDB 7.5.1 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@master
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gdb/testsuite/gdb.python/py-prettyprint.exp ('k') | gdb/testsuite/gdb.python/py-progspace.exp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gdb/testsuite/gdb.python/py-prettyprint.py
diff --git a/gdb/testsuite/gdb.python/py-prettyprint.py b/gdb/testsuite/gdb.python/py-prettyprint.py
index 52ffd1a100891636a6db9653149f4c429fe421b6..6e960e6805d543b78112ef7f9a55e4201c2ba426 100644
--- a/gdb/testsuite/gdb.python/py-prettyprint.py
+++ b/gdb/testsuite/gdb.python/py-prettyprint.py
@@ -174,6 +174,18 @@ class pp_hint_error:
def display_hint (self):
raise Exception("hint failed")
+class pp_children_as_list:
+ "Throw error from display_hint"
+
+ def __init__(self, val):
+ self.val = val
+
+ def to_string(self):
+ return 'children_as_list_val'
+
+ def children (self):
+ return [('one', 1)]
+
class pp_outer:
"Print struct outer"
@@ -199,6 +211,14 @@ class MemoryErrorString:
def display_hint (self):
return 'string'
+class pp_eval_type:
+ def __init__(self, val):
+ self.val = val
+
+ def to_string(self):
+ gdb.execute("bt", to_string=True)
+ return "eval=<" + str(gdb.parse_and_eval("eval_func (123456789, 2, 3, 4, 5, 6, 7, 8)")) + ">"
+
def lookup_function (val):
"Look-up and return a pretty-printer that can print val."
@@ -274,8 +294,13 @@ def register_pretty_printers ():
pretty_printers_dict[re.compile ('^struct hint_error$')] = pp_hint_error
pretty_printers_dict[re.compile ('^hint_error$')] = pp_hint_error
+ pretty_printers_dict[re.compile ('^struct children_as_list$')] = pp_children_as_list
+ pretty_printers_dict[re.compile ('^children_as_list$')] = pp_children_as_list
+
pretty_printers_dict[re.compile ('^memory_error$')] = MemoryErrorString
+ pretty_printers_dict[re.compile ('^eval_type_s$')] = pp_eval_type
+
pretty_printers_dict = {}
register_pretty_printers ()
« no previous file with comments | « gdb/testsuite/gdb.python/py-prettyprint.exp ('k') | gdb/testsuite/gdb.python/py-progspace.exp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698