This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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








Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]