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: [RFA] Stop infrun from tracking breakpoint insertion status.


Vladimir Prus wrote:

> The use of breakpoints_meant_to_be_inserted in handle_inferiour_event, 
> for the TARGET_WAITKIND_LOADED,  did not matter because 
> TARGET_WAITKIND_LOADED is used by just a few targets.
> And even if remote.c can use it, it does not do when 
> using gdbserver, which makes it hard to test.

Hmmm, if it helps, I could run a test on AIX, which does use
TARGET_WAITKIND_LOADED.

In any case, at this point breakpoints *must* be inserted -- the
very next thing the code does is to call
          resume (0, TARGET_SIGNAL_0);
so if breakpoints were not inserted, we'd just run the inferior
to completion now.

So I think the check is not necessary, and we should simply
unconditionally insert breakpoints at this point. 
 
> The reason that use in keep_going does not break anything is that
> the intention of the code is to insert breakpoints, unless either
> they are already inserted, or ecs->another_trap is non-zero. However,
> insert_bp_location will immediately return if breakpoint location
> is already inserted. Therefore, the "already inserted" check is
> not necessary at all, and I removed it.

OK, agreed.
 
> As for the use in insert_step_resume_breakpoint_at_sal, I must admit
> I've got lost in the code again -- I don't know how previous version
> of the patch did not cause any problems.

I think this is because calls to insert_step_resume_breakpoint_at_sal
are always followed by calls to keep_going -- and due to the behaviour
you described above, with your old patch keep_going would always 
insert the step-resume breakpoint anyway.

In fact, I think with the change to keep_going to always insert all
breakpoints there is no need for insert_step_resume_breakpoint_at_sal
to call insert_breakpoints at all anymore.  This should probably
best be removed.


If I've counted correctly, with the changes I've described we've
completely eliminated the need for breakpoints_meant_to_be_inserted.
Would you mind updating your patch accordingly?


Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


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