| Submitter | Phil Muldoon |
|---|---|
| Date | March 21, 2013, 10:23 a.m. |
| Message ID | <514ADF9B.1090407@redhat.com> |
| Download | mbox | patch |
| Permalink | /patch/229621/ |
| State | New |
| Headers | show |
Comments
>>>>> "Phil" == Phil Muldoon <pmuldoon@redhat.com> writes:
Phil> 2013-03-21 Phil Muldoon <pmuldoon@redhat.com>
Phil> PR gdb/15195
I think this should use a full URL.
Otherwise it is going to attach the commit to some random GCC bug.
Phil> * python/libstdcxx/v6/printers.py (StdTuplePrinter): Convert
Phil> referenced value to actual if type is TYPE_CODE_REF.
This should reference the function, like "(StdTuplePrinter.to_string):"
Phil> def to_string (self):
Why doesn't the 'children' method also need a fix?
If they both need the fix you might as well put the dereferencing into
the constructor.
Also, Phil and I discussed this on irc, and he is going to write a
regression test.
thanks,
Tom
Patch
Index: printers.py =================================================================== --- printers.py (revision 196862) +++ printers.py (working copy) @@ -318,7 +318,12 @@ return self._iterator (self.val) def to_string (self): - if len (self.val.type.fields ()) == 0: + type = self.val.type + if type.code == gdb.TYPE_CODE_REF: + self.val = self.val.referenced_value() + type = self.val.type + + if len(type.fields ()) == 0: return 'empty %s' % (self.typename) return '%s containing' % (self.typename)