public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Doug Evans <xdje42@gmail.com>
To: Yao Qi <qiyaoltc@gmail.com>, Pedro Alves <palves@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 2/2] Replace address and aspace with thread in struct step_over_info
Date: Wed, 20 Apr 2016 18:01:00 -0000	[thread overview]
Message-ID: <m34mawrwgl.fsf@sspiff.org> (raw)
In-Reply-To: <86a8kpk8k1.fsf@gmail.com> (Yao Qi's message of "Tue, 19 Apr 2016	14:54:54 +0100")

Yao Qi <qiyaoltc@gmail.com> writes:
> Pedro Alves <palves@redhat.com> writes:
>
>> I think this is problematic.
>>
>> While a thread is being stepped past a breakpoint, it's possible that the
>> user sets some other breakpoint, and then we end up in
>> stepping_past_instruction_at
>> deciding whether we can insert that new breakpoint, while the step-over thread
>> is running.
>>
>> As soon as the step-over thread is resumed for the actual step-over, it's
>> regcache is flushed (target_resume -> registers_changed_ptid).  From that point
>> and until the thread stops again, trying to fetch its regcache will error out,
>> because you can't read registers from a thread that is running.
>
> OK, that is a good case.  I didn't think of it.  I withdraw the patch.

A good place for a comment explaining Why Things Are The Way They Are.

Not sure how you want to word this.

2016-04-20  Doug Evans  <xdje42@gmail.com>

	* infrun.c (set_step_over_info): Add comment.

diff --git a/gdb/infrun.c b/gdb/infrun.c
index 696105d..c7ea5e2 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -1325,7 +1325,9 @@ struct step_over_info
 static struct step_over_info step_over_info;
 
 /* Record the address of the breakpoint/instruction we're currently
-   stepping over.  */
+   stepping over.
+   N.B. We record the aspace and address now, instead of say just the thread,
+   because when we need the info later the thread may be running.  */
 
 static void
 set_step_over_info (struct address_space *aspace, CORE_ADDR address,

  reply	other threads:[~2016-04-20 18:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-15 13:29 [PATCH 0/2] Add thread info in 'struct step_over_info' Yao Qi
2016-04-15 13:29 ` [PATCH 2/2] Replace address and aspace with thread in struct step_over_info Yao Qi
2016-04-19 10:43   ` Pedro Alves
2016-04-19 13:55     ` Yao Qi
2016-04-20 18:01       ` Doug Evans [this message]
2016-04-20 18:03         ` Pedro Alves
2016-12-22 23:51           ` Doug Evans
2016-04-15 13:29 ` [PATCH 1/2] Refactor function set_step_over_info 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=m34mawrwgl.fsf@sspiff.org \
    --to=xdje42@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    --cc=qiyaoltc@gmail.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).