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

Unified Diff: gdb/testsuite/gdb.python/py-frame-args.py

Issue 124383005: GDB 7.6.50 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@upstream
Patch Set: Created 6 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-frame-args.exp ('k') | gdb/testsuite/gdb.python/py-frame-inline.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gdb/testsuite/gdb.python/py-frame-args.py
diff --git a/gdb/testsuite/gdb.python/py-objfile-script-gdb.py.in b/gdb/testsuite/gdb.python/py-frame-args.py
similarity index 75%
copy from gdb/testsuite/gdb.python/py-objfile-script-gdb.py.in
copy to gdb/testsuite/gdb.python/py-frame-args.py
index 4de67923226d341d091b2b9d412f6ffd6c03db73..65c9ad72aef778027446620a257a6ce1690fc4da 100644
--- a/gdb/testsuite/gdb.python/py-objfile-script-gdb.py.in
+++ b/gdb/testsuite/gdb.python/py-frame-args.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2011-2012 Free Software Foundation, Inc.
+# Copyright (C) 2013 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -13,16 +13,28 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# This file is part of the GDB testsuite.
-
import re
+import gdb
+
+class pp_s (object):
+ def __init__(self, val):
+ self.val = val
+
+ def to_string(self):
+ m = self.val["m"]
+ return "m=<" + str(self.val["m"]) + ">"
-class pp_ss:
+class pp_ss (object):
def __init__(self, val):
self.val = val
def to_string(self):
- return "a=<" + str(self.val["a"]) + "> b=<" + str(self.val["b"]) + ">"
+ return "super struct"
+
+ def children (self):
+ yield 'a', self.val['a']
+ yield 'b', self.val['b']
+
def lookup_function (val):
"Look-up and return a pretty-printer that can print val."
@@ -39,7 +51,6 @@ def lookup_function (val):
# Get the type name.
typename = type.tag
-
if typename == None:
return None
@@ -51,13 +62,14 @@ def lookup_function (val):
return pretty_printers_dict[function] (val)
# Cannot find a pretty printer. Return None.
-
return None
+
def register_pretty_printers ():
- pretty_printers_dict[re.compile ('^ss$')] = pp_ss
+ pretty_printers_dict[re.compile ('^s$')] = pp_s
+ pretty_printers_dict[re.compile ('^ss$')] = pp_ss
pretty_printers_dict = {}
register_pretty_printers ()
-gdb.current_progspace().pretty_printers.append (lookup_function)
+gdb.pretty_printers.append (lookup_function)
« no previous file with comments | « gdb/testsuite/gdb.python/py-frame-args.exp ('k') | gdb/testsuite/gdb.python/py-frame-inline.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698