This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [patch v4 06/13] linux, i386, amd64: enable btrace for 32bit and 64bit linux native
- From: "Metzger, Markus T" <markus dot t dot metzger at intel dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, "markus dot t dot metzger at gmail dot com" <markus dot t dot metzger at gmail dot com>, "jan dot kratochvil at redhat dot com" <jan dot kratochvil at redhat dot com>, "tromey at redhat dot com" <tromey at redhat dot com>, "kettenis at gnu dot org" <kettenis at gnu dot org>
- Date: Mon, 3 Dec 2012 16:23:05 +0000
- Subject: RE: [patch v4 06/13] linux, i386, amd64: enable btrace for 32bit and 64bit linux native
- References: <1354013351-14791-1-git-send-email-markus.t.metzger@intel.com> <1354013351-14791-7-git-send-email-markus.t.metzger@intel.com> <50B65A72.40301@redhat.com>
> -----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