aboutsummaryrefslogtreecommitdiff
path: root/gdb/source.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2017-09-04 16:49:29 +0100
committerPedro Alves <palves@redhat.com>2017-09-04 16:49:29 +0100
commite439fa140afdaedb28a97acaa2b0432b884d8a91 (patch)
tree93a1682af136319ce89647a5186295ccc0feb1f9 /gdb/source.c
parent7525b645dfaa302091591d0f87d9682ce988ed13 (diff)
downloadgdb-e439fa140afdaedb28a97acaa2b0432b884d8a91.zip
gdb-e439fa140afdaedb28a97acaa2b0432b884d8a91.tar.gz
gdb-e439fa140afdaedb28a97acaa2b0432b884d8a91.tar.bz2
Clarify "list" output when specified lines are ambiguous
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 "foo" above expands to multiple locations, the specified range is indeterminate, and GDB is trying to be helpful by showing you what was ambiguous. It looks confusing to me, though. I think it'd be much more user friendly if GDB actually told you that, like this: (gdb) list foo,bar Specified first line 'foo' is ambiguous: file: "file0.c", line number: 26 file: "file1.c", line number: 29 (gdb) list bar,foo Specified last line 'foo' is ambiguous: file: "file0.c", line number: 26 file: "file1.c", line number: 29 Note, I'm using "first" and "last" in the output because that's what the manual uses: ~~~ list first,last Print lines from first to last. [...] ~~~ Tested on x86-64 GNU/Linux. gdb/ChangeLog: 2017-09-04 Pedro Alves <palves@redhat.com> * cli/cli-cmds.c (edit_command): Pass message to ambiguous_line_spec. (list_command): Pass message to ambiguous_line_spec. Say "first"/"last" instead of "start" and "end" to be consistent with the manual. (ambiguous_line_spec): Add 'format' and vararg parameters. Use them to print formatted message. gdb/testsuite/ChangeLog: 2017-09-04 Pedro Alves <palves@redhat.com> * gdb.base/list-ambiguous.exp: New file. * gdb.base/list-ambiguous0.c: New file. * gdb.base/list-ambiguous1.c: New file. * gdb.base/list.exp (test_list_range): Adjust expected output.
Diffstat (limited to 'gdb/source.c')
0 files changed, 0 insertions, 0 deletions