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 1/3] Template Lookup


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.

Attachment: template_lookup_1.patch
Description: Text document


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