This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 10/15] Add target/target.h
- From: Gary Benson <gbenson at redhat dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 16 Jul 2014 09:52:56 +0100
- Subject: Re: [PATCH 10/15] Add target/target.h
- Authentication-results: sourceware.org; auth=none
- References: <1404902255-11101-1-git-send-email-gbenson at redhat dot com> <1404902255-11101-11-git-send-email-gbenson at redhat dot com> <87fvi9drxk dot fsf at fleche dot redhat dot com>
Tom Tromey wrote:
> >>>>> "Gary" == Gary Benson <gbenson@redhat.com> writes:
>
> Gary> This adds target/target.h. This file declares some functions
> Gary> that the "common" code can use and that the clients must
> Gary> implement. It also changes code in common to use these
> Gary> functions.
>
> Gary> +/* See target/target.h. */
> Gary> +
> Gary> +int
> Gary> +target_write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, ssize_t len)
>
> These comments refer to docs I never got around to writing... :
>
> Gary> +extern int target_read_uint32 (CORE_ADDR memaddr, unsigned int *result);
> Gary> +
> Gary> +extern int target_write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr,
> Gary> + ssize_t len);
How does this sound?
/* Read LEN bytes of target memory at address MEMADDR, placing the
results in GDB's memory at MYADDR. Return zero for success,
nonzero if any error occurs. Implementations of this function may
define and use their own error codes, but functions in the common,
nat and target directories must treat the return code as opaque.
No guarantee is made about the contents of the data at MYADDR if
any error occurs. */
extern int target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr,
ssize_t len);
/* Read an unsigned 32-bit integer in the target's format from target
memory at address MEMADDR, storing the result in GDB's format in
GDB's memory at RESULT. Return zero for success, nonzero if any
error occurs. Implementations of this function may define and use
their own error codes, but functions in the common, nat and target
directories must treat the return code as opaque. No guarantee is
made about the contents of the data at RESULT if any error
occurs. */
extern int target_read_uint32 (CORE_ADDR memaddr, unsigned int *result);
/* Write LEN bytes from MYADDR to target memory at address MEMADDR.
Return zero for success, nonzero if any error occurs.
Implementations of this function may define and use their own error
codes, but functions in the common, nat and target directories must
treat the return code as opaque. No guarantee is made about the
contents of the data at MEMADDR if any error occurs. */
extern int target_write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr,
ssize_t len);
Thanks,
Gary
--
http://gbenson.net/