Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Yao Qi <yao@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 1/9] Decide whether we may have removed breakpoints based on step_over_info
Date: Thu, 02 Oct 2014 18:05:00 -0000	[thread overview]
Message-ID: <542D93F8.7050005@redhat.com> (raw)
In-Reply-To: <87fvfbx65x.fsf@codesourcery.com>

On 09/28/2014 01:48 PM, Yao Qi wrote:
> Pedro Alves <palves@redhat.com> writes:
> 
>> gdb/
>> 2014-09-22  Pedro Alves  <palves@redhat.com>
>>
>> 	* infrun.c (step_over_info_valid_p): New function.
>> 	(resume): Use step_over_info_valid_p instead of checking the
>> 	threads's trap_expected flag.  Add debug output.
>                                        ^^^^^^^^^^^^^^^^
> I don't see any debug output added by the code.  Maybe a staled changelog entry?

Yeah, I ended up removing that code.  Will fix, thanks.

> 
>> +/* Returns true if step-over info is valid.  */
>> +
>> +static int
>> +step_over_info_valid_p (void)
>> +{
>> +  return (step_over_info.aspace != NULL);
>> +}
>> +
> 
> How about replace "step_over_info.aspace != NULL" in
> stepping_past_instruction_at with step_over_info_valid_p too?

See patch 2/9.  With that, step_over_info_valid_p will return
true if we're stepping over a watchpoint, but aspace will
be NULL.

> 
>>    /* Advise target which signals may be handled silently.  If we have
>> -     removed breakpoints because we are stepping over one (which can
>> -     happen only if we are not using displaced stepping), we need to
>> +     removed breakpoints because we are stepping over one, we need to
>>       receive all signals to avoid accidentally skipping a breakpoint
>>       during execution of a signal handler.  */
>> -  if ((step || singlestep_breakpoints_inserted_p)
>> -      && tp->control.trap_expected
>> -      && !use_displaced_stepping (gdbarch))
>> +  if (step_over_info_valid_p ())
> 
> Why do we remove condition (step || singlestep_breakpoints_inserted_p)?
> I understand that step_over_info_valid_p is equivalent to
> "tp->control.trap_expected && !use_displaced_stepping (gdbarch)", so I
> don't know why (step || singlestep_breakpoints_inserted_p) is removed
> too.

It ends up unnecessary, and it seems to me to be more to the
point.

I.e., if we have step-over info, then something, somewhere wants a
breakpoint lifted out of the target.  No matter whether we're
stepping or continuing the target at this point, we need to receive
all signals so that if the signal handler calls the code that
would trigger the breakpoint/watchpoint, we don't miss it.

Removing this check now avoids having tweak it when
singlestep_breakpoints_inserted_p check global ends up
eliminated by a later patch in the series.

Does that make sense?

> 
>>      target_pass_signals (0, NULL);
>>    else
>>      target_pass_signals ((int) GDB_SIGNAL_LAST, signal_pass);

Thanks,
Pedro Alves


  reply	other threads:[~2014-10-02 18:05 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-26  0:39 [PATCH 0/9] software single-step support rework, fix limitations Pedro Alves
2014-09-26  0:39 ` [PATCH 2/9] Rewrite non-continuable watchpoints handling Pedro Alves
2014-09-26  0:39 ` [PATCH 1/9] Decide whether we may have removed breakpoints based on step_over_info Pedro Alves
2014-09-28 12:52   ` Yao Qi
2014-10-02 18:05     ` Pedro Alves [this message]
2014-10-06  1:06       ` Yao Qi
2014-10-06  8:42         ` Pedro Alves
2014-09-26  0:40 ` [PATCH 4/9] Remove deprecated_insert_raw_breakpoint and friends Pedro Alves
2014-09-26  0:40 ` [PATCH 3/9] Put single-step breakpoints on the bp_location chain Pedro Alves
2014-09-28 12:36   ` Yao Qi
2014-09-30 13:01     ` Pedro Alves
2014-09-30 13:15       ` Pedro Alves
2014-09-29  6:33   ` Yao Qi
2014-10-02 17:55     ` Pedro Alves
2014-09-26  0:40 ` [PATCH 9/9] Non-stop + software single-step archs: don't force displaced-stepping for all single-steps Pedro Alves
2014-09-26  0:40 ` [PATCH 5/9] Switch back to stepped thread: clear step-over info Pedro Alves
2014-09-30 16:33   ` Pedro Alves
2014-09-26  0:40 ` [PATCH 8/9] Make single-step breakpoints be per-thread Pedro Alves
2014-09-26  1:18 ` [PATCH 6/9] thread.c: cleanup breakpoint deletion Pedro Alves
2014-09-26  1:36 ` [PATCH 7/9] infrun.c: add for_each_just_stopped_thread 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=542D93F8.7050005@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=yao@codesourcery.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