Re: [PATCH 1/3] Use target_read_code in skip_prologue (i386)

Pedro Alves
2013-11-30T09:59:33Z

On 11/29/2013 02:24 PM, Yao Qi wrote:
> This patch uses target_read_code and its variants to read target
> memory in the functions related to i386_skip_prologue.

(IMO, it'd be nice if relevant part of the '0/3' cover letter
ended up in the commit log.)

> 2013-11-29 Yao Qi <yao@codesourcery.com>

Looks good to me. Minor comments below.

>
> * corefile.c (read_code): New function.
> (read_code_integer): New function.
> (read_code_unsigned_integer): New function.
> * gdbcore.h (read_code): Declare

Missing period.

> (read_code_integer): Declare.

...

> diff --git a/gdb/gdbcore.h b/gdb/gdbcore.h
> index 41bcf1f..8e0847b 100644
> --- a/gdb/gdbcore.h
> +++ b/gdb/gdbcore.h
> @@ -57,6 +57,10 @@ extern void read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len);
>
> extern void read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len);
>
> +/* Like target_read_code, but report an error if can't read. */
> +
> +extern void read_code (CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len);
> +
> /* Read an integer from debugged memory, given address and number of
> bytes. */
>
> @@ -73,6 +77,19 @@ extern ULONGEST read_memory_unsigned_integer (CORE_ADDR memaddr,
> int len,
> enum bfd_endian byte_order);
>
> +/* Read an integer from debugged code memory, given address and
> + number of bytes. */

/* Read an integer from debugged code memory, given address,
number of bytes, and byte order for code. */

> +
> +extern LONGEST read_code_integer (CORE_ADDR memaddr, int len,
> + enum bfd_endian byte_order);
> +
> +/* Read an unsigned integer from debugged code memory, given address
> + and number of bytes. */

Likewise.

> +
> +extern ULONGEST read_code_unsigned_integer (CORE_ADDR memaddr,
> + int len,
> + enum bfd_endian byte_order);
> +

Thanks,
--
Pedro Alves