From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26769 invoked by alias); 11 Jun 2009 21:36:26 -0000 Received: (qmail 26757 invoked by uid 22791); 11 Jun 2009 21:36:26 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.154) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 11 Jun 2009 21:36:20 +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 n5BLaBVV057588 ; Thu, 11 Jun 2009 23:36:11 +0200 (CEST) Received: from mailserver.u-strasbg.fr (ms2.u-strasbg.fr [IPv6:2001:660:2402:d::11]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id n5BLaBts086293 ; Thu, 11 Jun 2009 23:36:11 +0200 (CEST) (envelope-from muller@ics.u-strasbg.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 n5BLa9Yv096138 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) ; Thu, 11 Jun 2009 23:36:10 +0200 (CEST) (envelope-from muller@ics.u-strasbg.fr) From: "Pierre Muller" To: "'Aleksandar Ristovski'" , References: In-Reply-To: Subject: RE: [patch] nto-procfs.c: Add to_xfer_partial Date: Thu, 11 Jun 2009 21:36:00 -0000 Message-ID: <002201c9eadc$a58129e0$f0837da0$@u-strasbg.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: 2009-06/txt/msg00328.txt.bz2 Hi Aleksandar, I can't comment on the correctness of your code to nto_read_auxv_from_initial_stack, but I think that you should avoid using 'int' and assume that 'int' is 32-bit long in a tdep file. + int anint32; + LONGEST len_read =3D 0; + gdb_byte *panint32 =3D (gdb_byte*)&anint32; + gdb_byte *buff; + + /* Skip over argc, argv and envp... (see comment in ldd.c) */ + if (target_read_memory (initial_stack + data_ofs, panint32, 4) !=3D 0) + return 0; + + anint32 =3D extract_unsigned_integer (panint32, sizeof (anint32)); if sizeof(int) is not 4 on the host machine, your code will not work correctly. Moreover, you are using an 'int' to store an 'unsigned int'... It would probably be better to use gdb_byte anint32[4]; and ULONGEST uint32value uint32value =3D extract_unsigned_integer (&anint32, sizeof (anint32)); Please remember that tdep files should be compilable by systems having different endianess, but also pointer and/or standard integer sizes. Pierre Muller Pascal language support maintainer for GDB > -----Message d'origine----- > De=A0: gdb-patches-owner@sourceware.org [mailto:gdb-patches- > owner@sourceware.org] De la part de Aleksandar Ristovski > Envoy=E9=A0: Thursday, June 11, 2009 10:31 PM > =C0=A0: gdb-patches@sources.redhat.com > Objet=A0: [patch] nto-procfs.c: Add to_xfer_partial >=20 > Hello, >=20 > This adds to_xfer_partial (auxv) capability to nto-procfs. >=20 > Thanks, >=20 > -- > Aleksandar Ristovski > QNX Software Systems >=20 >=20 > ChangeLog: > * nto-procfs.c (procfs_xfer_partial): New function. > (init_procfs_ops): Register to_xfer_partial. > * nto-tdep.h (nto_read_auxv_from_initial_stack): Declare. > * nto-tdep.c (nto_read_auxv_from_initial_stack): Define.