and CORE_ADDR, respectively.
* frame.h (FRAME, FRAME_INFO_ID, FRAME_ADDR): Remove.
* blockframe.c (get_frame_info): Remove.
* a29k-tdep.c, alpha-tdep.c, blockframe.c, breakpoint.c,
breakpoint.h, energize.c, findvar.c, gdbtk.c, gould-pinsn.c,
h8300-tdep.c, h8500-tdep.c, hppa-tdep.c, i386-tdep.c, i960-tdep.c,
infcmd.c, inferior.h, infrun.c, m68k-tdep.c, m88k-tdep.c,
mips-tdep.c, nindy-tdep.c, printcmd.c, pyr-tdep.c, rs6000-tdep.c,
sh-tdep.c, sparc-tdep.c, stack.c, valops.c, z8k-tdep.c,
config/a29k/tm-a29k.h, config/alpha/tm-alpha.h,
config/gould/tm-pn.h, config/h8300/tm-h8300.h,
config/h8500/tm-h8500.h, config/mips/tm-mips.h,
config/ns32k/tm-merlin.h, config/ns32k/tm-umax.h,
config/pyr/tm-pyr.h, config/sparc/tm-sparc.h): Replace FRAME with
struct frame_info * everywhere, replace FRAME_ADDR with CORE_ADDR,
rename variables consistently (using `frame' or `fi'), remove
calls to get_frame_info and FRAME_INFO_ID, remove comments about
FRAME and FRAME_ADDR cruftiness.
+Thu Nov 3 15:19:17 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ Replace useless FRAME, FRAME_ADDR types with struct frame_info *
+ and CORE_ADDR, respectively.
+ * frame.h (FRAME, FRAME_INFO_ID, FRAME_ADDR): Remove.
+ * blockframe.c (get_frame_info): Remove.
+ * a29k-tdep.c, alpha-tdep.c, blockframe.c, breakpoint.c,
+ breakpoint.h, energize.c, findvar.c, gdbtk.c, gould-pinsn.c,
+ h8300-tdep.c, h8500-tdep.c, hppa-tdep.c, i386-tdep.c, i960-tdep.c,
+ infcmd.c, inferior.h, infrun.c, m68k-tdep.c, m88k-tdep.c,
+ mips-tdep.c, nindy-tdep.c, printcmd.c, pyr-tdep.c, rs6000-tdep.c,
+ sh-tdep.c, sparc-tdep.c, stack.c, valops.c, z8k-tdep.c,
+ config/a29k/tm-a29k.h, config/alpha/tm-alpha.h,
+ config/gould/tm-pn.h, config/h8300/tm-h8300.h,
+ config/h8500/tm-h8500.h, config/mips/tm-mips.h,
+ config/ns32k/tm-merlin.h, config/ns32k/tm-umax.h,
+ config/pyr/tm-pyr.h, config/sparc/tm-sparc.h): Replace FRAME with
+ struct frame_info * everywhere, replace FRAME_ADDR with CORE_ADDR,
+ rename variables consistently (using `frame' or `fi'), remove
+ calls to get_frame_info and FRAME_INFO_ID, remove comments about
+ FRAME and FRAME_ADDR cruftiness.
+
Thu Nov 3 14:25:24 1994 Stu Grossman (grossman@cygnus.com)
* corelow.c, exec.c, inftarg.c, m3-nat.c, op50-rom.c, procfs.c,
static CORE_ADDR rstack_high_address = UINT_MAX;
/* Structure to hold cached info about function prologues. */
+
struct prologue_info
{
CORE_ADDR pc; /* First addr after fn prologue */
If MFP_USED is non-NULL, *MFP_USED is set to nonzero if a memory
frame pointer is being used. */
+
CORE_ADDR
examine_prologue (pc, rsize, msize, mfp_used)
CORE_ADDR pc;
skip_prologue (pc)
CORE_ADDR pc;
{
- return examine_prologue (pc, (unsigned *)NULL, (unsigned *)NULL,
- (int *)NULL);
+ return examine_prologue (pc, NULL, NULL, NULL);
}
+
/*
* Examine the one or two word tag at the beginning of a function.
* The tag word is expect to be at 'p', if it is not there, we fail
* convention today (1/15/92).
* msize is return in bytes.
*/
+
static int /* 0/1 - failure/success of finding the tag word */
-examine_tag(p, is_trans, argcount, msize, mfp_used)
+examine_tag (p, is_trans, argcount, msize, mfp_used)
CORE_ADDR p;
int *is_trans;
- int *argcount;
+ int *argcount;
unsigned *msize;
int *mfp_used;
{
*argcount = (tag1 >> 16) & 0x1f;
if (mfp_used)
*mfp_used = ((tag1 & (1<<22)) ? 1 : 0);
- return(1);
+ return 1;
}
/* Initialize the frame. In addition to setting "extra" frame info,
we also set ->frame because we use it in a nonstandard way, and ->pc
because we need to know it to get the other stuff. See the diagram
of stacks and the frame cache in tm-a29k.h for more detail. */
+
static void
-init_frame_info (innermost_frame, fci)
+init_frame_info (innermost_frame, frame)
int innermost_frame;
- struct frame_info *fci;
+ struct frame_info *frame;
{
CORE_ADDR p;
long insn;
int mfp_used, trans;
struct symbol *func;
- p = fci->pc;
+ p = frame->pc;
if (innermost_frame)
- fci->frame = read_register (GR1_REGNUM);
+ frame->frame = read_register (GR1_REGNUM);
else
- fci->frame = fci->next->frame + fci->next->rsize;
+ frame->frame = frame->next->frame + frame->next->rsize;
#if CALL_DUMMY_LOCATION == ON_STACK
This wont work;
if (PC_IN_CALL_DUMMY (p, 0, 0))
#endif
{
- fci->rsize = DUMMY_FRAME_RSIZE;
+ frame->rsize = DUMMY_FRAME_RSIZE;
/* This doesn't matter since we never try to get locals or args
from a dummy frame. */
- fci->msize = 0;
+ frame->msize = 0;
/* Dummy frames always use a memory frame pointer. */
- fci->saved_msp =
- read_register_stack_integer (fci->frame + DUMMY_FRAME_RSIZE - 4, 4);
- fci->flags |= (TRANSPARENT|MFP_USED);
+ frame->saved_msp =
+ read_register_stack_integer (frame->frame + DUMMY_FRAME_RSIZE - 4, 4);
+ frame->flags |= (TRANSPARENT|MFP_USED);
return;
}
{
/* Couldn't find the trace-back tag.
Something strange is going on. */
- fci->saved_msp = 0;
- fci->rsize = 0;
- fci->msize = 0;
- fci->flags = TRANSPARENT;
+ frame->saved_msp = 0;
+ frame->rsize = 0;
+ frame->msize = 0;
+ frame->flags = TRANSPARENT;
return;
}
else
else /* No tag try prologue */
examine_prologue (p, &rsize, &msize, &mfp_used);
- fci->rsize = rsize;
- fci->msize = msize;
- fci->flags = 0;
+ frame->rsize = rsize;
+ frame->msize = msize;
+ frame->flags = 0;
if (mfp_used)
- fci->flags |= MFP_USED;
+ frame->flags |= MFP_USED;
if (trans)
- fci->flags |= TRANSPARENT;
+ frame->flags |= TRANSPARENT;
if (innermost_frame)
{
- fci->saved_msp = read_register (MSP_REGNUM) + msize;
+ frame->saved_msp = read_register (MSP_REGNUM) + msize;
}
else
{
if (mfp_used)
- fci->saved_msp =
- read_register_stack_integer (fci->frame + rsize - 4, 4);
+ frame->saved_msp =
+ read_register_stack_integer (frame->frame + rsize - 4, 4);
else
- fci->saved_msp = fci->next->saved_msp + msize;
+ frame->saved_msp = frame->next->saved_msp + msize;
}
}
void
-init_extra_frame_info (fci)
- struct frame_info *fci;
+init_extra_frame_info (frame)
+ struct frame_info *frame;
{
- if (fci->next == 0)
+ if (frame->next == 0)
/* Assume innermost frame. May produce strange results for "info frame"
but there isn't any way to tell the difference. */
- init_frame_info (1, fci);
+ init_frame_info (1, frame);
else {
/* We're in get_prev_frame_info.
Take care of everything in init_frame_pc. */
}
void
-init_frame_pc (fromleaf, fci)
+init_frame_pc (fromleaf, frame)
int fromleaf;
- struct frame_info *fci;
+ struct frame_info *frame;
{
- fci->pc = (fromleaf ? SAVED_PC_AFTER_CALL (fci->next) :
- fci->next ? FRAME_SAVED_PC (fci->next) : read_pc ());
- init_frame_info (fromleaf, fci);
+ frame->pc = (fromleaf ? SAVED_PC_AFTER_CALL (frame->next) :
+ frame->next ? FRAME_SAVED_PC (frame->next) : read_pc ());
+ init_frame_info (fromleaf, frame);
}
\f
/* Local variables (i.e. LOC_LOCAL) are on the memory stack, with their
otherwise it was fetched from a register.
The argument RAW_BUFFER must point to aligned memory. */
+
void
get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lvalp)
char *raw_buffer;
int *optimized;
CORE_ADDR *addrp;
- FRAME frame;
+ struct frame_info *frame;
int regnum;
enum lval_type *lvalp;
{
if (frame == 0)
return;
- fi = get_frame_info (frame);
-
/* Once something has a register number, it doesn't get optimized out. */
if (optimized != NULL)
*optimized = 0;
{
if (raw_buffer != NULL)
{
- store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), fi->frame);
+ store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), frame->frame);
}
if (lvalp != NULL)
*lvalp = not_lval;
{
if (raw_buffer != NULL)
{
- store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), fi->pc);
+ store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), frame->pc);
}
/* Not sure we have to do this. */
{
if (raw_buffer != NULL)
{
- if (fi->next != NULL)
+ if (frame->next != NULL)
{
store_address (raw_buffer, REGISTER_RAW_SIZE (regnum),
- fi->next->saved_msp);
+ frame->next->saved_msp);
}
else
read_register_gen (MSP_REGNUM, raw_buffer);
return;
}
- addr = fi->frame + (regnum - LR0_REGNUM) * 4;
+ addr = frame->frame + (regnum - LR0_REGNUM) * 4;
if (raw_buffer != NULL)
read_register_stack (addr, raw_buffer, &addr, &lval);
if (lvalp != NULL)
void
pop_frame ()
{
- FRAME frame = get_current_frame ();
- struct frame_info *fi = get_frame_info (frame);
- CORE_ADDR rfb = read_register (RFB_REGNUM);
+ struct frame_info *frame = get_current_frame ();
+ CORE_ADDR rfb = read_register (RFB_REGNUM);
CORE_ADDR gr1 = fi->frame + fi->rsize;
CORE_ADDR lr1;
CORE_ADDR original_lr0;
/* If popping a dummy frame, need to restore registers. */
if (PC_IN_CALL_DUMMY (read_register (PC_REGNUM),
read_register (SP_REGNUM),
- FRAME_FP (fi)))
+ FRAME_FP (frame)))
{
int lrnum = LR0_REGNUM + DUMMY_ARG/4;
for (i = 0; i < DUMMY_SAVE_SR128; ++i)
}
/* Restore the memory stack pointer. */
- write_register (MSP_REGNUM, fi->saved_msp);
+ write_register (MSP_REGNUM, frame->saved_msp);
/* Restore the register stack pointer. */
write_register (GR1_REGNUM, gr1);
/* Fill. */
int num_bytes = lr1 - rfb;
int i;
- long word;
+ long word;
+
write_register (RAB_REGNUM, read_register (RAB_REGNUM) + num_bytes);
write_register (RFB_REGNUM, lr1);
for (i = 0; i < num_bytes; i += 4)
three values (FP, PC, and MSP), we really need all three to do a
good job. */
-FRAME
+struct frame_info *
setup_arbitrary_frame (argc, argv)
int argc;
- FRAME_ADDR *argv;
+ CORE_ADDR *argv;
{
- FRAME fid;
+ struct frame_info *frame;
if (argc != 3)
error ("AMD 29k frame specifications require three arguments: rsp pc msp");
- fid = create_new_frame (argv[0], argv[1]);
+ frame = create_new_frame (argv[0], argv[1]);
- if (!fid)
+ if (!frame)
fatal ("internal: create_new_frame returned invalid frame id");
/* Creating a new frame munges the `frame' value from the current
GR1, so we restore it again here. FIXME, untangle all this
29K frame stuff... */
- fid->frame = argv[0];
+ frame->frame = argv[0];
/* Our MSP is in argv[2]. It'd be intelligent if we could just
save this value in the FRAME. But the way it's set up (FIXME),
we must save our caller's MSP. We compute that by adding our
memory stack frame size to our MSP. */
- fid->saved_msp = argv[2] + fid->msize;
+ frame->saved_msp = argv[2] + frame->msize;
- return fid;
+ return frame;
}
-
-
enum a29k_processor_types processor_type = a29k_unknown;
void
/* Forward declarations. */
-static CORE_ADDR
-read_next_frame_reg PARAMS ((FRAME, int));
+static CORE_ADDR read_next_frame_reg PARAMS ((struct frame_info *, int));
-static CORE_ADDR
-heuristic_proc_start PARAMS ((CORE_ADDR));
+static CORE_ADDR heuristic_proc_start PARAMS ((CORE_ADDR));
-static alpha_extra_func_info_t
-heuristic_proc_desc PARAMS ((CORE_ADDR, CORE_ADDR, FRAME));
+static alpha_extra_func_info_t heuristic_proc_desc PARAMS ((CORE_ADDR,
+ CORE_ADDR,
+ struct frame_info *));
-static alpha_extra_func_info_t
-find_proc_desc PARAMS ((CORE_ADDR, FRAME));
+static alpha_extra_func_info_t find_proc_desc PARAMS ((CORE_ADDR, struct frame_info *));
-static int
-alpha_in_lenient_prologue PARAMS ((CORE_ADDR, CORE_ADDR));
+static int alpha_in_lenient_prologue PARAMS ((CORE_ADDR, CORE_ADDR));
-static void
-reinit_frame_cache_sfunc PARAMS ((char *, int, struct cmd_list_element *));
+static void reinit_frame_cache_sfunc PARAMS ((char *, int, struct cmd_list_element *));
static CORE_ADDR after_prologue PARAMS ((CORE_ADDR pc,
alpha_extra_func_info_t proc_desc));
NULL). */
void
-alpha_find_saved_regs (fci)
- FRAME fci;
+alpha_find_saved_regs (frame)
+ struct frame_info *frame;
{
int ireg;
CORE_ADDR reg_position;
alpha_extra_func_info_t proc_desc;
int returnreg;
- fci->saved_regs = (struct frame_saved_regs *)
+ frame->saved_regs = (struct frame_saved_regs *)
obstack_alloc (&frame_cache_obstack, sizeof(struct frame_saved_regs));
- memset (fci->saved_regs, 0, sizeof (struct frame_saved_regs));
+ memset (frame->saved_regs, 0, sizeof (struct frame_saved_regs));
- proc_desc = fci->proc_desc;
+ proc_desc = frame->proc_desc;
if (proc_desc == NULL)
/* I'm not sure how/whether this can happen. Normally when we can't
find a proc_desc, we "synthesize" one using heuristic_proc_desc
/* Fill in the offsets for the registers which gen_mask says
were saved. */
- reg_position = fci->frame + PROC_REG_OFFSET (proc_desc);
+ reg_position = frame->frame + PROC_REG_OFFSET (proc_desc);
mask = PROC_REG_MASK (proc_desc);
returnreg = PROC_PC_REG (proc_desc);
register number. */
if (mask & (1 << returnreg))
{
- fci->saved_regs->regs[returnreg] = reg_position;
+ frame->saved_regs->regs[returnreg] = reg_position;
reg_position += 8;
mask &= ~(1 << returnreg); /* Clear bit for RA so we
don't save again later. */
for (ireg = 0; ireg <= 31 ; ++ireg)
if (mask & (1 << ireg))
{
- fci->saved_regs->regs[ireg] = reg_position;
+ frame->saved_regs->regs[ireg] = reg_position;
reg_position += 8;
}
/* Fill in the offsets for the registers which float_mask says
were saved. */
- reg_position = fci->frame + PROC_FREG_OFFSET (proc_desc);
+ reg_position = frame->frame + PROC_FREG_OFFSET (proc_desc);
mask = PROC_FREG_MASK (proc_desc);
for (ireg = 0; ireg <= 31 ; ++ireg)
if (mask & (1 << ireg))
{
- fci->saved_regs->regs[FP0_REGNUM+ireg] = reg_position;
+ frame->saved_regs->regs[FP0_REGNUM+ireg] = reg_position;
reg_position += 8;
}
- fci->saved_regs->regs[PC_REGNUM] = fci->saved_regs->regs[returnreg];
+ frame->saved_regs->regs[PC_REGNUM] = frame->saved_regs->regs[returnreg];
}
static CORE_ADDR
read_next_frame_reg(fi, regno)
- FRAME fi;
+ struct frame_info *fi;
int regno;
{
/* If it is the frame for sigtramp we have a pointer to the sigcontext
CORE_ADDR
alpha_frame_saved_pc(frame)
- FRAME frame;
+ struct frame_info *frame;
{
alpha_extra_func_info_t proc_desc = frame->proc_desc;
/* We have to get the saved pc from the sigcontext
CORE_ADDR
alpha_saved_pc_after_call (frame)
- FRAME frame;
+ struct frame_info *frame;
{
alpha_extra_func_info_t proc_desc = find_proc_desc (frame->pc, frame->next);
int pcreg = proc_desc ? PROC_PC_REG (proc_desc) : RA_REGNUM;
static alpha_extra_func_info_t
heuristic_proc_desc(start_pc, limit_pc, next_frame)
CORE_ADDR start_pc, limit_pc;
- FRAME next_frame;
+ struct frame_info *next_frame;
{
CORE_ADDR sp = read_next_frame_reg (next_frame, SP_REGNUM);
CORE_ADDR cur_pc;
if (start_pc == 0)
return NULL;
- memset(&temp_proc_desc, '\0', sizeof(temp_proc_desc));
- memset(&temp_saved_regs, '\0', sizeof(struct frame_saved_regs));
- PROC_LOW_ADDR(&temp_proc_desc) = start_pc;
+ memset (&temp_proc_desc, '\0', sizeof(temp_proc_desc));
+ memset (&temp_saved_regs, '\0', sizeof(struct frame_saved_regs));
+ PROC_LOW_ADDR (&temp_proc_desc) = start_pc;
if (start_pc + 200 < limit_pc)
limit_pc = start_pc + 200;
}
static alpha_extra_func_info_t
-find_proc_desc(pc, next_frame)
+find_proc_desc (pc, next_frame)
CORE_ADDR pc;
- FRAME next_frame;
+ struct frame_info *next_frame;
{
alpha_extra_func_info_t proc_desc;
struct block *b;
alpha_extra_func_info_t cached_proc_desc;
-FRAME_ADDR
+CORE_ADDR
alpha_frame_chain(frame)
- FRAME frame;
+ struct frame_info *frame;
{
alpha_extra_func_info_t proc_desc;
CORE_ADDR saved_pc = FRAME_SAVED_PC(frame);
/* Fetch the frame pointer for a dummy frame from the procedure
descriptor. */
if (PROC_DESC_IS_DUMMY(proc_desc))
- return (FRAME_ADDR) PROC_DUMMY_FRAME(proc_desc);
+ return (CORE_ADDR) PROC_DUMMY_FRAME(proc_desc);
/* If no frame pointer and frame size is zero, we must be at end
of stack (or otherwise hosed). If we don't check frame size,
}
void
-init_extra_frame_info(fci)
- struct frame_info *fci;
+init_extra_frame_info (frame)
+ struct frame_info *frame;
{
/* Use proc_desc calculated in frame_chain */
alpha_extra_func_info_t proc_desc =
- fci->next ? cached_proc_desc : find_proc_desc(fci->pc, fci->next);
+ frame->next ? cached_proc_desc : find_proc_desc(frame->pc, frame->next);
- fci->saved_regs = NULL;
- fci->proc_desc =
+ frame->saved_regs = NULL;
+ frame->proc_desc =
proc_desc == &temp_proc_desc ? 0 : proc_desc;
if (proc_desc)
{
/* Get the locals offset from the procedure descriptor, it is valid
even if we are in the middle of the prologue. */
- fci->localoff = PROC_LOCALOFF(proc_desc);
+ frame->localoff = PROC_LOCALOFF(proc_desc);
/* Fixup frame-pointer - only needed for top frame */
/* Fetch the frame pointer for a dummy frame from the procedure
descriptor. */
if (PROC_DESC_IS_DUMMY(proc_desc))
- fci->frame = (FRAME_ADDR) PROC_DUMMY_FRAME(proc_desc);
+ frame->frame = (CORE_ADDR) PROC_DUMMY_FRAME(proc_desc);
/* This may not be quite right, if proc has a real frame register.
Get the value of the frame relative sp, procedure might have been
interrupted by a signal at it's very start. */
- else if (fci->pc == PROC_LOW_ADDR (proc_desc) && !PROC_DESC_IS_DUMMY (proc_desc))
- fci->frame = read_next_frame_reg (fci->next, SP_REGNUM);
+ else if (frame->pc == PROC_LOW_ADDR (proc_desc) && !PROC_DESC_IS_DUMMY (proc_desc))
+ frame->frame = read_next_frame_reg (frame->next, SP_REGNUM);
else
- fci->frame = read_next_frame_reg (fci->next, PROC_FRAME_REG (proc_desc))
- + PROC_FRAME_OFFSET (proc_desc);
+ frame->frame = read_next_frame_reg (frame->next, PROC_FRAME_REG (proc_desc))
+ + PROC_FRAME_OFFSET (proc_desc);
if (proc_desc == &temp_proc_desc)
{
- fci->saved_regs = (struct frame_saved_regs*)
+ frame->saved_regs = (struct frame_saved_regs*)
obstack_alloc (&frame_cache_obstack,
sizeof (struct frame_saved_regs));
- *fci->saved_regs = temp_saved_regs;
- fci->saved_regs->regs[PC_REGNUM] = fci->saved_regs->regs[RA_REGNUM];
+ *frame->saved_regs = temp_saved_regs;
+ frame->saved_regs->regs[PC_REGNUM] = frame->saved_regs->regs[RA_REGNUM];
}
}
}
cache. This allows the rest of info frame to extract the important
arguments without difficulty. */
-FRAME
+struct frame_info *
setup_arbitrary_frame (argc, argv)
int argc;
- FRAME_ADDR *argv;
+ CORE_ADDR *argv;
{
if (argc != 2)
error ("ALPHA frame specifications require two arguments: sp and pc");
alpha_pop_frame()
{
register int regnum;
- FRAME frame = get_current_frame ();
+ struct frame_info *frame = get_current_frame ();
CORE_ADDR new_sp = frame->frame;
alpha_extra_func_info_t proc_desc = frame->proc_desc;
/* Given a return value in `regbuf' with a type `valtype',
extract and copy its value into `valbuf'. */
+
void
alpha_extract_return_value (valtype, regbuf, valbuf)
struct type *valtype;
/* Given a return value in `regbuf' with a type `valtype',
write its value into the appropriate register. */
+
void
alpha_store_return_value (valtype, valbuf)
struct type *valtype;
/* Just like reinit_frame_cache, but with the right arguments to be
callable as an sfunc. */
+
static void
reinit_frame_cache_sfunc (args, from_tty, c)
char *args;
"frame" or "info frame" command. */
#define SETUP_ARBITRARY_FRAME(argc, argv) setup_arbitrary_frame (argc, argv)
-/* FIXME: Depends on equivalence between FRAME and "struct frame_info *",
- and equivalence between CORE_ADDR and FRAME_ADDR. */
-extern struct frame_info *setup_arbitrary_frame PARAMS ((int, CORE_ADDR *));
+extern struct frame_info *setup_arbitrary_frame PARAMS ((int, FRAME_ADDR *));
However, if FRAME_CHAIN_VALID returns zero,
it means the given frame is the outermost one and has no caller. */
+#define FRAME_CHAIN(FRAME) h8300_frame_chain(FRAME)
+CORE_ADDR h8300_frame_chain PARAMS ((struct frame_info *));
+
/* In the case of the H8/300, the frame's nominal address
is the address of a 2-byte word containing the calling frame's address. */
*/
-CORE_ADDR h8500_frame_chain (/* FRAME thisframe */);
+CORE_ADDR h8500_frame_chain PARAMS ((struct frame_info *));
#define INIT_EXTRA_FRAME_INFO(fromleaf, fci) ;
/* (fci)->frame |= read_register(SEG_T_REGNUM) << 16;*/
/* Floating point is IEEE compliant */
#define IEEE_FLOAT
+extern int mips_processor_id;
+
/* Some MIPS boards are provided both with and without a floating
point coprocessor; we provide a user settable variable to tell gdb
whether there is one or not. */
/* FRAME_CHAIN takes a frame's nominal address
and produces the frame's chain-pointer. */
-#define FRAME_CHAIN(thisframe) (FRAME_ADDR)mips_frame_chain(thisframe)
+#define FRAME_CHAIN(thisframe) (CORE_ADDR) mips_frame_chain (thisframe)
/* Define other aspects of the stack frame. */
but there is nothing we can do about that). */
#define SETUP_ARBITRARY_FRAME(argc, argv) setup_arbitrary_frame (argc, argv)
-/* FIXME: Depends on equivalence between FRAME and "struct frame_info *",
- and equivalence between CORE_ADDR and FRAME_ADDR. */
extern struct frame_info *setup_arbitrary_frame PARAMS ((int, CORE_ADDR *));
/* Convert a dbx stab register number (from `r' declaration) to a gdb REGNUM */
/* Discard from the stack the innermost frame, restoring all registers. */
#define POP_FRAME \
-{ register FRAME frame = get_current_frame (); \
+{ register struct frame_info *frame = get_current_frame (); \
register CORE_ADDR fp; \
register int regnum; \
struct frame_saved_regs fsr; \
struct frame_info *fi; \
- fi = get_frame_info (frame); \
- fp = fi->frame; \
- get_frame_saved_regs (fi, &fsr); \
+ fp = frame->frame; \
+ get_frame_saved_regs (frame, &fsr); \
for (regnum = 0; regnum < 8; regnum++) \
if (fsr.regs[regnum]) \
write_register (regnum, read_memory_integer (fsr.regs[regnum], 4)); \
/* Discard from the stack the innermost frame, restoring all registers. */
#define POP_FRAME \
-{ register FRAME frame = get_current_frame (); \
+{ register struct frame_info *frame = get_current_frame (); \
register CORE_ADDR fp; \
register int regnum; \
struct frame_saved_regs fsr; \
struct frame_info *fi; \
- fi = get_frame_info (frame); \
- fp = fi->frame; \
- get_frame_saved_regs (fi, &fsr); \
+ fp = frame->frame; \
+ get_frame_saved_regs (frame, &fsr); \
for (regnum = 0; regnum < 8; regnum++) \
if (fsr.regs[regnum]) \
write_register (regnum, read_memory_integer (fsr.regs[regnum], 4)); \
stack frames are allocated in different segments (e.g. some on a
stack, some on a heap in the data segment). */
-#define EXTRA_FRAME_INFO FRAME_ADDR bottom;
+#define EXTRA_FRAME_INFO CORE_ADDR bottom;
#define INIT_EXTRA_FRAME_INFO(fromleaf, fci) \
(fci)->bottom = \
((fci)->next ? \
"frame" or "info frame" command. */
#define SETUP_ARBITRARY_FRAME(argc, argv) setup_arbitrary_frame (argc, argv)
-/* FIXME: Depends on equivalence between FRAME and "struct frame_info *",
- and equivalence between CORE_ADDR and FRAME_ADDR. */
extern struct frame_info *setup_arbitrary_frame PARAMS ((int, CORE_ADDR *));
/* To print every pair of float registers as a double, we use this hook. */
For us, the frame address is its stack pointer value, so we look up
the function prologue to determine the caller's sp value, and return it. */
-FRAME_ADDR
-FRAME_CHAIN (thisframe)
- FRAME thisframe;
+CORE_ADDR
+h8300_frame_chain (thisframe)
+ struct frame_info *thisframe;
{
frame_find_saved_regs (thisframe, (struct frame_saved_regs *) 0);
return thisframe->fsr->regs[SP_REGNUM];
examine_prologue (ip, limit, after_prolog_fp, fsr, fi)
register CORE_ADDR ip;
register CORE_ADDR limit;
- FRAME_ADDR after_prolog_fp;
+ CORE_ADDR after_prolog_fp;
struct frame_saved_regs *fsr;
struct frame_info *fi;
{
CORE_ADDR
frame_saved_pc (frame)
- FRAME frame;
+ struct frame_info *frame;
{
return frame->from_pc;
}
{
unsigned regnum;
struct frame_saved_regs fsr;
- struct frame_info *fi;
-
- FRAME frame = get_current_frame ();
+ struct frame_info *frame = get_current_frame ();
fi = get_frame_info (frame);
- get_frame_saved_regs (fi, &fsr);
+ get_frame_saved_regs (frame, &fsr);
for (regnum = 0; regnum < 8; regnum++)
{
if (fsr.regs[regnum])
- {
- write_register (regnum, read_memory_integer(fsr.regs[regnum]), BINWORD);
- }
+ write_register (regnum, read_memory_integer(fsr.regs[regnum]), BINWORD);
flush_cached_frames ();
}
/* Target-machine dependent code for Hitachi H8/500, for GDB.
- Copyright (C) 1993 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1994 Free Software Foundation, Inc.
This file is part of GDB.
For us, the frame address is its stack pointer value, so we look up
the function prologue to determine the caller's sp value, and return it. */
-FRAME_ADDR
+CORE_ADDR
h8500_frame_chain (thisframe)
- FRAME thisframe;
+ struct frame_info *thisframe;
{
if (!inside_entry_file (thisframe->pc))
return (read_memory_integer (FRAME_FP (thisframe), PTR_SIZE));
CORE_ADDR
frame_saved_pc (frame)
- FRAME frame;
+ struct frame_info *frame;
{
- return read_memory_integer ((frame)->frame + 2, PTR_SIZE);
+ return read_memory_integer (FRAME_FP (frame) + 2, PTR_SIZE);
}
CORE_ADDR
{
unsigned regnum;
struct frame_saved_regs fsr;
- struct frame_info *fi;
-
- FRAME frame = get_current_frame ();
+ struct frame_info *frame = get_current_frame ();
- fi = get_frame_info (frame);
- get_frame_saved_regs (fi, &fsr);
+ get_frame_saved_regs (frame, &fsr);
for (regnum = 0; regnum < 8; regnum++)
{
if (fsr.regs[regnum])
- {
write_register (regnum, read_memory_short (fsr.regs[regnum]));
- }
flush_cached_frames ();
}
-/* Machine-dependent code which would otherwise be in inflow.c and core.c,
- for GDB, the GNU debugger. This code is for the HP PA-RISC cpu.
- Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
+/* Target-dependent code for the HP PA architecture, for GDB.
+ Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1994
+ Free Software Foundation, Inc.
Contributed by the Center for Software Science at the
University of Utah (pa-gdb-bugs@cs.utah.edu).
#include "symfile.h"
#include "objfiles.h"
-static int restore_pc_queue PARAMS ((struct frame_saved_regs *fsr));
-static int hppa_alignof PARAMS ((struct type *arg));
-CORE_ADDR frame_saved_pc PARAMS ((FRAME frame));
+static int restore_pc_queue PARAMS ((struct frame_saved_regs *));
+
+static int hppa_alignof PARAMS ((struct type *));
+
+CORE_ADDR frame_saved_pc PARAMS ((struct frame_info *));
+
static int prologue_inst_adjust_sp PARAMS ((unsigned long));
+
static int is_branch PARAMS ((unsigned long));
+
static int inst_saves_gr PARAMS ((unsigned long));
+
static int inst_saves_fr PARAMS ((unsigned long));
+
static int pc_in_interrupt_handler PARAMS ((CORE_ADDR));
+
static int pc_in_linker_stub PARAMS ((CORE_ADDR));
-static int compare_unwind_entries PARAMS ((const struct unwind_table_entry *,
+
+static int compare_unwind_entries PARAMS ((const struct unwind_table_entry *,
const struct unwind_table_entry *));
+
static void read_unwind_info PARAMS ((struct objfile *));
+
static void internalize_unwinds PARAMS ((struct objfile *,
struct unwind_table_entry *,
asection *, unsigned int,
\f
int
frameless_function_invocation (frame)
- FRAME frame;
+ struct frame_info *frame;
{
struct unwind_table_entry *u;
CORE_ADDR
saved_pc_after_call (frame)
- FRAME frame;
+ struct frame_info *frame;
{
int ret_regnum;
CORE_ADDR pc;
\f
CORE_ADDR
frame_saved_pc (frame)
- FRAME frame;
+ struct frame_info *frame;
{
CORE_ADDR pc = get_frame_pc (frame);
struct unwind_table_entry *u;
&& (frame->next->signal_handler_caller
|| pc_in_interrupt_handler (frame->next->pc)))
{
- struct frame_info *fi;
struct frame_saved_regs saved_regs;
- fi = get_frame_info (frame->next);
- get_frame_saved_regs (fi, &saved_regs);
+ get_frame_saved_regs (frame, &saved_regs);
if (read_memory_integer (saved_regs.regs[FLAGS_REGNUM], 4) & 0x2)
pc = read_memory_integer (saved_regs.regs[31], 4) & ~0x3;
else
&& (frame->next->signal_handler_caller
|| pc_in_interrupt_handler (frame->next->pc)))
{
- struct frame_info *fi;
struct frame_saved_regs saved_regs;
- fi = get_frame_info (frame->next);
- get_frame_saved_regs (fi, &saved_regs);
+ get_frame_saved_regs (frame->next, &saved_regs);
if (read_memory_integer (saved_regs.regs[FLAGS_REGNUM], 4) & 0x2)
pc = read_memory_integer (saved_regs.regs[31], 4) & ~0x3;
else
This may involve searching through prologues for several functions
at boundaries where GCC calls HP C code, or where code which has
a frame pointer calls code without a frame pointer. */
-
-FRAME_ADDR
+CORE_ADDR
frame_chain (frame)
struct frame_info *frame;
{
/* %r3 was saved somewhere in the stack. Dig it out. */
else
{
- struct frame_info *fi;
struct frame_saved_regs saved_regs;
- fi = get_frame_info (frame);
- get_frame_saved_regs (fi, &saved_regs);
+ get_frame_saved_regs (frame, &saved_regs);
return read_memory_integer (saved_regs.regs[FP_REGNUM], 4);
}
}
int
frame_chain_valid (chain, thisframe)
- FRAME_ADDR chain;
- FRAME thisframe;
+ CORE_ADDR chain;
+ struct frame_info *thisframe;
{
struct minimal_symbol *msym_us;
struct minimal_symbol *msym_start;
struct unwind_table_entry *u, *next_u = NULL;
- FRAME next;
+ struct frame_info *next;
if (!chain)
return 0;
int
hppa_pop_frame ()
{
- register FRAME frame = get_current_frame ();
+ register struct frame_info *frame = get_current_frame ();
register CORE_ADDR fp;
register int regnum;
struct frame_saved_regs fsr;
- struct frame_info *fi;
double freg_buffer;
- fi = get_frame_info (frame);
- fp = fi->frame;
- get_frame_saved_regs (fi, &fsr);
+ fp = FRAME_FP (frame);
+ get_frame_saved_regs (frame, &fsr);
#ifndef NO_PC_SPACE_QUEUE_RESTORE
if (fsr.regs[IPSW_REGNUM]) /* Restoring a call dummy frame */
/* Get the PC from %r31 if currently in a syscall. Also mask out privilege
bits. */
+
CORE_ADDR
target_read_pc (pid)
int pid;
/* Write out the PC. If currently in a syscall, then also write the new
PC value into %r31. */
+
void
target_write_pc (v, pid)
CORE_ADDR v;
}
/* Addresses passed to dyncall may *NOT* be the actual address
- of the funtion. So we may have to do something special. */
+ of the function. So we may have to do something special. */
if (pc == dyncall)
{
pc = (CORE_ADDR) read_register (22);
void
hppa_frame_find_saved_regs (frame_info, frame_saved_regs)
- struct frame_info *frame_info;
+ struct frame_info *frame;
struct frame_saved_regs *frame_saved_regs;
{
CORE_ADDR pc;
examine the dummy code to determine locations of saved registers;
instead, let find_dummy_frame_regs fill in the correct offsets
for the saved registers. */
- if ((frame_info->pc >= frame_info->frame
- && frame_info->pc <= (frame_info->frame + CALL_DUMMY_LENGTH
+ if ((frame->pc >= frame->frame
+ && frame->pc <= (frame->frame + CALL_DUMMY_LENGTH
+ 32 * 4 + (NUM_REGS - FP0_REGNUM) * 8
+ 6 * 4)))
- find_dummy_frame_regs (frame_info, frame_saved_regs);
+ find_dummy_frame_regs (frame, frame_saved_regs);
/* Interrupt handlers are special too. They lay out the register
state in the exact same order as the register numbers in GDB. */
- if (pc_in_interrupt_handler (frame_info->pc))
+ if (pc_in_interrupt_handler (frame->pc))
{
for (i = 0; i < NUM_REGS; i++)
{
/* SP is a little special. */
if (i == SP_REGNUM)
frame_saved_regs->regs[SP_REGNUM]
- = read_memory_integer (frame_info->frame + SP_REGNUM * 4, 4);
+ = read_memory_integer (frame->frame + SP_REGNUM * 4, 4);
else
- frame_saved_regs->regs[i] = frame_info->frame + i * 4;
+ frame_saved_regs->regs[i] = frame->frame + i * 4;
}
return;
}
/* Handle signal handler callers. */
- if (frame_info->signal_handler_caller)
+ if (frame->signal_handler_caller)
{
- FRAME_FIND_SAVED_REGS_IN_SIGTRAMP (frame_info, frame_saved_regs);
+ FRAME_FIND_SAVED_REGS_IN_SIGTRAMP (frame, frame_saved_regs);
return;
}
/* Get the starting address of the function referred to by the PC
- saved in frame_info. */
- pc = get_pc_function_start (frame_info->pc);
+ saved in frame. */
+ pc = get_pc_function_start (frame->pc);
/* Yow! */
u = find_unwind_entry (pc);
/* The frame always represents the value of %sp at entry to the
current function (and is thus equivalent to the "saved" stack
pointer. */
- frame_saved_regs->regs[SP_REGNUM] = frame_info->frame;
+ frame_saved_regs->regs[SP_REGNUM] = frame->frame;
/* Loop until we find everything of interest or hit a branch.
if (inst == 0x6bc23fd9)
{
save_rp = 0;
- frame_saved_regs->regs[RP_REGNUM] = frame_info->frame - 20;
+ frame_saved_regs->regs[RP_REGNUM] = frame->frame - 20;
}
/* Just note that we found the save of SP into the stack. The
/* stwm with a positive displacement is a *post modify*. */
if ((inst >> 26) == 0x1b
&& extract_14 (inst) >= 0)
- frame_saved_regs->regs[reg] = frame_info->frame;
+ frame_saved_regs->regs[reg] = frame->frame;
else
{
/* Handle code with and without frame pointers. */
if (u->Save_SP)
frame_saved_regs->regs[reg]
- = frame_info->frame + extract_14 (inst);
+ = frame->frame + extract_14 (inst);
else
frame_saved_regs->regs[reg]
- = frame_info->frame + (u->Total_frame_size << 3)
+ = frame->frame + (u->Total_frame_size << 3)
+ extract_14 (inst);
}
}
/* 1st HP CC FP register store. After this instruction
we've set enough state that the GCC and HPCC code are
both handled in the same manner. */
- frame_saved_regs->regs[reg + FP4_REGNUM + 4] = frame_info->frame;
+ frame_saved_regs->regs[reg + FP4_REGNUM + 4] = frame->frame;
fp_loc = 8;
}
else
{
frame_saved_regs->regs[reg + FP0_REGNUM + 4]
- = frame_info->frame + fp_loc;
+ = frame->frame + fp_loc;
fp_loc += 8;
}
}
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-/* Miscellaneous i80960-dependent routines.
- Most are called from macros defined in "tm-i960.h". */
-
#include "defs.h"
#include "symtab.h"
#include "value.h"
examine_prologue (ip, limit, frame_addr, fsr)
register CORE_ADDR ip;
register CORE_ADDR limit;
- FRAME_ADDR frame_addr;
+ CORE_ADDR frame_addr;
struct frame_saved_regs *fsr;
{
register CORE_ADDR next_ip;
sal = find_pc_line (ip, 0);
limit = (sal.end) ? sal.end : 0xffffffff;
- return (examine_prologue (ip, limit, (FRAME_ADDR) 0, &saved_regs_dummy));
+ return (examine_prologue (ip, limit, (CORE_ADDR) 0, &saved_regs_dummy));
}
/* Put here the code to store, into a struct frame_saved_regs,
frame_args_address (fi, must_be_correct)
struct frame_info *fi;
{
- register FRAME frame;
struct frame_saved_regs fsr;
CORE_ADDR ap;
the saved value. If the frame is current and we are being sloppy,
return the value of g14. Otherwise, return zero. */
- frame = FRAME_INFO_ID (fi);
get_frame_saved_regs (fi, &fsr);
if (fsr.regs[G14_REGNUM])
ap = read_memory_integer (fsr.regs[G14_REGNUM],4);
- else {
- if (must_be_correct)
- return 0; /* Don't cache this result */
- if (get_next_frame (frame))
- ap = 0;
- else
- ap = read_register (G14_REGNUM);
- if (ap == 0)
- ap = fi->frame;
- }
+ else
+ {
+ if (must_be_correct)
+ return 0; /* Don't cache this result */
+ if (get_next_frame (fi))
+ ap = 0;
+ else
+ ap = read_register (G14_REGNUM);
+ if (ap == 0)
+ ap = fi->frame;
+ }
fi->arg_pointer = ap; /* Cache it for next time */
return ap;
}
frame_struct_result_address (fi)
struct frame_info *fi;
{
- register FRAME frame;
struct frame_saved_regs fsr;
CORE_ADDR ap;
the function prologue, and only use the current value if we have
no saved value and are at TOS? -- gnu@cygnus.com */
- frame = FRAME_INFO_ID (fi);
- if (get_next_frame (frame)) {
- get_frame_saved_regs (fi, &fsr);
- if (fsr.regs[G13_REGNUM])
- ap = read_memory_integer (fsr.regs[G13_REGNUM],4);
- else
- ap = 0;
- } else {
+ if (get_next_frame (fi))
+ {
+ get_frame_saved_regs (fi, &fsr);
+ if (fsr.regs[G13_REGNUM])
+ ap = read_memory_integer (fsr.regs[G13_REGNUM],4);
+ else
+ ap = 0;
+ }
+ else
ap = read_register (G13_REGNUM);
- }
+
return ap;
}
CORE_ADDR
saved_pc_after_call (frame)
- FRAME frame;
+ struct frame_info *frame;
{
CORE_ADDR saved_pc;
- CORE_ADDR get_frame_pc ();
saved_pc = leafproc_return (get_frame_pc (frame));
if (!saved_pc)
saved_pc = FRAME_SAVED_PC (frame);
- return (saved_pc);
+ return saved_pc;
}
/* Discard from the stack the innermost frame,
struct frame_saved_regs fsr;
char local_regs_buf[16 * 4];
- current_fi = get_frame_info (get_current_frame ());
+ current_fi = get_current_frame ();
/* First, undo what the hardware does when we return.
If this is a non-leaf procedure, restore local registers from
if (!leaf_return_addr)
{
/* Non-leaf procedure. Restore local registers, incl IP. */
- prev_fi = get_frame_info (get_prev_frame (FRAME_INFO_ID (current_fi)));
+ prev_fi = get_prev_frame (current_fi);
read_memory (prev_fi->frame, local_regs_buf, sizeof (local_regs_buf));
write_register_bytes (REGISTER_BYTE (R0_REGNUM), local_regs_buf,
sizeof (local_regs_buf));
case 3: return TARGET_SIGNAL_FPE; /* arithmetic fault */
case 4: return TARGET_SIGNAL_FPE; /* floating point fault */
- /* constraint fault. This appears not to distinguish between
- a range constraint fault (which should be SIGFPE) and a privileged
- fault (which should be SIGILL). */
+ /* constraint fault. This appears not to distinguish between
+ a range constraint fault (which should be SIGFPE) and a privileged
+ fault (which should be SIGILL). */
case 5: return TARGET_SIGNAL_ILL;
case 6: return TARGET_SIGNAL_SEGV; /* virtual memory fault */
- /* protection fault. This is for an out-of-range argument to
- "calls". I guess it also could be SIGILL. */
+ /* protection fault. This is for an out-of-range argument to
+ "calls". I guess it also could be SIGILL. */
case 7: return TARGET_SIGNAL_SEGV;
case 8: return TARGET_SIGNAL_BUS; /* machine fault */
/* Target-machine dependent code for Motorola 88000 series, for GDB.
- Copyright (C) 1988, 1990, 1991 Free Software Foundation, Inc.
+ Copyright (C) 1988, 1990, 1991, 1994 Free Software Foundation, Inc.
This file is part of GDB.
#include "inferior.h"
#include "value.h"
#include "gdbcore.h"
-
#include "symtab.h"
#include "setjmp.h"
#include "value.h"
void frame_find_saved_regs ();
-/* is this target an m88110? Otherwise assume m88100. This has
- relevance for the ways in which we screw with instruction pointers. */
+/* Is this target an m88110? Otherwise assume m88100. This has
+ relevance for the ways in which we screw with instruction pointers. */
+
int target_is_m88110 = 0;
/* Given a GDB frame, determine the address of the calling function's frame.
For us, the frame address is its stack pointer value, so we look up
the function prologue to determine the caller's sp value, and return it. */
-FRAME_ADDR
+CORE_ADDR
frame_chain (thisframe)
- FRAME thisframe;
+ struct frame_info *thisframe;
{
frame_find_saved_regs (thisframe, (struct frame_saved_regs *) 0);
int
frameless_function_invocation (frame)
- FRAME frame;
+ struct frame_info *frame;
{
frame_find_saved_regs (frame, (struct frame_saved_regs *) 0);
}
void
-init_extra_frame_info (fromleaf, fi)
+init_extra_frame_info (fromleaf, frame)
int fromleaf;
- struct frame_info *fi;
+ struct frame_info *frame;
{
- fi->fsr = 0; /* Not yet allocated */
- fi->args_pointer = 0; /* Unknown */
- fi->locals_pointer = 0; /* Unknown */
+ frame->fsr = 0; /* Not yet allocated */
+ frame->args_pointer = 0; /* Unknown */
+ frame->locals_pointer = 0; /* Unknown */
}
\f
/* Examine an m88k function prologue, recording the addresses at which
/* Read a register from frames called by us (or from the hardware regs). */
static int
-read_next_frame_reg(fi, regno)
- FRAME fi;
+read_next_frame_reg(frame, regno)
+ struct frame_info *frame;
int regno;
{
- for (; fi; fi = fi->next) {
- if (regno == SP_REGNUM) return fi->frame;
- else if (fi->fsr->regs[regno])
- return read_memory_integer(fi->fsr->regs[regno], 4);
+ for (; frame; frame = frame->next) {
+ if (regno == SP_REGNUM)
+ return FRAME_FP (frame);
+ else if (frame->fsr->regs[regno])
+ return read_memory_integer(frame->fsr->regs[regno], 4);
}
return read_register(regno);
}
examine_prologue (ip, limit, frame_sp, fsr, fi)
register CORE_ADDR ip;
register CORE_ADDR limit;
- FRAME_ADDR frame_sp;
+ CORE_ADDR frame_sp;
struct frame_saved_regs *fsr;
struct frame_info *fi;
{
sal = find_pc_line (ip, 0);
limit = (sal.end) ? sal.end : 0xffffffff;
- return (examine_prologue (ip, limit, (FRAME_ADDR) 0, &saved_regs_dummy,
+ return (examine_prologue (ip, limit, (CORE_ADDR) 0, &saved_regs_dummy,
(struct frame_info *)0 ));
}
CORE_ADDR
frame_saved_pc (frame)
- FRAME frame;
+ struct frame_info *frame;
{
return read_next_frame_reg(frame, SRP_REGNUM);
}
void
pop_frame ()
{
- register FRAME frame = get_current_frame ();
+ register struct frame_info *frame = get_current_frame ();
register CORE_ADDR fp;
register int regnum;
struct frame_saved_regs fsr;
- struct frame_info *fi;
- fi = get_frame_info (frame);
- fp = fi -> frame;
- get_frame_saved_regs (fi, &fsr);
+ fp = FRAME_FP (frame);
+ get_frame_saved_regs (frame, &fsr);
- if (PC_IN_CALL_DUMMY (read_pc(), read_register(SP_REGNUM), FRAME_FP(fi)))
+ if (PC_IN_CALL_DUMMY (read_pc (), read_register (SP_REGNUM), FRAME_FP (fi)))
{
/* FIXME: I think get_frame_saved_regs should be handling this so
that we can deal with the saved registers properly (e.g. frame
if (fsr.regs[regnum])
write_register (regnum,
read_memory_integer (fsr.regs[regnum], 4));
- write_pc(frame_saved_pc(frame));
+ write_pc (frame_saved_pc (frame));
}
reinit_frame_cache ();
}
int
nindy_frame_chain_valid (chain, curframe)
unsigned int chain;
- FRAME curframe;
+ struct frame_info *curframe;
{
struct symbol *sym;
struct minimal_symbol *msymbol;
/*** Debugging editions of various macros from m-pyr.h ****/
CORE_ADDR frame_locals_address (frame)
- FRAME frame;
+ struct frame_info *frame;
{
register int addr = find_saved_register (frame,CFP_REGNUM);
register int result = read_memory_integer (addr, 4);
}
CORE_ADDR frame_args_addr (frame)
- FRAME frame;
+ struct frame_info *frame;
{
register int addr = find_saved_register (frame,CFP_REGNUM);
register int result = read_memory_integer (addr, 4);
{
CORE_ADDR pc, lr, sp, prev_sp; /* %pc, %lr, %sp */
struct aix_framedata fdata;
- FRAME fr = get_current_frame ();
+ struct frame_info *frame = get_current_frame ();
int addr, ii;
pc = read_pc ();
- sp = FRAME_FP (fr);
+ sp = FRAME_FP (frame);
if (stop_stack_dummy && dummy_frame_count) {
pop_dummy_frame ();
addr = prev_sp - fdata.offset;
if (fdata.saved_gpr != -1)
- for (ii=fdata.saved_gpr; ii <= 31; ++ii) {
+ for (ii = fdata.saved_gpr; ii <= 31; ++ii) {
read_memory (addr, ®isters [REGISTER_BYTE (ii)], 4);
addr += 4;
}
if (fdata.saved_fpr != -1)
- for (ii=fdata.saved_fpr; ii <= 31; ++ii) {
+ for (ii = fdata.saved_fpr; ii <= 31; ++ii) {
read_memory (addr, ®isters [REGISTER_BYTE (ii+FP0_REGNUM)], 8);
addr += 8;
}
return fi->initial_sp = read_register (fdata.alloca_reg);
}
-FRAME_ADDR
+CORE_ADDR
rs6000_frame_chain (thisframe)
struct frame_info *thisframe;
{
- FRAME_ADDR fp;
+ CORE_ADDR fp;
if (inside_entry_file ((thisframe)->pc))
return 0;
if (thisframe->signal_handler_caller)
#include "dis-asm.h"
#include "../opcodes/sh-opc.h"
-
-
-
/* Prologue looks like
[mov.l <regs>,@-r15]...
[sts.l pr,@-r15]
CORE_ADDR
sh_skip_prologue (start_pc)
CORE_ADDR start_pc;
-
{
int w;
GDB_FILE *stream;
{
disassemble_info info;
+
GDB_INIT_DISASSEMBLE_INFO (info, stream);
+
return print_insn_sh (memaddr, &info);
}
For us, the frame address is its stack pointer value, so we look up
the function prologue to determine the caller's sp value, and return it. */
-FRAME_ADDR
-sh_frame_chain (thisframe)
- FRAME thisframe;
+CORE_ADDR
+sh_frame_chain (frame)
+ struct frame_info *frame;
{
- if (!inside_entry_file (thisframe->pc))
- return (read_memory_integer (FRAME_FP (thisframe) + thisframe->f_offset, 4));
+ if (!inside_entry_file (frame->pc))
+ return read_memory_integer (FRAME_FP (frame) + frame->f_offset, 4);
else
return 0;
}
void
pop_frame ()
{
- register FRAME frame = get_current_frame ();
+ register struct frame_info *frame = get_current_frame ();
register CORE_ADDR fp;
register int regnum;
struct frame_saved_regs fsr;
- struct frame_info *fi;
- fi = get_frame_info (frame);
- fp = fi->frame;
- get_frame_saved_regs (fi, &fsr);
+ fp = FRAME_FP (frame);
+ get_frame_saved_regs (frame, &fsr);
/* Copy regs from where they were saved in the frame */
for (regnum = 0; regnum < NUM_REGS; regnum++)
}
/* Print the registers in a form similar to the E7000 */
+
static void
show_regs (args, from_tty)
-char *args;
-int from_tty;
+ char *args;
+ int from_tty;
{
printf_filtered("PC=%08x SR=%08x PR=%08x MACH=%08x MACHL=%08x\n",
read_register(PC_REGNUM),
/* Target-machine dependent code for Zilog Z8000, for GDB.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
+ Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
This file is part of GDB.
#include "gdbcmd.h"
#include "gdbtypes.h"
#include "dis-asm.h"
+
/* Return the saved PC from this frame.
If the frame has a memory copy of SRP_REGNUM, use that. If not,
CORE_ADDR
frame_saved_pc (frame)
- FRAME frame;
+ struct frame_info *frame;
{
- return (read_memory_pointer (frame->frame + (BIG ? 4 : 2)));
+ return read_memory_pointer (frame->frame + (BIG ? 4 : 2));
}
#define IS_PUSHL(x) (BIG ? ((x & 0xfff0) == 0x91e0):((x & 0xfff0) == 0x91F0))
return x & PTR_MASK;
}
+int
read_memory_pointer (x)
CORE_ADDR x;
{
-
return read_memory_integer (ADDR_BITS_REMOVE (x), BIG ? 4 : 2);
}
-FRAME_ADDR
+CORE_ADDR
frame_chain (thisframe)
- FRAME thisframe;
+ struct frame_info *thisframe;
{
if (thisframe->prev == 0)
{
/* This is the top of the stack, let's get the sp for real */
}
- if (!inside_entry_file ((thisframe)->pc))
+ if (!inside_entry_file (thisframe->pc))
{
- return read_memory_pointer ((thisframe)->frame);
+ return read_memory_pointer (thisframe->frame);
}
return 0;
}
{
disassemble_info info;
- GDB_INIT_DISASSEMBLE_INFO(info, stream);
+ GDB_INIT_DISASSEMBLE_INFO (info, stream);
if (BIG)
{
pc = skip_adjust (get_pc_function_start (fip->pc), &locals);
{
- adr = fip->frame - locals;
+ adr = FRAME_FP (fip) - locals;
for (i = 0; i < 8; i++)
{
int word = read_memory_short (pc);
}
-extract_return_value(type, regbuf, valbuf)
-struct type *type;
-char *regbuf;
-char *valbuf;
+extract_return_value (type, regbuf, valbuf)
+ struct type *type;
+ char *regbuf;
+ char *valbuf;
{
int b;
- int len = TYPE_LENGTH(type);
+ int len = TYPE_LENGTH (type);
- for (b = 0; b < len; b += 2) {
- int todo = len - b;
- if (todo > 2)
- todo = 2;
- memcpy(valbuf + b, regbuf + b, todo);
- }
+ for (b = 0; b < len; b += 2)
+ {
+ int todo = len - b;
+
+ if (todo > 2)
+ todo = 2;
+ memcpy (valbuf + b, regbuf + b, todo);
+ }
}
void
-write_return_value(type, valbuf)
-struct type *type;
-char *valbuf;
+write_return_value (type, valbuf)
+ struct type *type;
+ char *valbuf;
{
int reg;
int len;
- for (len = 0; len < TYPE_LENGTH(type); len += 2)
- {
- write_register_bytes(REGISTER_BYTE(len /2 + 2), valbuf + len, 2);
- }
+
+ for (len = 0; len < TYPE_LENGTH (type); len += 2)
+ write_register_bytes (REGISTER_BYTE (len / 2 + 2), valbuf + len, 2);
}
void
-store_struct_return(addr, sp)
-CORE_ADDR addr;
-CORE_ADDR sp;
+store_struct_return (addr, sp)
+ CORE_ADDR addr;
+ CORE_ADDR sp;
{
- write_register(2, addr);
+ write_register (2, addr);
}
int from_tty;
{
z8k_set_pointer_size (16);
-
}
-
static void
set_memory (args, from_tty)
char *args;