* Python: gdb.Type.template_argument method issue @ 2011-09-14 19:33 Paul_Koning 2011-09-15 11:17 ` Phil Muldoon 0 siblings, 1 reply; 3+ messages in thread From: Paul_Koning @ 2011-09-14 19:33 UTC (permalink / raw) To: gdb The template_argument method assumes that all template arguments are types. While that's the most common, other things are also found in the wild. My C++ book says that the arguments can be integers, enums, pointers, references, or pointer-to-member constant values. (GCC doesn't want to accept pointers and references, perhaps because it thinks they are relocatable.) Looking at the code, it appears that the template_argument method will be looking at the demangled type string. It seems that that's insufficient to sort out exactly what a given template argument is. For example, if it's an enum, the method will simply see the enum value name, but I don't see how it would know which enum type that is so that doesn't allow it to nail down exactly what we have. I figure that the thing to do would be to have the method return either a gdb.Type or a gdb.Value, depending on what the template argument is. But it looks like it needs more detailed knowledge about the template arguments than it has in the current logic, and I don't know enough GDB to know where to look for that. Any hints on where to look? paul ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Python: gdb.Type.template_argument method issue 2011-09-14 19:33 Python: gdb.Type.template_argument method issue Paul_Koning @ 2011-09-15 11:17 ` Phil Muldoon 2011-09-15 14:06 ` Paul_Koning 0 siblings, 1 reply; 3+ messages in thread From: Phil Muldoon @ 2011-09-15 11:17 UTC (permalink / raw) To: Paul_Koning; +Cc: gdb <Paul_Koning@Dell.com> writes: > The template_argument method assumes that all template arguments are types. While that's the most common, other things are also found in the wild. My C++ book says that the arguments can be integers, enums, pointers, references, or pointer-to-member constant values. (GCC doesn't want to accept pointers and references, perhaps because it thinks they are relocatable.) http://sourceware.org/bugzilla/show_bug.cgi?id=11060 > Any hints on where to look? If that is the issue you are encountering, it looks like it has been fixed in GDB, but you need a newer GCC to take advantage of it. Cheers Phil ^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: Python: gdb.Type.template_argument method issue 2011-09-15 11:17 ` Phil Muldoon @ 2011-09-15 14:06 ` Paul_Koning 0 siblings, 0 replies; 3+ messages in thread From: Paul_Koning @ 2011-09-15 14:06 UTC (permalink / raw) To: pmuldoon; +Cc: gdb [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #1: Type: text/plain; charset="utf-8", Size: 390 bytes --] >> The template_argument method assumes that all template arguments are >> types. ... > >http://sourceware.org/bugzilla/show_bug.cgi?id=11060 > >If that is the issue you are encountering, it looks like it has been fixed in GDB, but you need a newer GCC to take advantage of it. Yes, that's it. Thanks, so all I have to do is update to the latest. paul \x16º&ÖëzÛ«\x7f{ób²Ö«r\x18\x1d ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-09-15 14:06 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2011-09-14 19:33 Python: gdb.Type.template_argument method issue Paul_Koning 2011-09-15 11:17 ` Phil Muldoon 2011-09-15 14:06 ` Paul_Koning
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox