This is the mail archive of the gdb@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: [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





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