diff options
author | Tom Tromey <tom@tromey.com> | 2017-08-06 11:07:28 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2017-11-29 09:21:43 -0700 |
commit | 02ca603a481d55e175765ab5bff30a04b86e905a (patch) | |
tree | fb350aae24af9313a5fc0e41f34c751de56ba8ce /gdb/testsuite | |
parent | ed6c0bfb2643861636581ac8775144efa1728c7c (diff) | |
download | gdb-02ca603a481d55e175765ab5bff30a04b86e905a.zip gdb-02ca603a481d55e175765ab5bff30a04b86e905a.tar.gz gdb-02ca603a481d55e175765ab5bff30a04b86e905a.tar.bz2 |
Fix add-symbol-file usage and errors
This patch updates add-symbol-file help and error text.
It changes add-symbol-file to throw an exception if "-s" is seen but
not all of the arguments are given. Previously this was silently
ignored.
It changes the unrecognized argument message to more clearly state
what went wrong.
Finally, it updates the usage line in the help text to follow GNU
style regarding "metasyntactic variables"; a change I believe should
be made to all gdb help messages.
gdb/ChangeLog
2017-11-29 Tom Tromey <tom@tromey.com>
* symfile.c (add_symbol_file_command): Error if some arguments to
-s are missing. Change unrecognized-argument error message.
(_initialize_symfile): Fix usage text for add-symbol-file.
gdb/testsuite/ChangeLog
2017-11-29 Tom Tromey <tom@tromey.com>
* gdb.base/relocate.exp: Update invalid argument test.
Add new tests for invalid arguments.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/relocate.exp | 12 |
2 files changed, 15 insertions, 2 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 87b917e..4fba24b 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-11-29 Tom Tromey <tom@tromey.com> + + * gdb.base/relocate.exp: Update invalid argument test. + Add new tests for invalid arguments. + 2017-11-29 Thomas Preud'homme <thomas.preudhomme@arm.com> * gdb.cp/psymtab-parameter.cc (func): Change return type back to long. diff --git a/gdb/testsuite/gdb.base/relocate.exp b/gdb/testsuite/gdb.base/relocate.exp index 5639cc8..6eef15f 100644 --- a/gdb/testsuite/gdb.base/relocate.exp +++ b/gdb/testsuite/gdb.base/relocate.exp @@ -31,11 +31,19 @@ gdb_reinitialize_dir $srcdir/$subdir #Check that invalid options are rejected. foreach x {"-raednow" "readnow" "foo" "-readnow s"} { + set word [lindex $x [expr [llength $x]-1]] gdb_test "add-symbol-file ${binfile} 0 $x" \ - "USAGE: add-symbol-file <filename> <textaddress>.*-readnow.*-s <secname> <addr>.*" \ - "add-symbol-file: unknown option $x" + "Unrecognized argument \"$word\"" \ + "add-symbol-file: unknown option $word" } +gdb_test "add-symbol-file ${binfile} 0 -s" \ + "Missing section name after .-s." \ + "add-symbol-file bare -s" +gdb_test "add-symbol-file ${binfile} 0 -s .whatever" \ + "Missing section address after .-s." \ + "add-symbol-file missing address" + # Load the object file. gdb_test "add-symbol-file ${binfile} 0" \ "Reading symbols from .*${testfile}\\.o\\.\\.\\.done\\.(|\r\nUsing host libthread_db library .*libthread_db.so.*\\.)" \ |