Fix add-symbol-file usage and errors
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / relocate.exp
index 5639cc88473f04d9d4023208112de12ac72308d4..6eef15fb20e3aa2c43dc6b3e5662053dc2ae9508 100644 (file)
@@ -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.*\\.)" \
This page took 0.024153 seconds and 4 git commands to generate.