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: [RFC] win32-nat.c 'set new-console' and interruption


A Monday 23 June 2008 15:23:06, Pierre Muller wrote:

> I have a proposal to remove that possible race condition:
> The exception record has a field that contains the exception
> address, if I test that there is no GDB inserted breakpoint at
> that location before converting the TARGET_SIGNAL_TRAP
> into a TARGET_SIGNAL_INT, it should fix most problems, no?
>
>   The one case that it would still not catch would be
> a 'int 3' instruction that is in the debuggee code from the start
> but other than at startup, such instructions are quite unlikely, no?
>

IIRC, DebugBreakProcess injects a thread in the debuggee and
always breaks at the same address / in the same function -- I don't
know if there's a hardcoded 0xcc at the break address you
could check, or if the exception is generated programatically,
but at least you could conditionalize on the function name (if there's
no hardcoded break, you still can't distiguish by name only a user
break placed in that special break function)

Another option is to use SuspendThread on all threads to stop
the process, which is what I believe Visual Studio uses.
gdbserver has that implemented for systems that don't have
DebugBreakProcess.

-- 
Pedro Alves


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