* avr-tdep.c (avr_register_byte): Delete function.

(avr_register_raw_size): Delete function.
(avr_register_virtual_size): Delete function.
(avr_register_virtual_type): Delete function.
(avr_register_type): New function.
(avr_address_to_pointer): Remove unused code.
(avr_read_fp): Need to read FP as two separate bytes due to change to
avr_register_type() usage.
(avr_gdbarch_init): Don't set deprecated_register_size.
Don't set deprecated_register_bytes.
Don't set deprecated_register_byte.
Don't set deprecated_register_raw_size.
Don't set deprecated_max_register_raw_size.
Don't set deprecated_register_virtual_size.
Don't set deprecated_max_register_virtual_size.
Don't set deprecated_register_virtual_type.
Set register_type method.
This commit is contained in:
Theodore A. Roth 2003-06-15 22:01:05 +00:00
parent 3993f6b15a
commit 866b76ea9c
2 changed files with 35 additions and 66 deletions

View File

@ -1,3 +1,23 @@
2003-06-15 Theodore A. Roth <troth@openavr.org>
* avr-tdep.c (avr_register_byte): Delete function.
(avr_register_raw_size): Delete function.
(avr_register_virtual_size): Delete function.
(avr_register_virtual_type): Delete function.
(avr_register_type): New function.
(avr_address_to_pointer): Remove unused code.
(avr_read_fp): Need to read FP as two separate bytes due to change to
avr_register_type() usage.
(avr_gdbarch_init): Don't set deprecated_register_size.
Don't set deprecated_register_bytes.
Don't set deprecated_register_byte.
Don't set deprecated_register_raw_size.
Don't set deprecated_max_register_raw_size.
Don't set deprecated_register_virtual_size.
Don't set deprecated_max_register_virtual_size.
Don't set deprecated_register_virtual_type.
Set register_type method.
2003-06-15 Daniel Jacobowitz <drow@mvista.com> 2003-06-15 Daniel Jacobowitz <drow@mvista.com>
* Makefile.in (linux-nat.o): Add rule. * Makefile.in (linux-nat.o): Add rule.

View File

@ -176,60 +176,19 @@ avr_register_name (int regnum)
return register_names[regnum]; return register_names[regnum];
} }
/* Index within `registers' of the first byte of the space for
register REGNUM. */
static int
avr_register_byte (int regnum)
{
if (regnum < AVR_PC_REGNUM)
return regnum;
else
return AVR_PC_REG_INDEX;
}
/* Number of bytes of storage in the actual machine representation for
register REGNUM. */
static int
avr_register_raw_size (int regnum)
{
switch (regnum)
{
case AVR_PC_REGNUM:
return 4;
case AVR_SP_REGNUM:
case AVR_FP_REGNUM:
return 2;
default:
return 1;
}
}
/* Number of bytes of storage in the program's representation
for register N. */
static int
avr_register_virtual_size (int regnum)
{
return TYPE_LENGTH (REGISTER_VIRTUAL_TYPE (regnum));
}
/* Return the GDB type object for the "standard" data type /* Return the GDB type object for the "standard" data type
of data in register N. */ of data in register N. */
static struct type * static struct type *
avr_register_virtual_type (int regnum) avr_register_type (struct gdbarch *gdbarch, int reg_nr)
{ {
switch (regnum) if (reg_nr == AVR_PC_REGNUM)
{ return builtin_type_uint32;
case AVR_PC_REGNUM:
return builtin_type_unsigned_long; if (reg_nr == AVR_SP_REGNUM)
case AVR_SP_REGNUM: return builtin_type_void_data_ptr;
return builtin_type_unsigned_short; else
default: return builtin_type_uint8;
return builtin_type_unsigned_char;
}
} }
/* Instruction address checks and convertions. */ /* Instruction address checks and convertions. */
@ -326,14 +285,6 @@ avr_pointer_to_address (struct type *type, const void *buf)
{ {
CORE_ADDR addr = extract_unsigned_integer (buf, TYPE_LENGTH (type)); CORE_ADDR addr = extract_unsigned_integer (buf, TYPE_LENGTH (type));
if (TYPE_CODE_SPACE (TYPE_TARGET_TYPE (type)))
{
fprintf_unfiltered (gdb_stderr, "CODE_SPACE ---->> ptr->addr: 0x%lx\n",
addr);
fprintf_unfiltered (gdb_stderr,
"+++ If you see this, please send me an email <troth@openavr.org>\n");
}
/* Is it a code address? */ /* Is it a code address? */
if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_FUNC if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_FUNC
|| TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_METHOD || TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_METHOD
@ -384,7 +335,12 @@ avr_write_sp (CORE_ADDR val)
static CORE_ADDR static CORE_ADDR
avr_read_fp (void) avr_read_fp (void)
{ {
return (avr_make_saddr (read_register (AVR_FP_REGNUM))); CORE_ADDR fp;
fp = read_register (AVR_FP_REGNUM);
fp += (read_register (AVR_FP_REGNUM+1) << 8);
return (avr_make_saddr (fp));
} }
/* avr_scan_prologue is also used as the /* avr_scan_prologue is also used as the
@ -1131,14 +1087,7 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_pc_regnum (gdbarch, AVR_PC_REGNUM); set_gdbarch_pc_regnum (gdbarch, AVR_PC_REGNUM);
set_gdbarch_register_name (gdbarch, avr_register_name); set_gdbarch_register_name (gdbarch, avr_register_name);
set_gdbarch_deprecated_register_size (gdbarch, 1); set_gdbarch_register_type (gdbarch, avr_register_type);
set_gdbarch_deprecated_register_bytes (gdbarch, AVR_NUM_REG_BYTES);
set_gdbarch_deprecated_register_byte (gdbarch, avr_register_byte);
set_gdbarch_deprecated_register_raw_size (gdbarch, avr_register_raw_size);
set_gdbarch_deprecated_max_register_raw_size (gdbarch, 4);
set_gdbarch_deprecated_register_virtual_size (gdbarch, avr_register_virtual_size);
set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 4);
set_gdbarch_deprecated_register_virtual_type (gdbarch, avr_register_virtual_type);
set_gdbarch_print_insn (gdbarch, print_insn_avr); set_gdbarch_print_insn (gdbarch, print_insn_avr);