This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [PING] [RFC-v3] Add windows Thread Information Block
- From: "Pierre Muller" <pierre dot muller at ics-cnrs dot unistra dot fr>
- To: "'Pedro Alves'" <pedro at codesourcery dot com>, <gdb-patches at sourceware dot org>
- Date: Thu, 11 Mar 2010 09:01:26 +0100
- Subject: RE: [PING] [RFC-v3] Add windows Thread Information Block
- References: <000901c9f5ef$4ee06f10$eca14d30$@u-strasbg.fr> <20090703194220.GA30668@ednor.casa.cgf.cx> <002901cac075$1f8f44b0$5eadce10$@muller@ics-cnrs.unistra.fr> <201003110024.05957.pedro@codesourcery.com>
Hi Pedro,
> -----Message d'origine-----
> De?: gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Pedro Alves
> Envoyé?: Thursday, March 11, 2010 1:24 AM
> À?: gdb-patches@sourceware.org
> Cc?: Pierre Muller
> Objet?: Re: [PING] [RFC-v3] Add windows Thread Information Block
>
> On Wednesday 10 March 2010 17:14:19, Pierre Muller wrote:
> > +typedef struct thread_information_block_32
> > + {
> > + uint32_t current_seh; /* %fs:0x0000 */
> > + uint32_t current_top_of_stack; /* %fs:0x0004 */
> > + uint32_t current_bottom_of_stack; /* %fs:0x0008 */
> > + uint32_t sub_system_tib; /* %fs:0x000c */
> > + uint32_t fiber_data; /* %fs:0x0010 */
> > + uint32_t arbitrary_data_slot; /* %fs:0x0014 */
> > + uint32_t linear_address_tib; /* %fs:0x0018 */
> > + uint32_t environment_pointer; /* %fs:0x001c */
> > + uint32_t process_id; /* %fs:0x0020 */
> > + uint32_t current_thread_id; /* %fs:0x0024
> */
> > + uint32_t thread_local_storage; /* %fs:0x0028 */
> > + uint32_t active_rpc_handle; /* %fs:0x002c
> */
> > + uint32_t process_environment_block; /* %fs:0x0030
> */
> > + uint32_t last_error_number; /* %fs:0x0034
> */
> > + }
> > +thread_information_32;
>
> Where did you get these offsets from?
> According to
> <http://en.wikipedia.org/wiki/Win32_Thread_Information_Block>,
> thread_local_storage should be 0x2c, and active_rpc_handle 0x28, as in,
> someone has it swapped.
Strange because, IIRC, this is the source where I got the offsets too...
> I think I actually tested that wikipedia had
> it
> right last time I asked you this, but in any case, can you confirm?
I checked it on gdb itself, but both fields are zeroed.
Now I remember having read somewhere that
for newer Windows OS, the Thread Local Storage block is inside the
Thread Information block itself:
see same Wikipedia page:
address : FS[0xE10] length : 256 description : TLS slots, 4 bytes per slot
so I will need to check on an older Win9X virtual machine
before I can answer this question.
Pierre