RE: [patch v4 06/13] linux, i386, amd64: enable btrace for 32bit and 64bit linux native

Metzger, Markus T
2012-12-03T16:24:16Z

> -----Original Message-----
> From: Pedro Alves [mailto:palves@redhat.com]
> Sent: Wednesday, November 28, 2012 7:40 PM

Thanks for your review.

[...]

> > + tinfo->ptr_bits = gdbarch_ptr_bit (gdbarch);
>
> It seems like this is something that should always be able
> to compute on demand, without needing to store it once
> per thread. This seems to have the same issue I pointed out
> in a previous patch, with assuming TINFO is the same thread
> as the current thread/inferior, and therefore that
> target_gdbarch is appropriate for TINFO.

I moved the initialization of ptr_bits to the respective btrace_enable function, which is more natural, and which also allows me to use target_thread_architecture instead of target_gdbarch.

I use this field in gdb/common/linux-btrace.c, which is shared by gdb and gdbserver. I have not found a way to compute this value where I need it other than via conditional compilation.

Regards,
Markus.

Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052