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

Unified Diff: gdb/testsuite/gdb.python/py-typeprint.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-typeprint.exp ('k') | gdb/testsuite/gdb.python/py-value.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gdb/testsuite/gdb.python/py-typeprint.py
diff --git a/gdb/testsuite/gdb.python/py-error.py b/gdb/testsuite/gdb.python/py-typeprint.py
similarity index 59%
copy from gdb/testsuite/gdb.python/py-error.py
copy to gdb/testsuite/gdb.python/py-typeprint.py
index 815284919304a1818e9171624dbf42d724369dba..9afb005eef022715b5ff3dda150e175934273836 100644
--- a/gdb/testsuite/gdb.python/py-error.py
+++ b/gdb/testsuite/gdb.python/py-typeprint.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2010-2012 Free Software Foundation, Inc.
+# Copyright (C) 2012-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
@@ -15,11 +15,21 @@
import gdb
-class ClassName(gdb.Command):
- 'a'
+class Recognizer(object):
def __init__(self):
- gdb.Command.__init__ (self, "ClassName", gdb.COMMAND_DATA, prefix=True)
- def invoke(self, args, from_tty):
- print
+ self.enabled = True
-ClassName()
+ def recognize(self, type_obj):
+ if type_obj.tag == 'basic_string':
+ return 'string'
+ return None
+
+class StringTypePrinter(object):
+ def __init__(self):
+ self.name = 'string'
+ self.enabled = True
+
+ def instantiate(self):
+ return Recognizer()
+
+gdb.type_printers.append(StringTypePrinter())
« no previous file with comments | « gdb/testsuite/gdb.python/py-typeprint.exp ('k') | gdb/testsuite/gdb.python/py-value.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698