This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2 2/5] PR breakpoints/7143 - Watchpoint does not trigger when first set
- From: Doug Evans <xdje42 at gmail dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 11 Mar 2014 00:41:55 -0400
- Subject: Re: [PATCH v2 2/5] PR breakpoints/7143 - Watchpoint does not trigger when first set
- Authentication-results: sourceware.org; auth=none
- References: <1394037536-7526-1-git-send-email-palves at redhat dot com> <1394037536-7526-3-git-send-email-palves at redhat dot com> <wrb8usogpn3 dot fsf at sspiff dot org> <53191F37 dot 6020601 at redhat dot com>
Pedro Alves <palves@redhat.com> writes:
>> My more meatier comment is that it's hard to reason about the passing
>> of parameters from the caller of insert_breakpoints to
>> should_be_inserted via global variables (which is essentially what
>> you're doing (*1)) because each of them have multiple callers, and some of
>> the callers don't appear (AFAICT) immediately related to the task at hand.
>>
>> (*1) It's not clear from my reading of the patch that there isn't more to
>> it than that though.
>> I see you clearing step_over_{aspace,address} in handle_inferior_event
>> so I'm left wondering if I'm missing something. E.g., is there a reason
>> to not clear them immediately after calling insert_breakpoints?
>
> Yes. Say you're in async + bps always-inserted mode, and the
> user sets a breakpoint just while GDB is stepping over
> a breakpoint. We'd end up inserting all breakpoints, even
> the one being stepped over. That's actually a bug at present.
> So we should make sure that we don't insert a breakpoint at the
> location we're trying to step over, until the step over is
> done (or aborted). That's usually until the next event, but
> thinking again, it might not be -- say we get a signal while
> stepping over the breakpoint. So I simplified "too much"
> in v2...
Ah.
So what we need to do is maintain some state until the thread
has completed it's step over. Makes sense.
IWBN to encapsulate this more. I'll take a look at v3.
Thanks.