This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re : [gdbserver][WinCE][ARM] gdbserver crash: issue with GetThreadContext???
Pierre, you are absolutely right, thank you!
I'll check this then
----- Message d'origine ----
> De : Pierre Muller <pierre.muller@ics-cnrs.unistra.fr>
> À : Matthieu H <mhameau@yahoo.fr>
> Cc : Pedro Alves <pedro@codesourcery.com>; gdb@sourceware.org
> Envoyé le : Mar 15 février 2011, 10h 10min 31s
> Objet : RE: [gdbserver][WinCE][ARM] gdbserver crash: issue with
>GetThreadContext???
>
>
>
> > -----Message d'origine-----
> > De : gdb-owner@sourceware.org [mailto:gdb-owner@sourceware.org] De la
> > part de Matthieu H
> > Envoyé : mardi 15 février 2011 09:53
> > À : Pedro Alves; gdb@sourceware.org
> > Objet : Re : [gdbserver][WinCE][ARM] gdbserver crash: issue with
> > GetThreadContext???
> >
> > Many thanks Pedro.
> >
> > I tested this:
> >
> > > char buffer[2048];
> > > memset (buffer, 0xaa, sizeof buffer);
> > > GetThreadContext (th->h, (CONTEXT *)buffer);
> > > // add code that dumps the buffer contents
> >
> > then printed out the contents of the buffer into a file after the call
> > to
> > GetThreadContext.
> >
> > Surprisingly the contents of the buffer did not changed at all...???
> > I will double check, but it is very strange :-/
>
> This is because GetThreadContext only copies some parts of
> the register context depending on the value of
> the ContextFlags field of the context structure.
>
> This flags is probably 0xaaaaaaaaa
> in your case, which is probably invalid.
> You should first set a valid value to that field
> (CONTEXT *)buffer->ContextFlags = CONTEXT_FULL | CONTEXT_FLOATING_POINT;
> (as in gdbserver/win32-arm-low.c)
> and after also check that the function succeeds
> by testing that the BOOL return value is non zero.
>
>
> Pierre Muller
> GDB pascal language maintainer
>
>
>
>
>