From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Aleksandar Ristovski <aristovski@qnx.com>
Subject: Re: [patch] nto-procfs.c: Add to_xfer_partial
Date: Fri, 24 Jul 2009 14:16:00 -0000 [thread overview]
Message-ID: <200907241400.22710.pedro@codesourcery.com> (raw)
In-Reply-To: <h2vsog$tcr$1@ger.gmane.org>
On Tuesday 07 July 2009 17:22:39, Aleksandar Ristovski wrote:
> Index: gdb/nto-procfs.c
> ===================================================================
> 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 2 Jul 2009 17:12:25 -0000 1.47
> +++ gdb/nto-procfs.c 7 Jul 2009 16:16:23 -0000
> @@ -774,6 +774,39 @@ procfs_xfer_memory (CORE_ADDR memaddr, g
> return (nbytes);
> }
>
> +static LONGEST
> +procfs_xfer_partial (struct target_ops *ops, enum target_object object,
> + const char *annex, gdb_byte *readbuf,
> + const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
> +{
...
> + if (ops->beneath && ops->beneath->to_xfer_partial)
> + return ops->beneath->to_xfer_partial (ops, object, annex, readbuf,
> + writebuf, 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. ))
> + return -1;
> +}
> +
> /* Take a program previously attached to and detaches it.
> The program resumes execution and will no longer stop
> on signals, etc. We'd better not have left any breakpoints
> @@ -1307,6 +1340,7 @@ init_procfs_ops (void)
> procfs_ops.to_store_registers = procfs_store_registers;
> procfs_ops.to_prepare_to_store = procfs_prepare_to_store;
> procfs_ops.deprecated_xfer_memory = procfs_xfer_memory;
> + procfs_ops.to_xfer_partial = procfs_xfer_partial;
> procfs_ops.to_files_info = procfs_files_info;
> procfs_ops.to_insert_breakpoint = procfs_insert_breakpoint;
> procfs_ops.to_remove_breakpoint = procfs_remove_breakpoint;
> Index: gdb/nto-tdep.c
> ===================================================================
> 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 12 Jun 2009 02:32:10 -0000 1.34
> +++ gdb/nto-tdep.c 7 Jul 2009 16:16:23 -0000
> @@ -364,6 +364,70 @@ nto_initialize_signals (void)
> #endif
> }
>
> +LONGEST
> +nto_read_auxv_from_initial_stack (CORE_ADDR initial_stack, gdb_byte *readbuf,
> + LONGEST len)
> +{
> + gdb_byte targ32[4]; /* For 32 bit target values. */
> + CORE_ADDR data_ofs = 0;
> + ULONGEST anint;
> + LONGEST len_read = 0;
> + gdb_byte *buff;
> + /* For 32-bit architecture, size of auxv_t is 8 bytes. */
> + const unsigned int sizeof_auxv_t = 8;
NTO doesn't support any 64-bit architecture?
> + enum bfd_endian byte_order;
> +
> + /* Skip over argc, argv and envp... (see comment in ldd.c) */
> + if (target_read_memory (initial_stack + data_ofs, targ32, sizeof (targ32))
> + != 0)
> + return 0;
Can you paste here that ldd.c comment too? You had pasted it in the
equivalent gdbserver bit.
Otherwise, looks fine to me.
--
Pedro Alves
next prev parent reply other threads:[~2009-07-24 13:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-11 20:31 Aleksandar Ristovski
2009-06-11 21:36 ` Pierre Muller
2009-06-12 2:25 ` Aleksandar Ristovski
2009-06-12 6:55 ` Pierre Muller
2009-06-18 15:16 ` Aleksandar Ristovski
2009-07-07 16:23 ` Aleksandar Ristovski
2009-07-21 15:45 ` Aleksandar Ristovski
2009-07-24 14:16 ` Pedro Alves [this message]
2009-07-27 20:17 ` Aleksandar Ristovski
2009-07-28 12:01 ` Pedro Alves
2009-07-28 22:17 ` Aleksandar Ristovski
2009-08-24 11:34 ` Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200907241400.22710.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=aristovski@qnx.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox