gdb: Fix bug with dbx style func command.
authorAndrew Burgess <andrew.burgess@embecosm.com>
Mon, 7 Sep 2015 07:53:24 +0000 (08:53 +0100)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Mon, 12 Oct 2015 21:29:43 +0000 (23:29 +0200)
The func command, available when starting gdb in dbx mode, is supposed
to take a function name and locate the frame for that function in the
stack.  This has been broken for a while due to an invalid check of the
arguments within the worker function.  Fixed in this commit.

gdb/ChangeLog:

* stack.c (func_command): Return early when there is no ARG
string.

gdb/testsuite/ChangeLog:

* gdb.base/dbx.exp (test_func): Remove xfails, update expected
results.

gdb/ChangeLog
gdb/stack.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/dbx.exp

index 799bf30946c9a4d82c933d516dc958876bfa2a96..397b2932897db9164cb2763c26362781a7aaff72 100644 (file)
@@ -1,3 +1,8 @@
+2015-10-12  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * stack.c (func_command): Return early when there is no ARG
+       string.
+
 2015-10-12  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * stack.c: Include safe-ctype.h not ctype.h.
index f257ce1962e8dfc2783a66339f50e798a79c7753..e7c7de9101537740d5f2bc2b9e11bb88918741e5 100644 (file)
@@ -2518,7 +2518,7 @@ func_command (char *arg, int from_tty)
   struct function_bounds *func_bounds = NULL;
   struct cleanup *cleanups;
 
-  if (arg != NULL)
+  if (arg == NULL)
     return;
 
   frame = parse_frame_specification ("0");
index 9aeefa864ee0fb5130f3aafe2e074c1fde96c623..74aa6aeb3419510d5d192b5544641929c4b18e3b 100644 (file)
@@ -1,3 +1,8 @@
+2015-10-12  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * gdb.base/dbx.exp (test_func): Remove xfails, update expected
+       results.
+
 2015-10-12  Yao Qi  <yao.qi@linaro.org>
 
        * gdb.arch/disp-step-insn-reloc.exp: New test case.
index 19dba62ebac92b06698b1eaf0159f1536f00dfda..75cb0fd7a8e59aef05c184818e6d03aea64837ee 100644 (file)
@@ -293,15 +293,11 @@ proc test_func { } {
     global srcfile2
     gdb_test "cont" ".*" "cont 1"
     gdb_test "step" ".*"
-    # This always fails, but it's not clear why. -sts 1999-08-17
-    setup_xfail "*-*-*"
     gdb_test "func sum" "'sum' not within current stack frame\."
     set stop_line [gdb_get_line_number "stop-in-sum" $srcfile2]
     gdb_test "stop in sum" "Breakpoint.*at.*: file.*sum\.c, line $stop_line\."
     gdb_test "cont" ".*" "cont 2"
-    # This always fails, but it's not clear why. -sts 1999-08-17
-    setup_xfail "*-*-*"
-    gdb_test "func print_average" ".*in print_average.*\\(list=.*, low=0, high=6\\).*at.*average\.c:${decimal}\r\n\${decimal}\[ \t\]+total = sum\\(list, low, high\\);"
+    gdb_test "func print_average" ".*in print_average.*\\(list=.*, low=0, high=6\\).*at.*average\.c:${decimal}\r\n${decimal}\[ \t\]+total = sum\\(list, low, high\\);"
 }
 
 # Start with a fresh gdb.