This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Clarify "list" output when specified lines are ambiguous
- From: Pedro Alves <palves at redhat dot com>
- To: gdb-patches at sourceware dot org
- Cc: Zhouyi Zhou <zhouzhouyi at gmail dot com>
- Date: Mon, 4 Sep 2017 16:59:23 +0100
- Subject: Re: [PATCH] Clarify "list" output when specified lines are ambiguous
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx06.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 DCCCC47043
- References: <1503431270-19557-1-git-send-email-palves@redhat.com>
On 08/22/2017 08:47 PM, Pedro Alves wrote:
> Currently, with "list LINESPEC1,LINESPEC2", if one of the linespecs is
> ambiguous, i.e., if it expands to multiple locations, you get this
> seemingly odd output:
>
> (gdb) list foo,bar
> file: "file0.c", line number: 26
> file: "file1.c", line number: 29
>
> Since "ambiguous" expands to multiple locations, the specified range
Above I meant 'Since "foo" expands ...'.
I've pushed this in with that change now.
FYI, I have a WIP patch that makes gdb print the symbol name as
well, like:
(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)"
^^^^^^^^^^^^^^^^^^
and:
(gdb) set listsize 3
(gdb) list bar
file: "src/gdb/testsuite/gdb.cp/overload.cc", line number: 97, symbol: "bar(A)"
96
97 int bar (A) { return 11; }
98 int bar (B) { return 22; }
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; }
99
^^^^^^^^^^^^^^^^^^
Thanks,
Pedro Alves