* defs.h (read_relative_register_raw_bytes): Delete declaration.
* frame.c (frame_register_read): New function. Return non-zero on success. (read_relative_register_raw_bytes_for_frame): Delete. (read_relative_register_raw_bytes): Delete. * frame.h (frame_register_read): Declare. * d30v-tdep.c: Update Copyright. Use frame_register_read. * sh-tdep.c: Ditto. * infcmd.c (do_registers_info): Ditto. * hppa-tdep.c: Ditto. * rs6000-tdep.c: Ditto. * h8500-tdep.c: Ditto. * mips-tdep.c: Ditto. * h8300-tdep.c: Ditto. * z8k-tdep.c: Ditto.
This commit is contained in:
parent
2ea5f656d7
commit
cda5a58a3e
17 changed files with 97 additions and 82 deletions
36
gdb/frame.c
36
gdb/frame.c
|
@ -175,40 +175,26 @@ get_saved_register (char *raw_buffer,
|
|||
GET_SAVED_REGISTER (raw_buffer, optimized, addrp, frame, regnum, lval);
|
||||
}
|
||||
|
||||
/* READ_RELATIVE_REGISTER_RAW_BYTES_FOR_FRAME
|
||||
/* frame_register_read ()
|
||||
|
||||
Copy the bytes of register REGNUM, relative to the input stack frame,
|
||||
into our memory at MYADDR, in target byte order.
|
||||
Find and return the value of REGNUM for the specified stack frame.
|
||||
The number of bytes copied is REGISTER_RAW_SIZE (REGNUM).
|
||||
|
||||
Returns 1 if could not be read, 0 if could. */
|
||||
Returns 0 if the register value could not be found. */
|
||||
|
||||
static int
|
||||
read_relative_register_raw_bytes_for_frame (int regnum,
|
||||
char *myaddr,
|
||||
struct frame_info *frame)
|
||||
int
|
||||
frame_register_read (struct frame_info *frame, int regnum, void *myaddr)
|
||||
{
|
||||
int optim;
|
||||
get_saved_register (myaddr, &optim, (CORE_ADDR *) NULL, frame,
|
||||
regnum, (enum lval_type *) NULL);
|
||||
|
||||
/* FIXME: cagney/2002-04-10: This test is just bogus. It is no
|
||||
indication of the validity of the register. The value could
|
||||
easily be found (on the stack) even though the corresponding
|
||||
register isn't available. */
|
||||
if (register_cached (regnum) < 0)
|
||||
return 1; /* register value not available */
|
||||
return 0; /* register value not available */
|
||||
|
||||
return optim;
|
||||
}
|
||||
|
||||
/* READ_RELATIVE_REGISTER_RAW_BYTES
|
||||
|
||||
Copy the bytes of register REGNUM, relative to the current stack
|
||||
frame, into our memory at MYADDR, in target byte order.
|
||||
The number of bytes copied is REGISTER_RAW_SIZE (REGNUM).
|
||||
|
||||
Returns 1 if could not be read, 0 if could. */
|
||||
|
||||
int
|
||||
read_relative_register_raw_bytes (int regnum, char *myaddr)
|
||||
{
|
||||
return read_relative_register_raw_bytes_for_frame (regnum, myaddr,
|
||||
selected_frame);
|
||||
return !optim;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue