This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [PATCH] Use read_memory_unsigned_integer when reading to CORE_ADDR
- From: Klee Dienes <klee at apple dot com>
- To: Andrew Cagney <ac131313 at redhat dot com>
- Cc: Daniel Jacobowitz <drow at mvista dot com>, gdb-patches at sources dot redhat dot com
- Date: Mon, 4 Nov 2002 22:45:23 -0500
- Subject: Re: [PATCH] Use read_memory_unsigned_integer when reading to CORE_ADDR
I used extract_type_address to honor the comment about not causing a
memory_error.
I'll check in the change from builtin_type_void_data_ptr to
builtin_type_void_code_ptr.
Unless someone objects, I'll also change
int ptrbytes = TARGET_PTR_BIT / TARGET_CHAR_BIT;
to
int ptrbytes = TYPE_LENGTH (builtin_type_void_code_ptr);
at the start of the function.
On Monday, October 21, 2002, at 03:05 PM, Andrew Cagney wrote:
/* Don't cause a memory_error when accessing sigcontext in case
the stack
layout has changed or the stack is corrupt. */
target_read_memory (sigcontext_addr + SIGCONTEXT_PC_OFFSET, buf,
ptrbytes);
- return extract_unsigned_integer (buf, ptrbytes);
+ return extract_typed_address (buf, builtin_type_void_data_ptr);
This should be builtin_type_void_code_ptr since it is extracting a
code pointer (the PC). It, also, might as well use
read_memory_typed_address().
Andrew