This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 0/2] Make "list ambiguous" show symbol names too
- From: Pedro Alves <palves at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Mon, 4 Sep 2017 19:47:36 +0100
- Subject: [PATCH 0/2] Make "list ambiguous" show symbol names too
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=palves at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B380D4E4CA
This series makes "list ambiguous" a bit clearer by printing the
symbol name for each of the ambiguous locations as well:
(gdb) list bar,main
Specified first line 'bar' is ambiguous:
file: "src/gdb/testsuite/gdb.cp/overload.cc", line number: 97, symbol: "bar(A)"
file: "src/gdb/testsuite/gdb.cp/overload.cc", line number: 98, symbol: "bar(B)"
^^^^^^^^^^^^^^^^^
(gdb) list bar
file: "src/gdb/testsuite/gdb.cp/overload.cc", line number: 97, symbol: "bar(A)"
96
97 int bar (A) { return 11; }
file: "src/gdb/testsuite/gdb.cp/overload.cc", line number: 98, symbol: "bar(B)"
97 int bar (A) { return 11; }
98 int bar (B) { return 22; }
^^^^^^^^^^^^^^^^^
The "symbol: ..." parts above are new. That's patch #2.
While working on that, I decided to test also the case of "list
ambiguous_global_variable", which exposed the fact that that doesn't
really work... So I fixed it too. That's patch #1.
Tested on x86-64 Fedora 23.
Pedro Alves (2):
Fix "list ambiguous_variable"
Make "list ambiguous" show symbol names too
gdb/cli/cli-cmds.c | 29 ++++++++++----
gdb/linespec.c | 63 +++++++++++++++++++------------
gdb/symtab.c | 2 +
gdb/symtab.h | 1 +
gdb/testsuite/gdb.base/list-ambiguous.exp | 41 +++++++++++---------
gdb/testsuite/gdb.base/list-ambiguous0.c | 5 ++-
gdb/testsuite/gdb.base/list-ambiguous1.c | 5 ++-
gdb/testsuite/gdb.cp/overload.exp | 4 +-
8 files changed, 93 insertions(+), 57 deletions(-)
--
2.5.5