Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Burgess <andrew.burgess@embecosm.com>
To: gdb-patches@sourceware.org
Cc: Andrew Burgess <andrew.burgess@embecosm.com>
Subject: [PATCH 5/9] gdb: Fix bug with dbx style func command.
Date: Fri, 11 Sep 2015 18:50:00 -0000	[thread overview]
Message-ID: <8629fd6198d107d87d4db9b3eec45774bfaae2b6.1441996064.git.andrew.burgess@embecosm.com> (raw)
In-Reply-To: <cover.1441996064.git.andrew.burgess@embecosm.com>
In-Reply-To: <cover.1441996064.git.andrew.burgess@embecosm.com>

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                  | 5 +++++
 gdb/stack.c                    | 2 +-
 gdb/testsuite/ChangeLog        | 5 +++++
 gdb/testsuite/gdb.base/dbx.exp | 6 +-----
 4 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 50aa7f0..7c4b567 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
 2015-09-11  Andrew Burgess  <andrew.burgess@embecosm.com>
 
+	* stack.c (func_command): Return early when there is no ARG
+	string.
+
+2015-09-11  Andrew Burgess  <andrew.burgess@embecosm.com>
+
 	* stack.c: Include safe-ctype.h not ctype.h.
 	(parse_frame_specification): Use ISSPACE not isspace.
 	(backtrace_command): Use TOLOWER not tolower.
diff --git a/gdb/stack.c b/gdb/stack.c
index 2fe176f..1049995 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -2527,7 +2527,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");
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index ee0ad76..272d3fc 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,10 @@
 2015-09-11  Andrew Burgess  <andrew.burgess@embecosm.com>
 
+	* gdb.base/dbx.exp (test_func): Remove xfails, update expected
+	results.
+
+2015-09-11  Andrew Burgess  <andrew.burgess@embecosm.com>
+
 	* gdb.base/create-frame.exp: Add test for 'info frame' with
 	specific address.
 
diff --git a/gdb/testsuite/gdb.base/dbx.exp b/gdb/testsuite/gdb.base/dbx.exp
index 19dba62..75cb0fd 100644
--- a/gdb/testsuite/gdb.base/dbx.exp
+++ b/gdb/testsuite/gdb.base/dbx.exp
@@ -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.
-- 
2.5.1


  parent reply	other threads:[~2015-09-11 18:50 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-11 18:49 [PATCH 0/9] Changes to frame selection Andrew Burgess
2015-09-11 18:49 ` [PATCH 2/9] gdb: Select a frame for frame_info Andrew Burgess
2015-09-11 18:50 ` [PATCH 3/9] gdb: Make use of safe-ctype.h header Andrew Burgess
2015-09-30 13:43   ` Pedro Alves
2015-09-11 18:50 ` [PATCH 8/9] gdb: Split func_command into two parts Andrew Burgess
2015-09-30 13:52   ` Pedro Alves
2015-09-11 18:50 ` Andrew Burgess [this message]
2015-09-30 13:47   ` [PATCH 5/9] gdb: Fix bug with dbx style func command Pedro Alves
2015-10-26 13:40     ` Thomas Preud'homme
2015-10-26 16:33       ` Andrew Burgess
2015-09-11 18:50 ` [PATCH 1/9] gdb: Check the selected-frame in frame_find_by_id Andrew Burgess
2015-09-30 13:40   ` Pedro Alves
2015-09-11 18:50 ` [PATCH 7/9] gdb: Simplify parse_frame_specification Andrew Burgess
2015-09-30 13:50   ` Pedro Alves
2015-09-11 18:50 ` [PATCH 6/9] gdb: Avoid unneeded calls to parse_frame_specification Andrew Burgess
2015-09-30 13:48   ` Pedro Alves
2015-09-11 18:50 ` [PATCH 9/9] gdb: Change how frames are selected for 'frame' and 'info frame' Andrew Burgess
2015-09-11 20:21   ` Eli Zaretskii
2015-09-15 10:41     ` Andrew Burgess
2015-09-15 10:50       ` Eli Zaretskii
2015-09-17 11:36         ` Andrew Burgess
2015-09-30 14:00   ` Pedro Alves
2015-09-11 18:50 ` [PATCH 4/9] gdb/doc: Restructure frame command documentation Andrew Burgess
2015-09-11 20:17   ` Eli Zaretskii
2015-10-12 21:43 ` [PATCH 0/9] Changes to frame selection Andrew Burgess

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8629fd6198d107d87d4db9b3eec45774bfaae2b6.1441996064.git.andrew.burgess@embecosm.com \
    --to=andrew.burgess@embecosm.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox