public inbox for archer@sourceware.org
 help / color / mirror / Atom feed
* [python] fix merge lossage
@ 2009-07-28 21:54 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2009-07-28 21:54 UTC (permalink / raw)
  To: Project Archer

This patch fixes a couple problems introduced during the last merge.

Tom

diff --git a/gdb/testsuite/gdb.python/python-prettyprint.c b/gdb/testsuite/gdb.python/python-prettyprint.c
index fe2fd25..5cc35be 100644
--- a/gdb/testsuite/gdb.python/python-prettyprint.c
+++ b/gdb/testsuite/gdb.python/python-prettyprint.c
@@ -175,10 +175,6 @@ main ()
   ns.null_str = "embedded\0null\0string";
   ns.length = 20;
 
-  struct ns  ns;
-  ns.null_str = "embedded\0null\0string";
-  ns.length = 20;
-
 #ifdef __cplusplus
   S cps;
 
diff --git a/gdb/testsuite/gdb.python/python-prettyprint.py b/gdb/testsuite/gdb.python/python-prettyprint.py
index 828802a..c3e0dc4 100644
--- a/gdb/testsuite/gdb.python/python-prettyprint.py
+++ b/gdb/testsuite/gdb.python/python-prettyprint.py
@@ -92,6 +92,13 @@ class pp_vbase1:
     def to_string (self):
         return "pp class name: " + self.val.type.tag
 
+class pp_nullstr:
+    def __init__(self, val):
+        self.val = val
+
+    def to_string(self):
+        return self.val['s'].string(gdb.parameter('target-charset'))
+
 class pp_ns:
     "Print a std::basic_string of some kind"
 
@@ -149,6 +156,9 @@ def register_pretty_printers ():
     pretty_printers_dict[re.compile ('^VirtualTest$')] =  pp_multiple_virtual
     pretty_printers_dict[re.compile ('^Vbase1$')] =  pp_vbase1
 
+    pretty_printers_dict[re.compile ('^struct nullstr$')] = pp_nullstr
+    pretty_printers_dict[re.compile ('^nullstr$')] = pp_nullstr
+    
     # Note that we purposely omit the typedef names here.
     # Printer lookup is based on canonical name.
     # However, we do need both tagged and untagged variants, to handle

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-07-28 21:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-28 21:54 [python] fix merge lossage Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).