From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27009 invoked by alias); 24 Jul 2009 13:00:38 -0000 Received: (qmail 26999 invoked by uid 22791); 24 Jul 2009 13:00:37 -0000 X-SWARE-Spam-Status: No, hits=-1.0 required=5.0 tests=AWL,BAYES_50,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 24 Jul 2009 13:00:27 +0000 Received: (qmail 11349 invoked from network); 24 Jul 2009 13:00:25 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 24 Jul 2009 13:00:25 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [patch] nto-procfs.c: Add to_xfer_partial Date: Fri, 24 Jul 2009 14:16:00 -0000 User-Agent: KMail/1.9.10 Cc: Aleksandar Ristovski References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200907241400.22710.pedro@codesourcery.com> X-IsSubscribed: yes 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-07/txt/msg00595.txt.bz2 On Tuesday 07 July 2009 17:22:39, Aleksandar Ristovski wrote: > Index: gdb/nto-procfs.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > RCS file: /cvs/src/src/gdb/nto-procfs.c,v > retrieving revision 1.47 > diff -u -p -r1.47 nto-procfs.c > --- gdb/nto-procfs.c=A0=A0=A0=A02 Jul 2009 17:12:25 -0000=A0=A0=A0=A0=A0= =A0=A01.47 > +++ gdb/nto-procfs.c=A0=A0=A0=A07 Jul 2009 16:16:23 -0000 > @@ -774,6 +774,39 @@ procfs_xfer_memory (CORE_ADDR memaddr, g > =A0 =A0return (nbytes); > =A0} > =A0 > +static LONGEST > +procfs_xfer_partial (struct target_ops *ops, enum target_object object, > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0 =A0 const char *annex,= gdb_byte *readbuf, > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0 =A0 const gdb_byte *wr= itebuf, ULONGEST offset, LONGEST len) > +{ ... > + =A0if (ops->beneath && ops->beneath->to_xfer_partial) > + =A0 =A0return ops->beneath->to_xfer_partial (ops, object, annex, readbu= f, > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0writebuf, offset, len); (( Note: It isn't correct to defer to the target beneath for TARGET_OBJECT_MEMORY (and similars) objects, but, I see that nto-procfs.c is still implementing deprecated_xfer_memory. )) > + =A0return -1; > +} > + > =A0/* Take a program previously attached to and detaches it. > =A0 =A0 The program resumes execution and will no longer stop > =A0 =A0 on signals, etc. =A0We'd better not have left any breakpoints > @@ -1307,6 +1340,7 @@ init_procfs_ops (void) > =A0 =A0procfs_ops.to_store_registers =3D procfs_store_registers; > =A0 =A0procfs_ops.to_prepare_to_store =3D procfs_prepare_to_store; > =A0 =A0procfs_ops.deprecated_xfer_memory =3D procfs_xfer_memory; > + =A0procfs_ops.to_xfer_partial =3D procfs_xfer_partial; > =A0 =A0procfs_ops.to_files_info =3D procfs_files_info; > =A0 =A0procfs_ops.to_insert_breakpoint =3D procfs_insert_breakpoint; > =A0 =A0procfs_ops.to_remove_breakpoint =3D procfs_remove_breakpoint; > Index: gdb/nto-tdep.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > RCS file: /cvs/src/src/gdb/nto-tdep.c,v > retrieving revision 1.34 > diff -u -p -r1.34 nto-tdep.c > --- gdb/nto-tdep.c=A0=A0=A0=A0=A0=A012 Jun 2009 02:32:10 -0000=A0=A0=A0= =A0=A0=A01.34 > +++ gdb/nto-tdep.c=A0=A0=A0=A0=A0=A07 Jul 2009 16:16:23 -0000 > @@ -364,6 +364,70 @@ nto_initialize_signals (void) > =A0#endif > =A0} > =A0 > +LONGEST > +nto_read_auxv_from_initial_stack (CORE_ADDR initial_stack, gdb_byte *rea= dbuf, > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0 =A0LONGEST len) > +{ > + =A0gdb_byte targ32[4]; /* For 32 bit target values. =A0*/ > + =A0CORE_ADDR data_ofs =3D 0; > + =A0ULONGEST anint; > + =A0LONGEST len_read =3D 0; > + =A0gdb_byte *buff; > + =A0/* For 32-bit architecture, size of auxv_t is 8 bytes. =A0*/ > + =A0const unsigned int sizeof_auxv_t =3D 8; NTO doesn't support any 64-bit architecture? > + =A0enum bfd_endian byte_order; > + > + =A0/* Skip over argc, argv and envp... (see comment in ldd.c) =A0*/ > + =A0if (target_read_memory (initial_stack + data_ofs, targ32, sizeof (ta= rg32)) > + =A0 =A0 =A0!=3D 0) > + =A0 =A0return 0; Can you paste here that ldd.c comment too? You had pasted it in the equivalent gdbserver bit. Otherwise, looks fine to me. --=20 Pedro Alves