From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31978 invoked by alias); 11 Mar 2010 08:13:00 -0000 Received: (qmail 31965 invoked by uid 22791); 11 Mar 2010 08:12:58 -0000 X-SWARE-Spam-Status: No, hits=-0.9 required=5.0 tests=AWL,BAYES_00,MSGID_MULTIPLE_AT X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.158) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 11 Mar 2010 08:12:54 +0000 Received: from baal.u-strasbg.fr (baal.u-strasbg.fr [IPv6:2001:660:2402::41]) by mailhost.u-strasbg.fr (8.14.2/jtpda-5.5pre1) with ESMTP id o2B8Ckh4045784 ; Thu, 11 Mar 2010 09:12:46 +0100 (CET) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from mailserver.u-strasbg.fr (ms1.u-strasbg.fr [IPv6:2001:660:2402:d::10]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id o2B8Ck4X021251 ; Thu, 11 Mar 2010 09:12:46 +0100 (CET) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from d620muller (lec67-4-82-230-53-140.fbx.proxad.net [82.230.53.140]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id o2B8CjxI086287 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) ; Thu, 11 Mar 2010 09:12:46 +0100 (CET) (envelope-from pierre.muller@ics-cnrs.unistra.fr) From: "Pierre Muller" To: "'Pedro Alves'" , References: <000901c9f5ef$4ee06f10$eca14d30$@u-strasbg.fr> <201003101725.48298.pedro@codesourcery.com> <000c01cac0a0$3935fbe0$aba1f3a0$@muller@ics-cnrs.unistra.fr> <201003110000.31184.pedro@codesourcery.com> In-Reply-To: <201003110000.31184.pedro@codesourcery.com> Subject: RE: [PING] [RFC-v3] Add windows Thread Information Block Date: Thu, 11 Mar 2010 08:13:00 -0000 Message-ID: <002101cac0f2$a2298890$e67c99b0$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-03/txt/msg00412.txt.bz2 Hi Pedro, > -----Message d'origine----- > De=A0: gdb-patches-owner@sourceware.org [mailto:gdb-patches- > owner@sourceware.org] De la part de Pedro Alves > Envoy=E9=A0: Thursday, March 11, 2010 1:01 AM > =C0=A0: gdb-patches@sourceware.org > Cc=A0: Pierre Muller > Objet=A0: Re: [PING] [RFC-v3] Add windows Thread Information Block >=20 > On Wednesday 10 March 2010 22:22:51, Pierre Muller wrote: >=20 > > > Sorry, I already explained long ago that TARGET_OBJECT_OSDATA > > > is being misused here. > > OK, I start to remember now, > > you said that TARGET_OBJECT_DATA should use xml syntax for > > all data transmission, what that it? >=20 > Basically repeating from > : Sorry to bother you and bug you with all that. I really completely forgot these last emails, I should have reread them before sending this PING. > TARGET_OBJECT_OSDATA is meant be used through the > get_osdata interface, which assumes the target returns > xml encoded tabular form data. See gdb/osdata.c, and > the "info os" command (use and implementation). You > can try "info os processes" against linux native or > gdbserver to see it in action. The basic idea of this > object, is to be able to fetch tables of operating system > related data, like the list of running processes, or the > list of running threads, which are the present uses. OK, so let's use another scheme. =20 > > > Why the resistence to change that? > > It's not resistance, its just that I have no xml knowledge, > > and I still don't really understand why > > xml should be required for all TARGET_OBJECT_DATA. >=20 > See above. >=20 > > > There's another bit you haven't addressed yet: > > > > > > > + if (len =3D=3D 8) > > > > + { > > > > + uint64_t tlb =3D th->thread_local_base; > > > > + memcpy ((void *)readbuf, (void *) &tlb, len); > > > > + return len; > > > > + } > > > > + else if (len =3D=3D 4) > > > > > > As I explained before, for partial xfers you should not > > > design the protocol relying on `len' being exactly 4 or 8. > > > Also, this is just transfering a number, why make that > > > target-endian dependant (see memcpy above) ? > > > > My code does assume that there is a unique call that > > will fetch either 4 bytes (for windows 32 bit inferior) > > or 8 bytes for (windows 64 bit inferior) in a unique call, > > which avoids the static struct used in the linux counter part... > > (I could have added a check that offset is zero). > > > > Anyhow, if you insist on using xml, you will need to > > help me on how to handle and extract the relevant data from > > the generated xml. >=20 > I never insisted you used xml... I do insist however, > that everything that goes through TARGET_OBJECT_OSDATA > respects the get_osdata interface, and that, is > tabular/xml based transfer of data. >=20 > Basically repeating from: > : >=20 > So, if you want to use the qxfer interface, please > add a new target object. One note: I think target object's spirit is > to transfer the whole data block, which is what would make > sense to me when requesting a TLB _object_. The reason that > makes me consider transfering the whole blob instead of an address > and then relying on plain memory reads issued from GDB, > is that on other targets that may want to reuse the > interface, the TLB-like object may not be mapped or > accessible on the address space accessible with plain memory > reads. This is exactly the rationale behind objects like > TARGET_OBJECT_AUXV, TARGET_OBJECT_WCOOKIE or > TARGET_OBJECT_SIGNAL_INFO: each of these objects can > be seen as a blob of data in its own address space. =20=20 =20 > If just transfering the address of the data is the way > to go, as you're doing presently, then I'm not certain > the xfer_partial interface is a good fit for this --- for > example, a simple packet like we use to fetch the tls data > pointer seems like a better fit. For example, a new > target_get_thread_local_block target method, and a > new "qGetTLBAddr:XXX" packet: see the "qGetTLSAddr:" packet > for inspiration. So I will try this out, but adding new target methods is something I am afraid of not being capable... I will probably need so time to get that working... Pedro,=20 I would like to apologize here, because my first email sounded like an attack on you, but it was just that I I still had not understood your reasons for the opposition=20 against another use of TARGET_OBJECT_OSDATA. I was thinking that the Thread Information Block was an OS specific feature, and as such would clearly be eligible=20 for the use of TARGET_OBJECT_OSDATA. Your answer that it should all be processed through the get_osdata function has finally convinced me. It should already have last year, but I must have been=20 in a 'worse' mind and didn't understand your reasons then. Thanks for all, Pierre