]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Allow "info address" of a template parameter
authorTom Tromey <tom@tromey.com>
Thu, 19 Jul 2018 17:24:49 +0000 (11:24 -0600)
committerTom Tromey <tom@tromey.com>
Thu, 2 Aug 2018 22:12:42 +0000 (16:12 -0600)
commit3e1d3d8c2494c021718ba957e83395958ee08a0f
treeb0836b010bf5cb9f9d70729a404725cd44ec36dc
parent1584354913285389063622a39f845851f332eb9a
Allow "info address" of a template parameter

PR symtab/16842 shows that gdb will crash when the user tries to
invoke "info address" of a template parameter.

The bug here is that dwarf2read.c does not set the symtab on the
template parameter symbols.  This is pedantically correct, given that
the template symbols do not appear in a symtab.  However, gdb
primarily uses the symtab backlink to find the symbol's objfile.  So,
this patch simply sets the symtab on these symbols.

Tested by the buildbot.

gdb/ChangeLog
2018-08-02  Tom Tromey  <tom@tromey.com>

PR symtab/16842.
* dwarf2read.c (read_func_scope): Set symtab on template parameter
symbols.
(process_structure_scope): Likewise.

gdb/testsuite/ChangeLog
2018-08-02  Tom Tromey  <tom@tromey.com>

PR symtab/16842.
* gdb.cp/temargs.exp: Test "info address" of a template
parameter.
gdb/ChangeLog
gdb/dwarf2read.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.cp/temargs.exp