/* Target-dependent code for the Sanyo Xstormy16a (LC590000) processor.
- Copyright 2001, Free Software Foundation, Inc.
+
+ Copyright 2001, 2002 Free Software Foundation, Inc.
This file is part of GDB.
/* Function: xstormy16_register_name
Returns the name of the standard Xstormy16 register N. */
-static char *
+static const char *
xstormy16_register_name (int regnum)
{
static char *register_names[] = {
struct frame_info *fi,
int regnum, enum lval_type *lval)
{
- generic_get_saved_register (raw_buffer, optimized, addrp, fi, regnum, lval);
+ deprecated_generic_get_saved_register (raw_buffer, optimized, addrp, fi, regnum, lval);
}
/* Function: xstormy16_type_is_scalar
if (fi == NULL)
return; /* paranoia */
- if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
{
generic_pop_dummy_frame ();
}
/* Add leading zeros to the value. */
memset (buf, 0, xstormy16_reg_size);
memcpy (buf, valbuf, 1);
- write_register_gen (E_1ST_ARG_REGNUM, buf);
+ deprecated_write_register_gen (E_1ST_ARG_REGNUM, buf);
}
else if (xstormy16_type_is_scalar (type) &&
TYPE_LENGTH (type) <= E_MAX_RETTYPE_SIZE_IN_REGS)
- write_register_bytes (REGISTER_BYTE (E_1ST_ARG_REGNUM),
- valbuf, TYPE_LENGTH (type));
+ deprecated_write_register_bytes (REGISTER_BYTE (E_1ST_ARG_REGNUM),
+ valbuf, TYPE_LENGTH (type));
else
{
return_buffer = read_register (E_PTR_RET_REGNUM);
int size = xstormy16_register_raw_size (regnum);
char *buf = (char *) alloca (size);
- generic_get_saved_register (buf, NULL, NULL, fi, regnum, NULL);
+ deprecated_generic_get_saved_register (buf, NULL, NULL, fi, regnum, NULL);
return (CORE_ADDR) extract_unsigned_integer (buf, size);
}
*/
static CORE_ADDR
-xstormy16_scan_prologue (CORE_ADDR start_addr,
- CORE_ADDR end_addr, struct frame_info *fi)
+xstormy16_scan_prologue (CORE_ADDR start_addr, CORE_ADDR end_addr,
+ struct frame_info *fi, int *frameless)
{
CORE_ADDR sp = 0, fp = 0;
CORE_ADDR next_addr;
LONGEST offset;
int regnum;
+ if (frameless)
+ *frameless = 1;
if (fi)
{
/* In a call dummy, don't touch the frame. */
- if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
return start_addr;
/* Grab the frame-relative values of SP and FP, needed below.
{
if (fi) /* Record that the frame pointer is in use. */
fi->extra_info->frameless_p = 0;
+ if (frameless)
+ *frameless = 0;
}
/* optional copying of args in r2-r7 to r10-r13 */
struct symtab_and_line sal;
struct symbol *sym;
+ /* Don't trust line number debug info in frameless functions. */
+ int frameless = 1;
+ CORE_ADDR plg_end = xstormy16_scan_prologue (func_addr, func_end,
+ NULL, &frameless);
+ if (frameless)
+ return plg_end;
+
/* Found a function. */
sym = lookup_symbol (func_name, NULL, VAR_NAMESPACE, NULL, NULL);
+ /* Don't use line number debug info for assembly source files. */
if (sym && SYMBOL_LANGUAGE (sym) != language_asm)
{
- /* Don't use this trick for assembly source files. */
sal = find_pc_line (func_addr, 0);
if (sal.end && sal.end < func_end)
{
return sal.end;
}
}
- /* No useable line symbol. Use prologue parsing method. */
- return xstormy16_scan_prologue (func_addr, func_end, NULL);
+ /* No useable line symbol. Use result of prologue parsing method. */
+ return plg_end;
}
/* No function symbol -- just return the PC. */
/* Find the beginning of this function, so we can analyze its
prologue. */
if (find_pc_partial_function (fi->pc, NULL, &func_addr, &func_end))
- xstormy16_scan_prologue (func_addr, fi->pc, fi);
+ xstormy16_scan_prologue (func_addr, fi->pc, fi, NULL);
/* Else we're out of luck (can't debug completely stripped code).
FIXME. */
}
{
CORE_ADDR saved_pc;
- if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
{
- saved_pc = generic_read_register_dummy (fi->pc, fi->frame, E_PC_REGNUM);
+ saved_pc = deprecated_read_register_dummy (fi->pc, fi->frame,
+ E_PC_REGNUM);
}
else
{
static CORE_ADDR
xstormy16_frame_chain (struct frame_info *fi)
{
- if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
{
/* Call dummy's frame is the same as caller's. */
return fi->frame;
return pc;
}
-static unsigned char *
+const static unsigned char *
xstormy16_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
{
static unsigned char breakpoint[] = { 0x06, 0x0 };
gdbarch = gdbarch_alloc (&info, 0);
+ /* NOTE: cagney/2002-12-06: This can be deleted when this arch is
+ ready to unwind the PC first (see frame.c:get_prev_frame()). */
+ set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_default);
+
/*
* Basic register fields and methods.
*/
set_gdbarch_frame_saved_pc (gdbarch, xstormy16_frame_saved_pc);
set_gdbarch_skip_prologue (gdbarch, xstormy16_skip_prologue);
set_gdbarch_frame_chain_valid (gdbarch, xstormy16_frame_chain_valid);
- set_gdbarch_frame_args_address (gdbarch, default_frame_address);
- set_gdbarch_frame_locals_address (gdbarch, default_frame_address);
set_gdbarch_in_function_epilogue_p (gdbarch,
xstormy16_in_function_epilogue_p);
* Call Dummies
*
* These values and methods are used when gdb calls a target function. */
- set_gdbarch_use_generic_dummy_frames (gdbarch, 1);
set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame);
set_gdbarch_push_return_address (gdbarch, xstormy16_push_return_address);
- set_gdbarch_extract_return_value (gdbarch, xstormy16_extract_return_value);
+ set_gdbarch_deprecated_extract_return_value (gdbarch, xstormy16_extract_return_value);
set_gdbarch_push_arguments (gdbarch, xstormy16_push_arguments);
set_gdbarch_pop_frame (gdbarch, xstormy16_pop_frame);
set_gdbarch_store_struct_return (gdbarch, xstormy16_store_struct_return);
- set_gdbarch_store_return_value (gdbarch, xstormy16_store_return_value);
- set_gdbarch_extract_struct_value_address (gdbarch,
- xstormy16_extract_struct_value_address);
+ set_gdbarch_deprecated_store_return_value (gdbarch, xstormy16_store_return_value);
+ set_gdbarch_deprecated_extract_struct_value_address (gdbarch, xstormy16_extract_struct_value_address);
set_gdbarch_use_struct_convention (gdbarch,
xstormy16_use_struct_convention);
- set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT);
set_gdbarch_call_dummy_address (gdbarch, entry_point_address);
set_gdbarch_call_dummy_start_offset (gdbarch, 0);
set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0);
set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1);
set_gdbarch_call_dummy_length (gdbarch, 0);
- set_gdbarch_pc_in_call_dummy (gdbarch, generic_pc_in_call_dummy);
set_gdbarch_call_dummy_p (gdbarch, 1);
set_gdbarch_call_dummy_words (gdbarch, call_dummy_words);
set_gdbarch_sizeof_call_dummy_words (gdbarch, 0);