2003-04-05 Andrew Cagney <cagney@redhat.com>
Eliminate FRAME_FIND_SAVED_REGS. * config/pa/tm-hppah.h (hppa_hpux_frame_find_saved_regs_in_sigtramp): Change FSR parameter to a pointer. * config/pa/tm-hppa64.h (FRAME_FIND_SAVED_REGS_IN_SIGTRAMP): Assume FSR parameter is a pointer. * hppa-hpux-tdep.c (hppa_hpux_frame_find_saved_regs_in_sigtramp): Make fsr a pointer. * hppa-tdep.c (hppa_frame_find_saved_regs): New function. (hppa_frame_saved_pc): Call hppa_frame_init_saved_regs. Make saved_regs a pointer. (hppa_frame_saved_pc): Ditto. (find_dummy_frame_regs): Make frame_saved_regs a pointer (hppa_pop_frame): Call hppa_frame_init_saved_regs. Make fsr a pointer. (restore_pc_queue): Make fsr a pointer. (hppa_frame_find_saved_regs): Make frame_saved_regs a pointer. (hppa_frame_chain): Make saved_regs a pointer, call hppa_frame_init_saved_regs. * sparc-tdep.c: Include "gdb_assert.h". (sparc_frame_find_saved_regs): Replace internal_error with gdb_assert. * remote-vxsparc.c (vx_read_register): Delete reference to FRAME_FIND_SAVED_REGS. * gdbarch.sh: Delete check for FRAME_FIND_SAVED_REGS. * gdbarch.h: Regenerate. * frame.h (DEPRECATED_FRAME_INIT_SAVED_REGS): Delete macro. (deprecated_get_frame_saved_regs): Delete declaration. (struct frame_saved_regs): Delete definition. * frame.c (deprecated_get_frame_saved_regs): Delete function. * config/pa/tm-hppa.h (hppa_frame_init_saved_regs): Declare. (hppa_frame_find_saved_regs): Delete declaration. (FRAME_FIND_SAVED_REGS): Delete macro. (DEPRECATED_FRAME_INIT_SAVED_REGS): Define. * config/i386/tm-ptx.h (FRAME_FIND_SAVED_REGS): Delete FRAME_FIND_SAVED_REGS in comment.
This commit is contained in:
parent
d1c6921f66
commit
43bd9a9e02
14 changed files with 159 additions and 180 deletions
|
@ -1,3 +1,41 @@
|
||||||
|
2003-04-05 Andrew Cagney <cagney@redhat.com>
|
||||||
|
|
||||||
|
Eliminate FRAME_FIND_SAVED_REGS.
|
||||||
|
* config/pa/tm-hppah.h (hppa_hpux_frame_find_saved_regs_in_sigtramp):
|
||||||
|
Change FSR parameter to a pointer.
|
||||||
|
* config/pa/tm-hppa64.h (FRAME_FIND_SAVED_REGS_IN_SIGTRAMP):
|
||||||
|
Assume FSR parameter is a pointer.
|
||||||
|
* hppa-hpux-tdep.c (hppa_hpux_frame_find_saved_regs_in_sigtramp):
|
||||||
|
Make fsr a pointer.
|
||||||
|
* hppa-tdep.c (hppa_frame_find_saved_regs): New function.
|
||||||
|
(hppa_frame_saved_pc): Call hppa_frame_init_saved_regs. Make
|
||||||
|
saved_regs a pointer.
|
||||||
|
(hppa_frame_saved_pc): Ditto.
|
||||||
|
(find_dummy_frame_regs): Make frame_saved_regs a pointer
|
||||||
|
(hppa_pop_frame): Call hppa_frame_init_saved_regs. Make fsr a
|
||||||
|
pointer.
|
||||||
|
(restore_pc_queue): Make fsr a pointer.
|
||||||
|
(hppa_frame_find_saved_regs): Make frame_saved_regs a pointer.
|
||||||
|
(hppa_frame_chain): Make saved_regs a pointer, call
|
||||||
|
hppa_frame_init_saved_regs.
|
||||||
|
* sparc-tdep.c: Include "gdb_assert.h".
|
||||||
|
(sparc_frame_find_saved_regs): Replace internal_error with
|
||||||
|
gdb_assert.
|
||||||
|
* remote-vxsparc.c (vx_read_register): Delete reference to
|
||||||
|
FRAME_FIND_SAVED_REGS.
|
||||||
|
* gdbarch.sh: Delete check for FRAME_FIND_SAVED_REGS.
|
||||||
|
* gdbarch.h: Regenerate.
|
||||||
|
* frame.h (DEPRECATED_FRAME_INIT_SAVED_REGS): Delete macro.
|
||||||
|
(deprecated_get_frame_saved_regs): Delete declaration.
|
||||||
|
(struct frame_saved_regs): Delete definition.
|
||||||
|
* frame.c (deprecated_get_frame_saved_regs): Delete function.
|
||||||
|
* config/pa/tm-hppa.h (hppa_frame_init_saved_regs): Declare.
|
||||||
|
(hppa_frame_find_saved_regs): Delete declaration.
|
||||||
|
(FRAME_FIND_SAVED_REGS): Delete macro.
|
||||||
|
(DEPRECATED_FRAME_INIT_SAVED_REGS): Define.
|
||||||
|
* config/i386/tm-ptx.h (FRAME_FIND_SAVED_REGS): Delete
|
||||||
|
FRAME_FIND_SAVED_REGS in comment.
|
||||||
|
|
||||||
2003-04-05 Andrew Cagney <cagney@redhat.com>
|
2003-04-05 Andrew Cagney <cagney@redhat.com>
|
||||||
|
|
||||||
* frame.c (frame_func_unwind, get_frame_func): New functions.
|
* frame.c (frame_func_unwind, get_frame_func): New functions.
|
||||||
|
|
|
@ -2208,9 +2208,9 @@ sparc-linux-nat.o: sparc-linux-nat.c $(defs_h) $(regcache_h) $(gregset_h)
|
||||||
sparc-nat.o: sparc-nat.c $(defs_h) $(inferior_h) $(target_h) $(gdbcore_h) \
|
sparc-nat.o: sparc-nat.c $(defs_h) $(inferior_h) $(target_h) $(gdbcore_h) \
|
||||||
$(regcache_h) $(gdb_wait_h)
|
$(regcache_h) $(gdb_wait_h)
|
||||||
sparc-stub.o: sparc-stub.c
|
sparc-stub.o: sparc-stub.c
|
||||||
sparc-tdep.o: sparc-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) \
|
sparc-tdep.o: sparc-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) $(inferior_h) \
|
||||||
$(inferior_h) $(target_h) $(value_h) $(bfd_h) $(gdb_string_h) \
|
$(target_h) $(value_h) $(bfd_h) $(gdb_string_h) $(regcache_h) \
|
||||||
$(regcache_h) $(osabi_h) $(gregset_h) $(gdbcore_h) $(symfile_h)
|
$(osabi_h) $(gregset_h) $(gdbcore_h) $(gdb_assert_h) $(symfile_h)
|
||||||
sparc64nbsd-nat.o: sparc64nbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
|
sparc64nbsd-nat.o: sparc64nbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
|
||||||
$(sparcnbsd_tdep_h)
|
$(sparcnbsd_tdep_h)
|
||||||
sparcl-stub.o: sparcl-stub.c
|
sparcl-stub.o: sparcl-stub.c
|
||||||
|
|
|
@ -191,10 +191,4 @@ extern const struct floatformat floatformat_i387_ext; /* from floatformat.h */
|
||||||
#define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
|
#define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
|
||||||
symmetry_extract_return_value(TYPE, REGBUF, VALBUF)
|
symmetry_extract_return_value(TYPE, REGBUF, VALBUF)
|
||||||
|
|
||||||
/*
|
|
||||||
#undef FRAME_FIND_SAVED_REGS
|
|
||||||
#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
|
|
||||||
{ ptx_frame_find_saved_regs((frame_info), &(frame_saved_regs)); }
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif /* ifndef TM_PTX_H */
|
#endif /* ifndef TM_PTX_H */
|
||||||
|
|
|
@ -441,11 +441,9 @@ extern int hppa_frame_num_args (struct frame_info *frame);
|
||||||
#define FRAME_ARGS_SKIP 0
|
#define FRAME_ARGS_SKIP 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
|
extern void hppa_frame_init_saved_regs (struct frame_info *);
|
||||||
hppa_frame_find_saved_regs (frame_info, &frame_saved_regs)
|
#define DEPRECATED_FRAME_INIT_SAVED_REGS(FI) \
|
||||||
extern void hppa_frame_find_saved_regs (struct frame_info *,
|
hppa_frame_init_saved_regs (FI)
|
||||||
struct frame_saved_regs *);
|
|
||||||
|
|
||||||
|
|
||||||
/* Things needed for making the inferior call functions. */
|
/* Things needed for making the inferior call functions. */
|
||||||
|
|
||||||
|
|
|
@ -312,11 +312,11 @@ call_dummy
|
||||||
for (i = 0; i < NUM_REGS; i++) \
|
for (i = 0; i < NUM_REGS; i++) \
|
||||||
{ \
|
{ \
|
||||||
if (i == SP_REGNUM) \
|
if (i == SP_REGNUM) \
|
||||||
(FSR)->regs[SP_REGNUM] = read_memory_integer (TMP1 + SP_REGNUM * 8, 8); \
|
(FSR)[SP_REGNUM] = read_memory_integer (TMP1 + SP_REGNUM * 8, 8); \
|
||||||
else if (i >= FP0_REGNUM) \
|
else if (i >= FP0_REGNUM) \
|
||||||
(FSR)->regs[i] = TMP2 + (i - FP0_REGNUM) * 8; \
|
(FSR)[i] = TMP2 + (i - FP0_REGNUM) * 8; \
|
||||||
else \
|
else \
|
||||||
(FSR)->regs[i] = TMP1 + i * 8; \
|
(FSR)[i] = TMP1 + i * 8; \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,9 +46,8 @@ extern void hppa_hpux_frame_base_before_sigtramp (struct frame_info *fi,
|
||||||
#define FRAME_BASE_BEFORE_SIGTRAMP(FRAME, TMP) \
|
#define FRAME_BASE_BEFORE_SIGTRAMP(FRAME, TMP) \
|
||||||
hppa_hpux_frame_base_before_sigtramp (FRAME, TMP)
|
hppa_hpux_frame_base_before_sigtramp (FRAME, TMP)
|
||||||
|
|
||||||
struct frame_saved_regs;
|
|
||||||
extern void hppa_hpux_frame_find_saved_regs_in_sigtramp
|
extern void hppa_hpux_frame_find_saved_regs_in_sigtramp
|
||||||
(struct frame_info *fi, struct frame_saved_regs *fsr);
|
(struct frame_info *fi, CORE_ADDR *fsr);
|
||||||
#define FRAME_FIND_SAVED_REGS_IN_SIGTRAMP(FRAME, FSR) \
|
#define FRAME_FIND_SAVED_REGS_IN_SIGTRAMP(FRAME, FSR) \
|
||||||
hppa_hpux_frame_find_saved_regs_in_sigtramp (FRAME, FSR)
|
hppa_hpux_frame_find_saved_regs_in_sigtramp (FRAME, FSR)
|
||||||
|
|
||||||
|
|
28
gdb/frame.c
28
gdb/frame.c
|
@ -1776,34 +1776,6 @@ deprecated_set_frame_type (struct frame_info *frame, enum frame_type type)
|
||||||
frame->type = type;
|
frame->type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FRAME_FIND_SAVED_REGS
|
|
||||||
/* XXX - deprecated. This is a compatibility function for targets
|
|
||||||
that do not yet implement DEPRECATED_FRAME_INIT_SAVED_REGS. */
|
|
||||||
/* Find the addresses in which registers are saved in FRAME. */
|
|
||||||
|
|
||||||
void
|
|
||||||
deprecated_get_frame_saved_regs (struct frame_info *frame,
|
|
||||||
struct frame_saved_regs *saved_regs_addr)
|
|
||||||
{
|
|
||||||
if (frame->saved_regs == NULL)
|
|
||||||
{
|
|
||||||
frame->saved_regs = (CORE_ADDR *)
|
|
||||||
frame_obstack_zalloc (SIZEOF_FRAME_SAVED_REGS);
|
|
||||||
}
|
|
||||||
if (saved_regs_addr == NULL)
|
|
||||||
{
|
|
||||||
struct frame_saved_regs saved_regs;
|
|
||||||
FRAME_FIND_SAVED_REGS (frame, saved_regs);
|
|
||||||
memcpy (frame->saved_regs, &saved_regs, SIZEOF_FRAME_SAVED_REGS);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
FRAME_FIND_SAVED_REGS (frame, *saved_regs_addr);
|
|
||||||
memcpy (frame->saved_regs, saved_regs_addr, SIZEOF_FRAME_SAVED_REGS);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct frame_extra_info *
|
struct frame_extra_info *
|
||||||
get_frame_extra_info (struct frame_info *fi)
|
get_frame_extra_info (struct frame_info *fi)
|
||||||
{
|
{
|
||||||
|
|
26
gdb/frame.h
26
gdb/frame.h
|
@ -324,24 +324,6 @@ extern CORE_ADDR frame_pc_unwind (struct frame_info *frame);
|
||||||
of the caller. */
|
of the caller. */
|
||||||
extern void frame_pop (struct frame_info *frame);
|
extern void frame_pop (struct frame_info *frame);
|
||||||
|
|
||||||
/* Describe the saved registers of a frame. */
|
|
||||||
|
|
||||||
#if defined (FRAME_FIND_SAVED_REGS)
|
|
||||||
/* XXXX - deprecated */
|
|
||||||
struct frame_saved_regs
|
|
||||||
{
|
|
||||||
/* For each register R (except the SP), regs[R] is the address at
|
|
||||||
which it was saved on entry to the frame, or zero if it was not
|
|
||||||
saved on entry to this frame. This includes special registers
|
|
||||||
such as pc and fp saved in special ways in the stack frame.
|
|
||||||
|
|
||||||
regs[SP_REGNUM] is different. It holds the actual SP, not the
|
|
||||||
address at which it was saved. */
|
|
||||||
|
|
||||||
CORE_ADDR regs[NUM_REGS];
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* We keep a cache of stack frames, each of which is a "struct
|
/* We keep a cache of stack frames, each of which is a "struct
|
||||||
frame_info". The innermost one gets allocated (in
|
frame_info". The innermost one gets allocated (in
|
||||||
wait_for_inferior) each time the inferior stops; current_frame
|
wait_for_inferior) each time the inferior stops; current_frame
|
||||||
|
@ -480,14 +462,6 @@ extern int frame_chain_valid (CORE_ADDR, struct frame_info *);
|
||||||
|
|
||||||
extern void generic_save_dummy_frame_tos (CORE_ADDR sp);
|
extern void generic_save_dummy_frame_tos (CORE_ADDR sp);
|
||||||
|
|
||||||
|
|
||||||
#ifdef FRAME_FIND_SAVED_REGS
|
|
||||||
/* XXX - deprecated */
|
|
||||||
#define DEPRECATED_FRAME_INIT_SAVED_REGS(FI) deprecated_get_frame_saved_regs (FI, NULL)
|
|
||||||
extern void deprecated_get_frame_saved_regs (struct frame_info *,
|
|
||||||
struct frame_saved_regs *);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern struct block *get_frame_block (struct frame_info *,
|
extern struct block *get_frame_block (struct frame_info *,
|
||||||
CORE_ADDR *addr_in_block);
|
CORE_ADDR *addr_in_block);
|
||||||
|
|
||||||
|
|
|
@ -55,12 +55,6 @@ extern struct gdbarch *current_gdbarch;
|
||||||
/* If any of the following are defined, the target wasn't correctly
|
/* If any of the following are defined, the target wasn't correctly
|
||||||
converted. */
|
converted. */
|
||||||
|
|
||||||
#if GDB_MULTI_ARCH
|
|
||||||
#if defined (FRAME_FIND_SAVED_REGS)
|
|
||||||
#error "FRAME_FIND_SAVED_REGS: replaced by DEPRECATED_FRAME_INIT_SAVED_REGS"
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PURE) && defined (GDB_TM_FILE)
|
#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PURE) && defined (GDB_TM_FILE)
|
||||||
#error "GDB_TM_FILE: Pure multi-arch targets do not have a tm.h file."
|
#error "GDB_TM_FILE: Pure multi-arch targets do not have a tm.h file."
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -820,12 +820,6 @@ extern struct gdbarch *current_gdbarch;
|
||||||
/* If any of the following are defined, the target wasn't correctly
|
/* If any of the following are defined, the target wasn't correctly
|
||||||
converted. */
|
converted. */
|
||||||
|
|
||||||
#if GDB_MULTI_ARCH
|
|
||||||
#if defined (FRAME_FIND_SAVED_REGS)
|
|
||||||
#error "FRAME_FIND_SAVED_REGS: replaced by DEPRECATED_FRAME_INIT_SAVED_REGS"
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PURE) && defined (GDB_TM_FILE)
|
#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PURE) && defined (GDB_TM_FILE)
|
||||||
#error "GDB_TM_FILE: Pure multi-arch targets do not have a tm.h file."
|
#error "GDB_TM_FILE: Pure multi-arch targets do not have a tm.h file."
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -35,7 +35,7 @@ void hppa_hpux_frame_saved_pc_in_sigtramp (struct frame_info *fi,
|
||||||
void hppa_hpux_frame_base_before_sigtramp (struct frame_info *fi,
|
void hppa_hpux_frame_base_before_sigtramp (struct frame_info *fi,
|
||||||
CORE_ADDR *tmp);
|
CORE_ADDR *tmp);
|
||||||
void hppa_hpux_frame_find_saved_regs_in_sigtramp
|
void hppa_hpux_frame_find_saved_regs_in_sigtramp
|
||||||
(struct frame_info *fi, struct frame_saved_regs *fsr);
|
(struct frame_info *fi, CORE_ADDR *fsr);
|
||||||
|
|
||||||
int
|
int
|
||||||
hppa_hpux_pc_in_sigtramp (CORE_ADDR pc, char *name)
|
hppa_hpux_pc_in_sigtramp (CORE_ADDR pc, char *name)
|
||||||
|
@ -79,7 +79,7 @@ hppa_hpux_frame_base_before_sigtramp (struct frame_info *fi,
|
||||||
|
|
||||||
void
|
void
|
||||||
hppa_hpux_frame_find_saved_regs_in_sigtramp (struct frame_info *fi,
|
hppa_hpux_frame_find_saved_regs_in_sigtramp (struct frame_info *fi,
|
||||||
struct frame_saved_regs *fsr)
|
CORE_ADDR *fsr)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
const CORE_ADDR tmp = (fi)->frame + (10 * 4);
|
const CORE_ADDR tmp = (fi)->frame + (10 * 4);
|
||||||
|
@ -87,9 +87,9 @@ hppa_hpux_frame_find_saved_regs_in_sigtramp (struct frame_info *fi,
|
||||||
for (i = 0; i < NUM_REGS; i++)
|
for (i = 0; i < NUM_REGS; i++)
|
||||||
{
|
{
|
||||||
if (i == SP_REGNUM)
|
if (i == SP_REGNUM)
|
||||||
(fsr)->regs[SP_REGNUM] = read_memory_integer (tmp + SP_REGNUM * 4, 4);
|
fsr[SP_REGNUM] = read_memory_integer (tmp + SP_REGNUM * 4, 4);
|
||||||
else
|
else
|
||||||
(fsr)->regs[i] = tmp + i * 4;
|
fsr[i] = tmp + i * 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
186
gdb/hppa-tdep.c
186
gdb/hppa-tdep.c
|
@ -78,8 +78,7 @@ static unsigned extract_5R_store (unsigned int);
|
||||||
|
|
||||||
static unsigned extract_5r_store (unsigned int);
|
static unsigned extract_5r_store (unsigned int);
|
||||||
|
|
||||||
static void find_dummy_frame_regs (struct frame_info *,
|
static void find_dummy_frame_regs (struct frame_info *, CORE_ADDR *);
|
||||||
struct frame_saved_regs *);
|
|
||||||
|
|
||||||
static int find_proc_framesize (CORE_ADDR);
|
static int find_proc_framesize (CORE_ADDR);
|
||||||
|
|
||||||
|
@ -103,7 +102,7 @@ static int low_sign_extend (unsigned int, unsigned int);
|
||||||
|
|
||||||
static int sign_extend (unsigned int, unsigned int);
|
static int sign_extend (unsigned int, unsigned int);
|
||||||
|
|
||||||
static int restore_pc_queue (struct frame_saved_regs *);
|
static int restore_pc_queue (CORE_ADDR *);
|
||||||
|
|
||||||
static int hppa_alignof (struct type *);
|
static int hppa_alignof (struct type *);
|
||||||
|
|
||||||
|
@ -943,13 +942,13 @@ hppa_frame_saved_pc (struct frame_info *frame)
|
||||||
&& ((get_frame_type (frame->next) == SIGTRAMP_FRAME)
|
&& ((get_frame_type (frame->next) == SIGTRAMP_FRAME)
|
||||||
|| pc_in_interrupt_handler (frame->next->pc)))
|
|| pc_in_interrupt_handler (frame->next->pc)))
|
||||||
{
|
{
|
||||||
struct frame_saved_regs saved_regs;
|
CORE_ADDR *saved_regs;
|
||||||
|
hppa_frame_init_saved_regs (frame->next);
|
||||||
deprecated_get_frame_saved_regs (frame->next, &saved_regs);
|
saved_regs = get_frame_saved_regs (frame->next);
|
||||||
if (read_memory_integer (saved_regs.regs[FLAGS_REGNUM],
|
if (read_memory_integer (saved_regs[FLAGS_REGNUM],
|
||||||
TARGET_PTR_BIT / 8) & 0x2)
|
TARGET_PTR_BIT / 8) & 0x2)
|
||||||
{
|
{
|
||||||
pc = read_memory_integer (saved_regs.regs[31],
|
pc = read_memory_integer (saved_regs[31],
|
||||||
TARGET_PTR_BIT / 8) & ~0x3;
|
TARGET_PTR_BIT / 8) & ~0x3;
|
||||||
|
|
||||||
/* Syscalls are really two frames. The syscall stub itself
|
/* Syscalls are really two frames. The syscall stub itself
|
||||||
|
@ -957,11 +956,11 @@ hppa_frame_saved_pc (struct frame_info *frame)
|
||||||
a return pointer in %r31. We return the %rp variant
|
a return pointer in %r31. We return the %rp variant
|
||||||
if %r31 is the same as frame->pc. */
|
if %r31 is the same as frame->pc. */
|
||||||
if (pc == frame->pc)
|
if (pc == frame->pc)
|
||||||
pc = read_memory_integer (saved_regs.regs[RP_REGNUM],
|
pc = read_memory_integer (saved_regs[RP_REGNUM],
|
||||||
TARGET_PTR_BIT / 8) & ~0x3;
|
TARGET_PTR_BIT / 8) & ~0x3;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
pc = read_memory_integer (saved_regs.regs[RP_REGNUM],
|
pc = read_memory_integer (saved_regs[RP_REGNUM],
|
||||||
TARGET_PTR_BIT / 8) & ~0x3;
|
TARGET_PTR_BIT / 8) & ~0x3;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -983,13 +982,13 @@ hppa_frame_saved_pc (struct frame_info *frame)
|
||||||
&& ((get_frame_type (frame->next) == SIGTRAMP_FRAME)
|
&& ((get_frame_type (frame->next) == SIGTRAMP_FRAME)
|
||||||
|| pc_in_interrupt_handler (frame->next->pc)))
|
|| pc_in_interrupt_handler (frame->next->pc)))
|
||||||
{
|
{
|
||||||
struct frame_saved_regs saved_regs;
|
CORE_ADDR *saved_regs;
|
||||||
|
hppa_frame_init_saved_regs (frame->next);
|
||||||
deprecated_get_frame_saved_regs (frame->next, &saved_regs);
|
saved_regs = get_frame_saved_regs (frame->next);
|
||||||
if (read_memory_integer (saved_regs.regs[FLAGS_REGNUM],
|
if (read_memory_integer (saved_regs[FLAGS_REGNUM],
|
||||||
TARGET_PTR_BIT / 8) & 0x2)
|
TARGET_PTR_BIT / 8) & 0x2)
|
||||||
{
|
{
|
||||||
pc = read_memory_integer (saved_regs.regs[31],
|
pc = read_memory_integer (saved_regs[31],
|
||||||
TARGET_PTR_BIT / 8) & ~0x3;
|
TARGET_PTR_BIT / 8) & ~0x3;
|
||||||
|
|
||||||
/* Syscalls are really two frames. The syscall stub itself
|
/* Syscalls are really two frames. The syscall stub itself
|
||||||
|
@ -997,11 +996,11 @@ hppa_frame_saved_pc (struct frame_info *frame)
|
||||||
a return pointer in %r31. We return the %rp variant
|
a return pointer in %r31. We return the %rp variant
|
||||||
if %r31 is the same as frame->pc. */
|
if %r31 is the same as frame->pc. */
|
||||||
if (pc == frame->pc)
|
if (pc == frame->pc)
|
||||||
pc = read_memory_integer (saved_regs.regs[RP_REGNUM],
|
pc = read_memory_integer (saved_regs[RP_REGNUM],
|
||||||
TARGET_PTR_BIT / 8) & ~0x3;
|
TARGET_PTR_BIT / 8) & ~0x3;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
pc = read_memory_integer (saved_regs.regs[RP_REGNUM],
|
pc = read_memory_integer (saved_regs[RP_REGNUM],
|
||||||
TARGET_PTR_BIT / 8) & ~0x3;
|
TARGET_PTR_BIT / 8) & ~0x3;
|
||||||
}
|
}
|
||||||
else if (rp_offset == 0)
|
else if (rp_offset == 0)
|
||||||
|
@ -1129,9 +1128,9 @@ hppa_frame_chain (struct frame_info *frame)
|
||||||
|
|
||||||
/* A frame in the current frame list, or zero. */
|
/* A frame in the current frame list, or zero. */
|
||||||
struct frame_info *saved_regs_frame = 0;
|
struct frame_info *saved_regs_frame = 0;
|
||||||
/* Where the registers were saved in saved_regs_frame.
|
/* Where the registers were saved in saved_regs_frame. If
|
||||||
If saved_regs_frame is zero, this is garbage. */
|
saved_regs_frame is zero, this is garbage. */
|
||||||
struct frame_saved_regs saved_regs;
|
CORE_ADDR *saved_regs = NULL;
|
||||||
|
|
||||||
CORE_ADDR caller_pc;
|
CORE_ADDR caller_pc;
|
||||||
|
|
||||||
|
@ -1258,11 +1257,12 @@ hppa_frame_chain (struct frame_info *frame)
|
||||||
/* The unwind entry claims that r3 is saved here. However,
|
/* The unwind entry claims that r3 is saved here. However,
|
||||||
in optimized code, GCC often doesn't actually save r3.
|
in optimized code, GCC often doesn't actually save r3.
|
||||||
We'll discover this if we look at the prologue. */
|
We'll discover this if we look at the prologue. */
|
||||||
deprecated_get_frame_saved_regs (tmp_frame, &saved_regs);
|
hppa_frame_init_saved_regs (tmp_frame);
|
||||||
|
saved_regs = get_frame_saved_regs (tmp_frame);
|
||||||
saved_regs_frame = tmp_frame;
|
saved_regs_frame = tmp_frame;
|
||||||
|
|
||||||
/* If we have an address for r3, that's good. */
|
/* If we have an address for r3, that's good. */
|
||||||
if (saved_regs.regs[FP_REGNUM])
|
if (saved_regs[FP_REGNUM])
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1307,21 +1307,24 @@ hppa_frame_chain (struct frame_info *frame)
|
||||||
system call has a variable sized stack frame. */
|
system call has a variable sized stack frame. */
|
||||||
|
|
||||||
if (tmp_frame != saved_regs_frame)
|
if (tmp_frame != saved_regs_frame)
|
||||||
deprecated_get_frame_saved_regs (tmp_frame, &saved_regs);
|
{
|
||||||
|
hppa_frame_init_saved_regs (tmp_frame);
|
||||||
|
saved_regs = get_frame_saved_regs (tmp_frame);
|
||||||
|
}
|
||||||
|
|
||||||
/* Abominable hack. */
|
/* Abominable hack. */
|
||||||
if (current_target.to_has_execution == 0
|
if (current_target.to_has_execution == 0
|
||||||
&& ((saved_regs.regs[FLAGS_REGNUM]
|
&& ((saved_regs[FLAGS_REGNUM]
|
||||||
&& (read_memory_integer (saved_regs.regs[FLAGS_REGNUM],
|
&& (read_memory_integer (saved_regs[FLAGS_REGNUM],
|
||||||
TARGET_PTR_BIT / 8)
|
TARGET_PTR_BIT / 8)
|
||||||
& 0x2))
|
& 0x2))
|
||||||
|| (saved_regs.regs[FLAGS_REGNUM] == 0
|
|| (saved_regs[FLAGS_REGNUM] == 0
|
||||||
&& read_register (FLAGS_REGNUM) & 0x2)))
|
&& read_register (FLAGS_REGNUM) & 0x2)))
|
||||||
{
|
{
|
||||||
u = find_unwind_entry (DEPRECATED_FRAME_SAVED_PC (frame));
|
u = find_unwind_entry (DEPRECATED_FRAME_SAVED_PC (frame));
|
||||||
if (!u)
|
if (!u)
|
||||||
{
|
{
|
||||||
return read_memory_integer (saved_regs.regs[FP_REGNUM],
|
return read_memory_integer (saved_regs[FP_REGNUM],
|
||||||
TARGET_PTR_BIT / 8);
|
TARGET_PTR_BIT / 8);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1330,7 +1333,7 @@ hppa_frame_chain (struct frame_info *frame)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return read_memory_integer (saved_regs.regs[FP_REGNUM],
|
return read_memory_integer (saved_regs[FP_REGNUM],
|
||||||
TARGET_PTR_BIT / 8);
|
TARGET_PTR_BIT / 8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1342,21 +1345,24 @@ hppa_frame_chain (struct frame_info *frame)
|
||||||
tmp_frame = tmp_frame->next;
|
tmp_frame = tmp_frame->next;
|
||||||
|
|
||||||
if (tmp_frame != saved_regs_frame)
|
if (tmp_frame != saved_regs_frame)
|
||||||
deprecated_get_frame_saved_regs (tmp_frame, &saved_regs);
|
{
|
||||||
|
hppa_frame_init_saved_regs (tmp_frame);
|
||||||
|
saved_regs = get_frame_saved_regs (tmp_frame);
|
||||||
|
}
|
||||||
|
|
||||||
/* Abominable hack. See above. */
|
/* Abominable hack. See above. */
|
||||||
if (current_target.to_has_execution == 0
|
if (current_target.to_has_execution == 0
|
||||||
&& ((saved_regs.regs[FLAGS_REGNUM]
|
&& ((saved_regs[FLAGS_REGNUM]
|
||||||
&& (read_memory_integer (saved_regs.regs[FLAGS_REGNUM],
|
&& (read_memory_integer (saved_regs[FLAGS_REGNUM],
|
||||||
TARGET_PTR_BIT / 8)
|
TARGET_PTR_BIT / 8)
|
||||||
& 0x2))
|
& 0x2))
|
||||||
|| (saved_regs.regs[FLAGS_REGNUM] == 0
|
|| (saved_regs[FLAGS_REGNUM] == 0
|
||||||
&& read_register (FLAGS_REGNUM) & 0x2)))
|
&& read_register (FLAGS_REGNUM) & 0x2)))
|
||||||
{
|
{
|
||||||
u = find_unwind_entry (DEPRECATED_FRAME_SAVED_PC (frame));
|
u = find_unwind_entry (DEPRECATED_FRAME_SAVED_PC (frame));
|
||||||
if (!u)
|
if (!u)
|
||||||
{
|
{
|
||||||
return read_memory_integer (saved_regs.regs[FP_REGNUM],
|
return read_memory_integer (saved_regs[FP_REGNUM],
|
||||||
TARGET_PTR_BIT / 8);
|
TARGET_PTR_BIT / 8);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1496,26 +1502,26 @@ hppa_push_dummy_frame (void)
|
||||||
|
|
||||||
static void
|
static void
|
||||||
find_dummy_frame_regs (struct frame_info *frame,
|
find_dummy_frame_regs (struct frame_info *frame,
|
||||||
struct frame_saved_regs *frame_saved_regs)
|
CORE_ADDR frame_saved_regs[])
|
||||||
{
|
{
|
||||||
CORE_ADDR fp = frame->frame;
|
CORE_ADDR fp = frame->frame;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* The 32bit and 64bit ABIs save RP into different locations. */
|
/* The 32bit and 64bit ABIs save RP into different locations. */
|
||||||
if (REGISTER_SIZE == 8)
|
if (REGISTER_SIZE == 8)
|
||||||
frame_saved_regs->regs[RP_REGNUM] = (fp - 16) & ~0x3;
|
frame_saved_regs[RP_REGNUM] = (fp - 16) & ~0x3;
|
||||||
else
|
else
|
||||||
frame_saved_regs->regs[RP_REGNUM] = (fp - 20) & ~0x3;
|
frame_saved_regs[RP_REGNUM] = (fp - 20) & ~0x3;
|
||||||
|
|
||||||
frame_saved_regs->regs[FP_REGNUM] = fp;
|
frame_saved_regs[FP_REGNUM] = fp;
|
||||||
|
|
||||||
frame_saved_regs->regs[1] = fp + (2 * REGISTER_SIZE);
|
frame_saved_regs[1] = fp + (2 * REGISTER_SIZE);
|
||||||
|
|
||||||
for (fp += 3 * REGISTER_SIZE, i = 3; i < 32; i++)
|
for (fp += 3 * REGISTER_SIZE, i = 3; i < 32; i++)
|
||||||
{
|
{
|
||||||
if (i != FP_REGNUM)
|
if (i != FP_REGNUM)
|
||||||
{
|
{
|
||||||
frame_saved_regs->regs[i] = fp;
|
frame_saved_regs[i] = fp;
|
||||||
fp += REGISTER_SIZE;
|
fp += REGISTER_SIZE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1525,14 +1531,14 @@ find_dummy_frame_regs (struct frame_info *frame,
|
||||||
fp += 4;
|
fp += 4;
|
||||||
|
|
||||||
for (i = FP0_REGNUM; i < NUM_REGS; i++, fp += 8)
|
for (i = FP0_REGNUM; i < NUM_REGS; i++, fp += 8)
|
||||||
frame_saved_regs->regs[i] = fp;
|
frame_saved_regs[i] = fp;
|
||||||
|
|
||||||
frame_saved_regs->regs[IPSW_REGNUM] = fp;
|
frame_saved_regs[IPSW_REGNUM] = fp;
|
||||||
frame_saved_regs->regs[SAR_REGNUM] = fp + REGISTER_SIZE;
|
frame_saved_regs[SAR_REGNUM] = fp + REGISTER_SIZE;
|
||||||
frame_saved_regs->regs[PCOQ_HEAD_REGNUM] = fp + 2 * REGISTER_SIZE;
|
frame_saved_regs[PCOQ_HEAD_REGNUM] = fp + 2 * REGISTER_SIZE;
|
||||||
frame_saved_regs->regs[PCSQ_HEAD_REGNUM] = fp + 3 * REGISTER_SIZE;
|
frame_saved_regs[PCSQ_HEAD_REGNUM] = fp + 3 * REGISTER_SIZE;
|
||||||
frame_saved_regs->regs[PCOQ_TAIL_REGNUM] = fp + 4 * REGISTER_SIZE;
|
frame_saved_regs[PCOQ_TAIL_REGNUM] = fp + 4 * REGISTER_SIZE;
|
||||||
frame_saved_regs->regs[PCSQ_TAIL_REGNUM] = fp + 5 * REGISTER_SIZE;
|
frame_saved_regs[PCSQ_TAIL_REGNUM] = fp + 5 * REGISTER_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1541,44 +1547,45 @@ hppa_pop_frame (void)
|
||||||
register struct frame_info *frame = get_current_frame ();
|
register struct frame_info *frame = get_current_frame ();
|
||||||
register CORE_ADDR fp, npc, target_pc;
|
register CORE_ADDR fp, npc, target_pc;
|
||||||
register int regnum;
|
register int regnum;
|
||||||
struct frame_saved_regs fsr;
|
CORE_ADDR *fsr;
|
||||||
double freg_buffer;
|
double freg_buffer;
|
||||||
|
|
||||||
fp = get_frame_base (frame);
|
fp = get_frame_base (frame);
|
||||||
deprecated_get_frame_saved_regs (frame, &fsr);
|
hppa_frame_init_saved_regs (frame);
|
||||||
|
fsr = get_frame_saved_regs (frame);
|
||||||
|
|
||||||
#ifndef NO_PC_SPACE_QUEUE_RESTORE
|
#ifndef NO_PC_SPACE_QUEUE_RESTORE
|
||||||
if (fsr.regs[IPSW_REGNUM]) /* Restoring a call dummy frame */
|
if (fsr[IPSW_REGNUM]) /* Restoring a call dummy frame */
|
||||||
restore_pc_queue (&fsr);
|
restore_pc_queue (fsr);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (regnum = 31; regnum > 0; regnum--)
|
for (regnum = 31; regnum > 0; regnum--)
|
||||||
if (fsr.regs[regnum])
|
if (fsr[regnum])
|
||||||
write_register (regnum, read_memory_integer (fsr.regs[regnum],
|
write_register (regnum, read_memory_integer (fsr[regnum],
|
||||||
REGISTER_SIZE));
|
REGISTER_SIZE));
|
||||||
|
|
||||||
for (regnum = NUM_REGS - 1; regnum >= FP0_REGNUM; regnum--)
|
for (regnum = NUM_REGS - 1; regnum >= FP0_REGNUM; regnum--)
|
||||||
if (fsr.regs[regnum])
|
if (fsr[regnum])
|
||||||
{
|
{
|
||||||
read_memory (fsr.regs[regnum], (char *) &freg_buffer, 8);
|
read_memory (fsr[regnum], (char *) &freg_buffer, 8);
|
||||||
deprecated_write_register_bytes (REGISTER_BYTE (regnum),
|
deprecated_write_register_bytes (REGISTER_BYTE (regnum),
|
||||||
(char *) &freg_buffer, 8);
|
(char *) &freg_buffer, 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fsr.regs[IPSW_REGNUM])
|
if (fsr[IPSW_REGNUM])
|
||||||
write_register (IPSW_REGNUM,
|
write_register (IPSW_REGNUM,
|
||||||
read_memory_integer (fsr.regs[IPSW_REGNUM],
|
read_memory_integer (fsr[IPSW_REGNUM],
|
||||||
REGISTER_SIZE));
|
REGISTER_SIZE));
|
||||||
|
|
||||||
if (fsr.regs[SAR_REGNUM])
|
if (fsr[SAR_REGNUM])
|
||||||
write_register (SAR_REGNUM,
|
write_register (SAR_REGNUM,
|
||||||
read_memory_integer (fsr.regs[SAR_REGNUM],
|
read_memory_integer (fsr[SAR_REGNUM],
|
||||||
REGISTER_SIZE));
|
REGISTER_SIZE));
|
||||||
|
|
||||||
/* If the PC was explicitly saved, then just restore it. */
|
/* If the PC was explicitly saved, then just restore it. */
|
||||||
if (fsr.regs[PCOQ_TAIL_REGNUM])
|
if (fsr[PCOQ_TAIL_REGNUM])
|
||||||
{
|
{
|
||||||
npc = read_memory_integer (fsr.regs[PCOQ_TAIL_REGNUM],
|
npc = read_memory_integer (fsr[PCOQ_TAIL_REGNUM],
|
||||||
REGISTER_SIZE);
|
REGISTER_SIZE);
|
||||||
write_register (PCOQ_TAIL_REGNUM, npc);
|
write_register (PCOQ_TAIL_REGNUM, npc);
|
||||||
}
|
}
|
||||||
|
@ -1591,7 +1598,7 @@ hppa_pop_frame (void)
|
||||||
|
|
||||||
write_register (FP_REGNUM, read_memory_integer (fp, REGISTER_SIZE));
|
write_register (FP_REGNUM, read_memory_integer (fp, REGISTER_SIZE));
|
||||||
|
|
||||||
if (fsr.regs[IPSW_REGNUM]) /* call dummy */
|
if (fsr[IPSW_REGNUM]) /* call dummy */
|
||||||
write_register (SP_REGNUM, fp - 48);
|
write_register (SP_REGNUM, fp - 48);
|
||||||
else
|
else
|
||||||
write_register (SP_REGNUM, fp);
|
write_register (SP_REGNUM, fp);
|
||||||
|
@ -1604,7 +1611,7 @@ hppa_pop_frame (void)
|
||||||
|
|
||||||
Don't skip through the trampoline if we're popping a dummy frame. */
|
Don't skip through the trampoline if we're popping a dummy frame. */
|
||||||
target_pc = SKIP_TRAMPOLINE_CODE (npc & ~0x3) & ~0x3;
|
target_pc = SKIP_TRAMPOLINE_CODE (npc & ~0x3) & ~0x3;
|
||||||
if (target_pc && !fsr.regs[IPSW_REGNUM])
|
if (target_pc && !fsr[IPSW_REGNUM])
|
||||||
{
|
{
|
||||||
struct symtab_and_line sal;
|
struct symtab_and_line sal;
|
||||||
struct breakpoint *breakpoint;
|
struct breakpoint *breakpoint;
|
||||||
|
@ -1635,10 +1642,10 @@ hppa_pop_frame (void)
|
||||||
queue space registers. */
|
queue space registers. */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
restore_pc_queue (struct frame_saved_regs *fsr)
|
restore_pc_queue (CORE_ADDR *fsr)
|
||||||
{
|
{
|
||||||
CORE_ADDR pc = read_pc ();
|
CORE_ADDR pc = read_pc ();
|
||||||
CORE_ADDR new_pc = read_memory_integer (fsr->regs[PCOQ_HEAD_REGNUM],
|
CORE_ADDR new_pc = read_memory_integer (fsr[PCOQ_HEAD_REGNUM],
|
||||||
TARGET_PTR_BIT / 8);
|
TARGET_PTR_BIT / 8);
|
||||||
struct target_waitstatus w;
|
struct target_waitstatus w;
|
||||||
int insn_count;
|
int insn_count;
|
||||||
|
@ -1657,7 +1664,7 @@ restore_pc_queue (struct frame_saved_regs *fsr)
|
||||||
So, load up the registers and single step until we are in the
|
So, load up the registers and single step until we are in the
|
||||||
right place. */
|
right place. */
|
||||||
|
|
||||||
write_register (21, read_memory_integer (fsr->regs[PCSQ_HEAD_REGNUM],
|
write_register (21, read_memory_integer (fsr[PCSQ_HEAD_REGNUM],
|
||||||
REGISTER_SIZE));
|
REGISTER_SIZE));
|
||||||
write_register (22, new_pc);
|
write_register (22, new_pc);
|
||||||
|
|
||||||
|
@ -3842,15 +3849,15 @@ hppa_skip_prologue (CORE_ADDR pc)
|
||||||
return (skip_prologue_hard_way (pc));
|
return (skip_prologue_hard_way (pc));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Put here the code to store, into a struct frame_saved_regs,
|
/* Put here the code to store, into the SAVED_REGS, the addresses of
|
||||||
the addresses of the saved registers of frame described by FRAME_INFO.
|
the saved registers of frame described by FRAME_INFO. This
|
||||||
This includes special registers such as pc and fp saved in special
|
includes special registers such as pc and fp saved in special ways
|
||||||
ways in the stack frame. sp is even more special:
|
in the stack frame. sp is even more special: the address we return
|
||||||
the address we return for it IS the sp for the next frame. */
|
for it IS the sp for the next frame. */
|
||||||
|
|
||||||
void
|
void
|
||||||
hppa_frame_find_saved_regs (struct frame_info *frame_info,
|
hppa_frame_find_saved_regs (struct frame_info *frame_info,
|
||||||
struct frame_saved_regs *frame_saved_regs)
|
CORE_ADDR frame_saved_regs[])
|
||||||
{
|
{
|
||||||
CORE_ADDR pc;
|
CORE_ADDR pc;
|
||||||
struct unwind_table_entry *u;
|
struct unwind_table_entry *u;
|
||||||
|
@ -3861,7 +3868,7 @@ hppa_frame_find_saved_regs (struct frame_info *frame_info,
|
||||||
int final_iteration;
|
int final_iteration;
|
||||||
|
|
||||||
/* Zero out everything. */
|
/* Zero out everything. */
|
||||||
memset (frame_saved_regs, '\0', sizeof (struct frame_saved_regs));
|
memset (frame_saved_regs, '\0', SIZEOF_FRAME_SAVED_REGS);
|
||||||
|
|
||||||
/* Call dummy frames always look the same, so there's no need to
|
/* Call dummy frames always look the same, so there's no need to
|
||||||
examine the dummy code to determine locations of saved registers;
|
examine the dummy code to determine locations of saved registers;
|
||||||
|
@ -3892,11 +3899,11 @@ hppa_frame_find_saved_regs (struct frame_info *frame_info,
|
||||||
{
|
{
|
||||||
/* SP is a little special. */
|
/* SP is a little special. */
|
||||||
if (i == SP_REGNUM)
|
if (i == SP_REGNUM)
|
||||||
frame_saved_regs->regs[SP_REGNUM]
|
frame_saved_regs[SP_REGNUM]
|
||||||
= read_memory_integer (frame_info->frame + SP_REGNUM * 4,
|
= read_memory_integer (frame_info->frame + SP_REGNUM * 4,
|
||||||
TARGET_PTR_BIT / 8);
|
TARGET_PTR_BIT / 8);
|
||||||
else
|
else
|
||||||
frame_saved_regs->regs[i] = frame_info->frame + i * 4;
|
frame_saved_regs[i] = frame_info->frame + i * 4;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -3945,7 +3952,7 @@ hppa_frame_find_saved_regs (struct frame_info *frame_info,
|
||||||
/* The frame always represents the value of %sp at entry to the
|
/* The frame always represents the value of %sp at entry to the
|
||||||
current function (and is thus equivalent to the "saved" stack
|
current function (and is thus equivalent to the "saved" stack
|
||||||
pointer. */
|
pointer. */
|
||||||
frame_saved_regs->regs[SP_REGNUM] = frame_info->frame;
|
frame_saved_regs[SP_REGNUM] = frame_info->frame;
|
||||||
|
|
||||||
/* Loop until we find everything of interest or hit a branch.
|
/* Loop until we find everything of interest or hit a branch.
|
||||||
|
|
||||||
|
@ -3980,12 +3987,12 @@ hppa_frame_find_saved_regs (struct frame_info *frame_info,
|
||||||
if (inst == 0x6bc23fd9) /* stw rp,-0x14(sr0,sp) */
|
if (inst == 0x6bc23fd9) /* stw rp,-0x14(sr0,sp) */
|
||||||
{
|
{
|
||||||
save_rp = 0;
|
save_rp = 0;
|
||||||
frame_saved_regs->regs[RP_REGNUM] = frame_info->frame - 20;
|
frame_saved_regs[RP_REGNUM] = frame_info->frame - 20;
|
||||||
}
|
}
|
||||||
else if (inst == 0x0fc212c1) /* std rp,-0x10(sr0,sp) */
|
else if (inst == 0x0fc212c1) /* std rp,-0x10(sr0,sp) */
|
||||||
{
|
{
|
||||||
save_rp = 0;
|
save_rp = 0;
|
||||||
frame_saved_regs->regs[RP_REGNUM] = frame_info->frame - 16;
|
frame_saved_regs[RP_REGNUM] = frame_info->frame - 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Note if we saved SP into the stack. This also happens to indicate
|
/* Note if we saved SP into the stack. This also happens to indicate
|
||||||
|
@ -3993,7 +4000,7 @@ hppa_frame_find_saved_regs (struct frame_info *frame_info,
|
||||||
if ( (inst & 0xffffc000) == 0x6fc10000 /* stw,ma r1,N(sr0,sp) */
|
if ( (inst & 0xffffc000) == 0x6fc10000 /* stw,ma r1,N(sr0,sp) */
|
||||||
|| (inst & 0xffffc00c) == 0x73c10008) /* std,ma r1,N(sr0,sp) */
|
|| (inst & 0xffffc00c) == 0x73c10008) /* std,ma r1,N(sr0,sp) */
|
||||||
{
|
{
|
||||||
frame_saved_regs->regs[FP_REGNUM] = frame_info->frame;
|
frame_saved_regs[FP_REGNUM] = frame_info->frame;
|
||||||
save_sp = 0;
|
save_sp = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4007,10 +4014,10 @@ hppa_frame_find_saved_regs (struct frame_info *frame_info,
|
||||||
/* stwm with a positive displacement is a *post modify*. */
|
/* stwm with a positive displacement is a *post modify*. */
|
||||||
if ((inst >> 26) == 0x1b
|
if ((inst >> 26) == 0x1b
|
||||||
&& extract_14 (inst) >= 0)
|
&& extract_14 (inst) >= 0)
|
||||||
frame_saved_regs->regs[reg] = frame_info->frame;
|
frame_saved_regs[reg] = frame_info->frame;
|
||||||
/* A std has explicit post_modify forms. */
|
/* A std has explicit post_modify forms. */
|
||||||
else if ((inst & 0xfc00000c0) == 0x70000008)
|
else if ((inst & 0xfc00000c0) == 0x70000008)
|
||||||
frame_saved_regs->regs[reg] = frame_info->frame;
|
frame_saved_regs[reg] = frame_info->frame;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CORE_ADDR offset;
|
CORE_ADDR offset;
|
||||||
|
@ -4024,10 +4031,10 @@ hppa_frame_find_saved_regs (struct frame_info *frame_info,
|
||||||
|
|
||||||
/* Handle code with and without frame pointers. */
|
/* Handle code with and without frame pointers. */
|
||||||
if (u->Save_SP)
|
if (u->Save_SP)
|
||||||
frame_saved_regs->regs[reg]
|
frame_saved_regs[reg]
|
||||||
= frame_info->frame + offset;
|
= frame_info->frame + offset;
|
||||||
else
|
else
|
||||||
frame_saved_regs->regs[reg]
|
frame_saved_regs[reg]
|
||||||
= (frame_info->frame + (u->Total_frame_size << 3)
|
= (frame_info->frame + (u->Total_frame_size << 3)
|
||||||
+ offset);
|
+ offset);
|
||||||
}
|
}
|
||||||
|
@ -4060,12 +4067,12 @@ hppa_frame_find_saved_regs (struct frame_info *frame_info,
|
||||||
/* 1st HP CC FP register store. After this instruction
|
/* 1st HP CC FP register store. After this instruction
|
||||||
we've set enough state that the GCC and HPCC code are
|
we've set enough state that the GCC and HPCC code are
|
||||||
both handled in the same manner. */
|
both handled in the same manner. */
|
||||||
frame_saved_regs->regs[reg + FP4_REGNUM + 4] = frame_info->frame;
|
frame_saved_regs[reg + FP4_REGNUM + 4] = frame_info->frame;
|
||||||
fp_loc = 8;
|
fp_loc = 8;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
frame_saved_regs->regs[reg + FP0_REGNUM + 4]
|
frame_saved_regs[reg + FP0_REGNUM + 4]
|
||||||
= frame_info->frame + fp_loc;
|
= frame_info->frame + fp_loc;
|
||||||
fp_loc += 8;
|
fp_loc += 8;
|
||||||
}
|
}
|
||||||
|
@ -4085,6 +4092,17 @@ hppa_frame_find_saved_regs (struct frame_info *frame_info,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* XXX - deprecated. This is a compatibility function for targets
|
||||||
|
that do not yet implement DEPRECATED_FRAME_INIT_SAVED_REGS. */
|
||||||
|
/* Find the addresses in which registers are saved in FRAME. */
|
||||||
|
|
||||||
|
void
|
||||||
|
hppa_frame_init_saved_regs (struct frame_info *frame)
|
||||||
|
{
|
||||||
|
if (get_frame_saved_regs (frame) == NULL)
|
||||||
|
frame_saved_regs_zalloc (frame);
|
||||||
|
hppa_frame_find_saved_regs (frame, get_frame_saved_regs (frame));
|
||||||
|
}
|
||||||
|
|
||||||
/* Exception handling support for the HP-UX ANSI C++ compiler.
|
/* Exception handling support for the HP-UX ANSI C++ compiler.
|
||||||
The compiler (aCC) provides a callback for exception events;
|
The compiler (aCC) provides a callback for exception events;
|
||||||
|
|
|
@ -97,10 +97,9 @@ vx_read_register (int regno)
|
||||||
bcopy (&sparc_greg_packet[SPARC_R_Y],
|
bcopy (&sparc_greg_packet[SPARC_R_Y],
|
||||||
&deprecated_registers[REGISTER_BYTE (Y_REGNUM)], 6 * SPARC_GREG_SIZE);
|
&deprecated_registers[REGISTER_BYTE (Y_REGNUM)], 6 * SPARC_GREG_SIZE);
|
||||||
|
|
||||||
/* Now write the local and in registers to the register window
|
/* Now write the local and in registers to the register window spill
|
||||||
spill area in the frame. VxWorks does not do this for the
|
area in the frame. VxWorks does not do this for the active frame
|
||||||
active frame automatically; it greatly simplifies debugging
|
automatically; it greatly simplifies debugging. */
|
||||||
(FRAME_FIND_SAVED_REGS, in particular, depends on this). */
|
|
||||||
|
|
||||||
sp = extract_address (&deprecated_registers[REGISTER_BYTE (SP_REGNUM)],
|
sp = extract_address (&deprecated_registers[REGISTER_BYTE (SP_REGNUM)],
|
||||||
REGISTER_RAW_SIZE (SP_REGNUM));
|
REGISTER_RAW_SIZE (SP_REGNUM));
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "gdbcore.h"
|
#include "gdbcore.h"
|
||||||
|
#include "gdb_assert.h"
|
||||||
|
|
||||||
#include "symfile.h" /* for 'entry_point_address' */
|
#include "symfile.h" /* for 'entry_point_address' */
|
||||||
|
|
||||||
|
@ -1133,9 +1134,7 @@ sparc_frame_find_saved_regs (struct frame_info *fi, CORE_ADDR *saved_regs_addr)
|
||||||
register int regnum;
|
register int regnum;
|
||||||
CORE_ADDR frame_addr = get_frame_base (fi);
|
CORE_ADDR frame_addr = get_frame_base (fi);
|
||||||
|
|
||||||
if (!fi)
|
gdb_assert (fi != NULL);
|
||||||
internal_error (__FILE__, __LINE__,
|
|
||||||
"Bad frame info struct in FRAME_FIND_SAVED_REGS");
|
|
||||||
|
|
||||||
memset (saved_regs_addr, 0, NUM_REGS * sizeof (CORE_ADDR));
|
memset (saved_regs_addr, 0, NUM_REGS * sizeof (CORE_ADDR));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue