aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/list.exp
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/testsuite/gdb.base/list.exp
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/testsuite/gdb.base/list.exp')
-rw-r--r--gdb/testsuite/gdb.base/list.exp2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.base/list.exp b/gdb/testsuite/gdb.base/list.exp
index 5377571..d554c9e 100644
--- a/gdb/testsuite/gdb.base/list.exp
+++ b/gdb/testsuite/gdb.base/list.exp
@@ -361,7 +361,7 @@ proc test_list_range {} {
gdb_test "list ${past_end},${much_past_end}" "Line number ${past_end} out of range; .*list0.c has ${last_line} lines." "list range; both bounds past EOF"
- gdb_test "list list0.c:2,list1.c:17" "Specified start and end are in different files." "list range, must be same files"
+ gdb_test "list list0.c:2,list1.c:17" "Specified first and last lines are in different files." "list range, must be same files"
}
#