[PATCH 1/3] Handle 64bit breakpoints of WOW64 processes as SIGINT

Simon Marchi simark@simark.ca
Thu Sep 24 16:42:31 GMT 2020


On 2020-09-24 12:37 p.m., Hannes Domani via Gdb-patches wrote:
>  Am Donnerstag, 24. September 2020, 17:29:50 MESZ hat Simon Marchi <simark@simark.ca> Folgendes geschrieben:
>
>> On 2020-09-24 11:26 a.m., Hannes Domani wrote:
>>> Is it ok with this addition?:
>>>
>>> diff --git a/gdb/nat/windows-nat.c b/gdb/nat/windows-nat.c
>>> index a277156138..2cbbc0f2cc 100644
>>> --- a/gdb/nat/windows-nat.c
>>> +++ b/gdb/nat/windows-nat.c
>>> @@ -243,6 +243,13 @@ handle_exception (struct target_waitstatus *ourstatus, bool debug_exceptions)
>>>         }
>>>         else if (wow64_process)
>>>         {
>>> +        /* This breakpoint exception is triggered for WOW64 processes when
>>> +            reaching an int3 instruction in 64bit code.
>>> +            gdb checks for int3 in case of SIGTRAP, this fails because
>>> +            Wow64GetThreadContext can only report the pc of 32bit code, and
>>> +            gdb lets the target process continue.
>>> +            So handle it as SIGINT instead, then the target is stopped
>>> +            unconditionally.  */
>>>           DEBUG_EXCEPTION_SIMPLE ("EXCEPTION_BREAKPOINT");
>>>           rec->ExceptionCode = DBG_CONTROL_C;
>>>           ourstatus->value.sig = GDB_SIGNAL_INT;
>>
>> That is fine with me, thanks.
>>
>> Just to make sure I understand, stopping a 32-bit process from a 64-bit
>> GDB is the only time we expect this to happen, right?

Ok, thanks.  Please go ahead and merge.

Simon


More information about the Gdb-patches mailing list