Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: <gdb-patches@sourceware.org>
Subject: [PATCH] Remove redundant condition checking.
Date: Tue, 15 Jan 2013 09:31:00 -0000	[thread overview]
Message-ID: <1358242261-16209-1-git-send-email-yao@codesourcery.com> (raw)

Hi,
I find a redundant condition checking the infcmd.c:step_once,

      if (!single_inst) <--- [1]
	{
	  CORE_ADDR pc;

	  /* Step at an inlined function behaves like "down".  */
	  if (!skip_subroutines && !single_inst <-- [2]
	      && inline_skipped_frames (inferior_ptid))

The condition '!single_inst' is checked in both [1] and [2], but the
checking in [2] is not necessary.  This patch is to remove the
checking in [2], because I don't see keep it in [2] helps
understanding the code.  It is obvious to me, but the review is still
welcome.

gdb:

2013-01-15  Yao Qi  <yao@codesourcery.com>

	* infcmd.c (step_once): Don't check '!single_inst' as it was
	check before.
---
 gdb/infcmd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 085903d..fb34ae4 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -1032,7 +1032,7 @@ step_once (int skip_subroutines, int single_inst, int count, int thread)
 	  CORE_ADDR pc;
 
 	  /* Step at an inlined function behaves like "down".  */
-	  if (!skip_subroutines && !single_inst
+	  if (!skip_subroutines
 	      && inline_skipped_frames (inferior_ptid))
 	    {
 	      ptid_t resume_ptid;
-- 
1.7.7.6


             reply	other threads:[~2013-01-15  9:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-15  9:31 Yao Qi [this message]
2013-01-15 14:38 ` Pedro Alves
2013-01-16 14:48   ` committed: " Yao Qi
2013-01-15  9:35 Yao Qi
2013-01-15 21:19 ` Pedro Alves
2013-01-15 21:20 ` Pedro Alves

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=1358242261-16209-1-git-send-email-yao@codesourcery.com \
    --to=yao@codesourcery.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