Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: gdb-patches@sourceware.org
Subject: Add comments on step_after_step_resume_breakpoint
Date: Wed, 07 Sep 2011 02:35:00 -0000	[thread overview]
Message-ID: <4E66C8ED.5070902@codesourcery.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 519 bytes --]

When I am reading struct thread_info, I find the comment on 
step_after_step_resume_breakpoint is not helpful to me to understand it, 
until I read the original patch here 
http://cygwin.com/ml/gdb-patches/2004-08/msg00743.html

The explanation of the patch was very clear, but it is missing in the 
comment of code.  This patch is to copy some of words in original patch 
post to the comment on field `step_after_step_resume_breakpoint', in 
order to make comment self-explained.

OK to apply?

-- 
Yao (齐尧)

[-- Attachment #2: 0002-comment-on-step_after_step_resume_breakpoint.patch --]
[-- Type: text/x-patch, Size: 1196 bytes --]

	gdb/
	gdbthread.h (struct thread_info): Comment on field
	`step_after_step_resume_breakpoint'.

---
 gdb/gdbthread.h |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h
index 0b19a8d..6baeb92 100644
--- a/gdb/gdbthread.h
+++ b/gdb/gdbthread.h
@@ -176,7 +176,14 @@ struct thread_info
   int stepping_over_breakpoint;
 
   /* Set to TRUE if we should finish single-stepping over a breakpoint
-     after hitting the current step-resume breakpoint.  */
+     after hitting the current step-resume breakpoint.  The context here
+     is that GDB is to do `next' or `step' while signal arrives.
+     When stepping over a breakpoint and signal arrives, GDB will attempt
+     to skip signal handler, so it inserts a step_resume_breakpoint at the
+     signal return address, and resume inferior.
+     step_after_step_resume_breakpoint is set to TRUE at this moment in
+     order to keep GDB in mind that there is still a breakpoint to step over
+     when GDB gets back SIGTRAP from step_resume_breakpoint.  */
   int step_after_step_resume_breakpoint;
 
   /* This is set TRUE when a catchpoint of a shared library event
-- 
1.7.0.4


             reply	other threads:[~2011-09-07  1:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-07  2:35 Yao Qi [this message]
2011-09-07  9:53 ` Pedro Alves
2011-09-07 13:58   ` [committed]; " Yao Qi

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=4E66C8ED.5070902@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