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 1/7] New macro THREAD_WITHIN_SINGLE_STEP_RANGE
Date: Mon, 11 Mar 2013 12:53:00 -0000	[thread overview]
Message-ID: <1363006291-13334-2-git-send-email-yao@codesourcery.com> (raw)
In-Reply-To: <1363006291-13334-1-git-send-email-yao@codesourcery.com>

This patch moves code into a macro, which will be used in my
following patches.

gdb:

2013-03-11  Yao Qi  <yao@codesourcery.com>

	* gdbthread.h (THREAD_WITHIN_SINGLE_STEP_RANGE): New macro.
	* infrun.c (handle_inferior_event): Use it.
---
 gdb/gdbthread.h |    6 ++++++
 gdb/infrun.c    |    6 ++----
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h
index 824e4d0..6f47006 100644
--- a/gdb/gdbthread.h
+++ b/gdb/gdbthread.h
@@ -37,6 +37,12 @@ enum thread_state
   THREAD_EXITED,
 };
 
+/* PC is within the range of single stepping of thread THR.  */
+
+#define THREAD_WITHIN_SINGLE_STEP_RANGE(THR, PC)	\
+  ((PC) >= (THR)->control.step_range_start		\
+   && (PC) < (THR)->control.step_range_end)
+
 /* Inferior thread specific part of `struct infcall_control_state'.
 
    Inferior process counterpart is `struct inferior_control_state'.  */
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 1cf30fe..5bc276c 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -4340,8 +4340,7 @@ process_event_stop_test:
 
       if (ecs->event_thread->control.step_range_end != 0
 	  && ecs->event_thread->suspend.stop_signal != GDB_SIGNAL_0
-	  && (ecs->event_thread->control.step_range_start <= stop_pc
-	      && stop_pc < ecs->event_thread->control.step_range_end)
+	  && THREAD_WITHIN_SINGLE_STEP_RANGE (ecs->event_thread, stop_pc)
 	  && frame_id_eq (get_stack_frame_id (frame),
 			  ecs->event_thread->control.step_stack_frame_id)
 	  && ecs->event_thread->control.step_resume_breakpoint == NULL)
@@ -4710,8 +4709,7 @@ process_event_stop_test:
      through a function epilogue and therefore must detect when
      the current-frame changes in the middle of a line.  */
 
-  if (stop_pc >= ecs->event_thread->control.step_range_start
-      && stop_pc < ecs->event_thread->control.step_range_end
+  if (THREAD_WITHIN_SINGLE_STEP_RANGE (ecs->event_thread, stop_pc)
       && (execution_direction != EXEC_REVERSE
 	  || frame_id_eq (get_frame_id (frame),
 			  ecs->event_thread->control.step_frame_id)))
-- 
1.7.7.6


  reply	other threads:[~2013-03-11 12:53 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-11 12:52 [PATCH 0/7] Range stepping Yao Qi
2013-03-11 12:53 ` Yao Qi [this message]
2013-05-14 19:24   ` [PATCH 1/7] New macro THREAD_WITHIN_SINGLE_STEP_RANGE Pedro Alves
2013-03-11 12:53 ` [PATCH 6/7] range stepping: test case Yao Qi
2013-05-14 18:32   ` Pedro Alves
2013-05-15  8:27     ` Yao Qi
2013-05-20 18:29       ` Pedro Alves
2013-05-22 14:01         ` Yao Qi
2013-03-11 12:53 ` [PATCH 5/7] range stepping: New command 'maint set range stepping' Yao Qi
2013-03-11 17:05   ` Eli Zaretskii
2013-03-18  3:10     ` Yao Qi
2013-03-18  5:39       ` Eli Zaretskii
2013-05-14 18:31   ` Pedro Alves
2013-03-11 12:53 ` [PATCH 4/7] range stepping: gdb Yao Qi
2013-05-14 18:31   ` Pedro Alves
2013-05-15  8:07     ` Yao Qi
2013-05-20 17:59       ` Pedro Alves
2013-03-11 12:53 ` [PATCH 3/7] range stepping: gdbserver on x86/linux Yao Qi
2013-05-14 18:30   ` Pedro Alves
2013-05-15  7:40     ` Yao Qi
2013-05-20 18:00       ` Pedro Alves
2013-05-22 10:06         ` Yao Qi
2013-03-11 12:53 ` [PATCH 7/7] range stepping: doc and NEWS Yao Qi
2013-03-11 13:38   ` Abid, Hafiz
2013-03-11 17:01   ` Eli Zaretskii
2013-05-14 18:32   ` Pedro Alves
2013-03-11 12:53 ` [PATCH 2/7] Move rs->support_vCont_t to a separate struct Yao Qi
2013-03-14 20:12 ` [PATCH 0/7] Range stepping Pedro Alves
2013-03-15 19:54   ` Pedro Alves
2013-03-22  2:25     ` Yao Qi
2013-03-22 20:24       ` Pedro Alves
2013-04-11  6:16 ` [PATCH 0/7 V2] " Yao Qi
2013-04-11  6:17   ` [PATCH 1/7] New macro THREAD_WITHIN_SINGLE_STEP_RANGE Yao Qi
2013-04-11  6:17   ` [PATCH 2/7] Move rs->support_vCont_t to a separate struct Yao Qi
2013-04-11  6:18   ` [PATCH 3/7] range stepping: gdbserver on x86/linux Yao Qi
2013-04-11  6:19   ` [PATCH 5/7] range stepping: New command 'maint set range stepping' Yao Qi
2013-04-11 23:00     ` Eli Zaretskii
2013-04-11  6:19   ` [PATCH 4/7] range stepping: gdb Yao Qi
2013-04-11 13:22     ` Yao Qi
2013-04-12 12:35       ` Yao Qi
2013-04-11  6:38   ` [PATCH 6/7] range stepping: test case Yao Qi
2013-04-11  7:30   ` [PATCH 7/7] range stepping: doc and NEWS Yao Qi
2013-04-11 23:00     ` Eli Zaretskii
2013-04-12 20:48   ` [PATCH 0/7 V2] Range stepping 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=1363006291-13334-2-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