Remove redundant WIFSTOPPED check

Message ID 1458204900-22253-1-git-send-email-yao.qi@linaro.org
State New, archived
Headers

Commit Message

Yao Qi March 17, 2016, 8:55 a.m. UTC
  WIFSTOPPED is checked linux_wstatus_maybe_breakpoint, so WIFSTOPPED
in "WIFSTOPPED (wstat) && linux_wstatus_maybe_breakpoint (wstat)"
is redundant.  This patch removes WIFSTOPPED check.

gdb/gdbserver:

2016-03-17  Yao Qi  <yao.qi@linaro.org>

	* linux-low.c (linux_low_filter_event): Remove redundant
	WIFSTOPPED check together with linux_wstatus_maybe_breakpoint.
---
 gdb/gdbserver/linux-low.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Pedro Alves March 17, 2016, 4:05 p.m. UTC | #1
On 03/17/2016 08:55 AM, Yao Qi wrote:
> WIFSTOPPED is checked linux_wstatus_maybe_breakpoint, so WIFSTOPPED
> in "WIFSTOPPED (wstat) && linux_wstatus_maybe_breakpoint (wstat)"
> is redundant.  This patch removes WIFSTOPPED check.

OK.

Thanks,
Pedro Alves
  

Patch

diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index 3ba3949..e0887a6 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -2443,7 +2443,7 @@  linux_low_filter_event (int lwpid, int wstat)
 	}
     }
 
-  if (WIFSTOPPED (wstat) && linux_wstatus_maybe_breakpoint (wstat))
+  if (linux_wstatus_maybe_breakpoint (wstat))
     {
       if (save_stop_reason (child))
 	have_stop_pc = 1;