This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Inconsistency between cli and python breakpoints for ignore count tracking
- From: Doug Evans <xdje42 at gmail dot com>
- To: Pedro Alves <palves at redhat dot com>, Phil Muldoon <pmuldoon at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 14 Nov 2013 09:33:57 -0800
- Subject: Re: Inconsistency between cli and python breakpoints for ignore count tracking
- Authentication-results: sourceware.org; auth=none
- References: <CAP9bCMSrU6kEheSYcOxJLt1W1Cgg1mt=yQDu9eXsGZxQiSpLcw at mail dot gmail dot com> <5283C4E6 dot 3070400 at redhat dot com>
Pedro Alves <palves@redhat.com> writes:
> On 11/13/2013 08:10 AM, Doug Evans wrote:
>
>> Does anyone have a reasonable explanation for why we do ignore_count
>> tracking for python breakpoints (even with a "stop" method) but not
>> for breakpoints that have a cli condition that doesn't trigger? The
>> inconsistency doesn't feel right to me.
>
> I agree.
>
>> ref: breakpoint.c:bpstat_check_breakpoint_conditions
>>
>> if (cond && value_is_zero)
>> {
>> bs->stop = 0;
>> }
>> else if (b->thread != -1 && b->thread != thread_id)
>> {
>> bs->stop = 0;
>> }
>> else if (b->ignore_count > 0)
>> {
>
> I think this should be:
>
> - else if (b->ignore_count > 0)
> +
> + if (bs->stop && b->ignore_count > 0)
>
> Or whatever equivalent. IOW, "ignore" only comes into play
> if otherwise the breakpoint would cause a stop.
>
>> b->ignore_count--;
>> bs->stop = 0;
>> /* Increase the hit count even though we don't stop. */
>> ++(b->hit_count);
>> observer_notify_breakpoint_modified (b);
>> }
I will check this in then if there are no objections.
Thanks.
2013-11-14 Doug Evans <xdje42@gmail.com>
* breakpoint.c (bpstat_check_breakpoint_conditions): Check
ignore_count after processing Python conditions as well as CLI
conditions.
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 5bfed9d..6694afd 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -5225,7 +5225,10 @@ bpstat_check_breakpoint_conditions (bpstat bs, ptid_t ptid)
{
bs->stop = 0;
}
- else if (b->ignore_count > 0)
+
+ /* If we still think we need to stop after processing the conditions,
+ check the ignore count. */
+ if (bs->stop && b->ignore_count > 0)
{
b->ignore_count--;
bs->stop = 0;