printers.py issue
Jonathan Wakely
jwakely@redhat.com
Thu Mar 4 14:57:28 GMT 2021
On 04/03/21 14:19 +0000, Hoyer, David via Libstdc++ wrote:
>Thank you for this feedback. We are certainly writing our own pretty-print functions which leverage the printers.py function. These worked fine with the jessie GCC and stretch GDB. I will continue to investigate from my end to see if we are doing something wrong (heaven forbid that be possible 😉)
I see. Then it might be possible that you're constructing a
StdSetPrinter with a gdb.Type object as the "typename" argument. I
when the libstdc++ printers are created they are always given a string
for that argument.
For problem 1 (the typ.unqualified() issue) I've done some digging
(see https://sourceware.org/bugzilla/show_bug.cgi?id=27510 for
details) and although I remain confused, I think typ.tag is what we
want. We've already done strip_typedefs() so we should have a class
type by that point, and .tag will be the unqualified class name.
I'll test this patch:
--- a/libstdc++-v3/python/libstdcxx/v6/printers.py
+++ b/libstdc++-v3/python/libstdcxx/v6/printers.py
@@ -85,8 +85,8 @@ except ImportError:
def find_type(orig, name):
typ = orig.strip_typedefs()
while True:
- # Strip cv-qualifiers. PR 67440.
- search = '%s::%s' % (typ.unqualified(), name)
+ # Use Type.tag to ignore cv-qualifiers. PR 67440.
+ search = '%s::%s' % (typ.tag, name)
try:
return gdb.lookup_type(search)
except RuntimeError:
More information about the Libstdc++
mailing list