[patch 1/3] Template Lookup

sami wagiaalla swagiaal@redhat.com
Mon Jul 19 15:28:00 GMT 2010


Names of template symbols in debug info contains the full template 
parameters such as:

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

while this is useful for differentiating various instances of template 
it provides unnatural user experience when you user tries to call these 
functions. For example:

(gdb) print foo<int>(1)
(gdb) print foo<char>('a')

This patch removes the template parameters from the name and stores the 
cleaned name in a newly created variable 'search_name' in the -now 
obstack allocated- 'cplus_specific' structure.

So now the user can do:

(gdb) print foo(1)
(gdb) print foo('a')

The function choice is made by overload resolution as it should be.

Functionality that required the fully qualified name still works. For 
example:

(gdb) break foo<char>

This is because if the user included template parameters in the name 
then the template name is double checked for every hit.

This series was tested by running the testsuit on Fedora 13 with gcc 
4.4.4 on x8664.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: template_lookup_1.patch
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20100719/162c2687/attachment.ksh>


More information about the Gdb-patches mailing list