public inbox for archer@sourceware.org
 help / color / mirror / Atom feed
* Question on pr python/11060
@ 2010-01-15 16:35 Phil Muldoon
  2010-01-15 17:04 ` Tom Tromey
  0 siblings, 1 reply; 2+ messages in thread
From: Phil Muldoon @ 2010-01-15 16:35 UTC (permalink / raw)
  To: Project Archer

http://sourceware.org/bugzilla/show_bug.cgi?id=11060

I believe this is happening as  DEMANGLE_COMPONENT_LITERAL is not being accounted for in the type lookup. In this case of a template argument resolving to LITERAL, is it ok just to return the type backing the argument without further manipulation? I spent a few hours this morning looking for side-effects but came up blank. Types seems to resolve as expected (ie in the <42> case it is an int type). Thoughts?

Rough patch:

diff --git a/gdb/python/py-type.c b/gdb/python/py-type.c
index a97c125..bcd3f4f 100644
--- a/gdb/python/py-type.c
+++ b/gdb/python/py-type.c
@@ -475,7 +475,8 @@ typy_lookup_type (struct demangle_component *demangled)
   if (demangled_type == DEMANGLE_COMPONENT_POINTER
       || demangled_type == DEMANGLE_COMPONENT_REFERENCE
       || demangled_type == DEMANGLE_COMPONENT_CONST
-      || demangled_type == DEMANGLE_COMPONENT_VOLATILE)
+      || demangled_type == DEMANGLE_COMPONENT_VOLATILE
+      || demangled_type == DEMANGLE_COMPONENT_LITERAL)
     {
       type = typy_lookup_type (demangled->u.s_binary.left);
       if (! type)
@@ -491,6 +492,8 @@ typy_lookup_type (struct demangle_component *demangled)
          return make_cv_type (1, 0, type, NULL);
        case DEMANGLE_COMPONENT_VOLATILE:
          return make_cv_type (0, 1, type, NULL);
+       case DEMANGLE_COMPONENT_LITERAL:
+         return type;
        }
     }

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Question on pr python/11060
  2010-01-15 16:35 Question on pr python/11060 Phil Muldoon
@ 2010-01-15 17:04 ` Tom Tromey
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2010-01-15 17:04 UTC (permalink / raw)
  To: Phil Muldoon; +Cc: Project Archer

>>>>> "Phil" == Phil Muldoon <pmuldoon@redhat.com> writes:

Phil> http://sourceware.org/bugzilla/show_bug.cgi?id=11060

Phil> I believe this is happening as DEMANGLE_COMPONENT_LITERAL is not
Phil> being accounted for in the type lookup. In this case of a template
Phil> argument resolving to LITERAL, is it ok just to return the type
Phil> backing the argument without further manipulation?

I think that in the literal case, Type.template_argument should return
the literal -- not the type of the literal.

This means you would have to turn the literal into a Value with the
proper type.

Tom

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-01-15 17:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-15 16:35 Question on pr python/11060 Phil Muldoon
2010-01-15 17:04 ` 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).