This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch 3/3 optional] Template Lookup


This patch improves the output provided by patch 2 in the series. It makes the meta symbol created for templates aware of its instanced within scope. So if the symbol table contained:

foo<int>(int)
foo<char>(char)
Bar<int>
Bar<char>

and the user did:

(gdb) print foo
or
(gdb) ptype Bar

Symbol represents a template and cannot be evaluated.
Did you mean:
   foo<int>(int)
   foo<char>(char)
Address of symbol "foo" is unknown.

and

Symbol represents a template and cannot be evaluated.
Did you mean:
   Bar<int>
   Bar<char>
type = Template Symbol

respectively. The output needs a bit of cleanup. This is achieved through a bit of coordination between symbol evaluation and type printing. Also the instance suggested will come only from the current scope. If this template had instance in other blocks or files they will not be presented here.

I don't think completing the work on this patch would provide significant improvement on user experience but I posted it as a demonstration, to get other opinions.

Attachment: template_lookup_3.patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]