This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: delete_breakpoint: don't try to insert other breakpoints
Eli Zaretskii wrote:
>> From: Vladimir Prus <vladimir@codesourcery.com>
>> Date: Wed, 14 Nov 2007 23:24:10 +0300
>>
>> The delete_breakpoint function tries to check if the
>> breakpoint being deleted is inserted in inferior, and if
>> so, searched for breakpoints that are set at the same address
>> and tries to insert them. However, GDB removes breakpoint
>> from the inferior immediately when inferior is stopped,
>> so this code will never run.
>
> I think you are assuming that this code does and will always run
> synchronously. Is that a valid assumption?
At the moment, I'm not aware of any way to invoke delete_breakpoint
while existing breakpoints are inserted. Is there one?
(In particular, "target async" does not seem to work at all).
In future, this situation might be possible. However, in general
I think it's better to start by making code clear while still
working for current GDB, and then adjust it as needed for future GDB.
In this particular case, a call to insert_breakpoints, together
with some adjustments, would be much better for any future async code,
as it won't duplicate code logic.
- Volodya