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

Hannes Domani ssbssa@yahoo.de
Thu Sep 24 17:51:08 GMT 2020


 Am Donnerstag, 24. September 2020, 19:22:51 MESZ hat Joel Brobecker <brobecker@adacore.com> Folgendes geschrieben:

> > > >>> 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.
> >
> > Pushed, thanks.
> >
> > I think it would be great to have this in the gdb-10-branch.
> > Would that be possible?
>
>
> OK for me, Hannes.

Thanks, pushed as well to gdb-10-branch.


Hannes


More information about the Gdb-patches mailing list