This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2 2/5] PR breakpoints/7143 - Watchpoint does not trigger when first set


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]