aboutsummaryrefslogtreecommitdiff
path: root/gdb/vax-tdep.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2004-04-12 16:49:35 +0000
committerMark Kettenis <kettenis@gnu.org>2004-04-12 16:49:35 +0000
commit5e6b39ffbc68f0cd1a62a3d711833d6b8d6c535f (patch)
treed9297909851d88b4e049dd4c6f6c8c70bc62f347 /gdb/vax-tdep.c
parent296bc76f51b29b5c8bc5e288c4dce21d159e0266 (diff)
downloadgdb-5e6b39ffbc68f0cd1a62a3d711833d6b8d6c535f.zip
gdb-5e6b39ffbc68f0cd1a62a3d711833d6b8d6c535f.tar.gz
gdb-5e6b39ffbc68f0cd1a62a3d711833d6b8d6c535f.tar.bz2
* vax-tdep.h: Update copyright year. Adjust comments.
(VAX_REGISTER_SIZE, VAX_REGISTER_BYTES, VAX_MAX_REGISTER_RAW_SIZE, VAX_MAX_REGISTER_VIRTUAL_SIZE): Remove macros. (vax_regnum): New enum. Replacing... (VAX_AP_REGNUM, VAX_FP_REGNUM, VAX_SP_REGNUM, VAX_PC_REGNUM) (VAX_PS_REGNUM): ... these removed macros. * vax-tdep.c (vax_register_name): Remove prototype. (vax_register_name): Reorganize somewhat. Use ARRAY_SIZE. (vax_register_byte, vax_register_raw_size, vax_register_virtual_size, vax_register_virtual_type): Remove functions. (vax_register_type): New function. (vax_breakpoint_from_pc): Reorganize. (vax_gdbarch_init): Set register_type. Don't set deprecated_register_size, deprecated_register_bytes, deprecated_register_byte, deprecated_register_raw_size, deprecated_max_register_raw_size, deprecated_register_virtual_size, deprecated_max_register_virtual_size and deprecated_register_virtual_type. Add comment on stack direction.
Diffstat (limited to 'gdb/vax-tdep.c')
-rw-r--r--gdb/vax-tdep.c70
1 files changed, 27 insertions, 43 deletions
diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c
index a0eac7d..cf2f86c 100644
--- a/gdb/vax-tdep.c
+++ b/gdb/vax-tdep.c
@@ -35,8 +35,6 @@
#include "vax-tdep.h"
-static gdbarch_register_name_ftype vax_register_name;
-
static gdbarch_skip_prologue_ftype vax_skip_prologue;
static gdbarch_frame_num_args_ftype vax_frame_num_args;
static gdbarch_deprecated_frame_chain_ftype vax_frame_chain;
@@ -45,45 +43,32 @@ static gdbarch_deprecated_extract_return_value_ftype vax_extract_return_value;
static gdbarch_deprecated_push_dummy_frame_ftype vax_push_dummy_frame;
+
+/* Return the name of register REGNUM. */
+
static const char *
-vax_register_name (int regno)
+vax_register_name (int regnum)
{
static char *register_names[] =
{
- "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
- "r8", "r9", "r10", "r11", "ap", "fp", "sp", "pc",
+ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
+ "r8", "r9", "r10", "r11", "ap", "fp", "sp", "pc",
"ps",
};
- if (regno < 0)
- return (NULL);
- if (regno >= (sizeof(register_names) / sizeof(*register_names)))
- return (NULL);
- return (register_names[regno]);
-}
+ if (regnum >= 0 && regnum < ARRAY_SIZE (register_names))
+ return register_names[regnum];
-static int
-vax_register_byte (int regno)
-{
- return (regno * 4);
+ return NULL;
}
-static int
-vax_register_raw_size (int regno)
-{
- return (4);
-}
-
-static int
-vax_register_virtual_size (int regno)
-{
- return (4);
-}
+/* Return the GDB type object for the "standard" data type of data in
+ register REGNUM. */
static struct type *
-vax_register_virtual_type (int regno)
+vax_register_type (struct gdbarch *gdbarch, int regnum)
{
- return (builtin_type_int);
+ return builtin_type_int;
}
static void
@@ -273,13 +258,20 @@ vax_store_return_value (struct type *valtype, char *valbuf)
deprecated_write_register_bytes (0, valbuf, TYPE_LENGTH (valtype));
}
+
+/* Use the program counter to determine the contents and size of a
+ breakpoint instruction. Return a pointer to a string of bytes that
+ encode a breakpoint instruction, store the length of the string in
+ *LEN and optionally adjust *PC to point to the correct memory
+ location for inserting the breakpoint. */
+
static const unsigned char *
-vax_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
+vax_breakpoint_from_pc (CORE_ADDR *pc, int *len)
{
- static const unsigned char vax_breakpoint[] = { 3 };
+ static unsigned char break_insn[] = { 3 };
- *lenptr = sizeof(vax_breakpoint);
- return (vax_breakpoint);
+ *len = sizeof (break_insn);
+ return break_insn;
}
/* Advance PC across any function entry prologue instructions
@@ -342,22 +334,13 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* Register info */
set_gdbarch_num_regs (gdbarch, VAX_NUM_REGS);
+ set_gdbarch_register_name (gdbarch, vax_register_name);
+ set_gdbarch_register_type (gdbarch, vax_register_type);
set_gdbarch_sp_regnum (gdbarch, VAX_SP_REGNUM);
set_gdbarch_deprecated_fp_regnum (gdbarch, VAX_FP_REGNUM);
set_gdbarch_pc_regnum (gdbarch, VAX_PC_REGNUM);
set_gdbarch_ps_regnum (gdbarch, VAX_PS_REGNUM);
- set_gdbarch_register_name (gdbarch, vax_register_name);
- set_gdbarch_deprecated_register_size (gdbarch, VAX_REGISTER_SIZE);
- set_gdbarch_deprecated_register_bytes (gdbarch, VAX_REGISTER_BYTES);
- set_gdbarch_deprecated_register_byte (gdbarch, vax_register_byte);
- set_gdbarch_deprecated_register_raw_size (gdbarch, vax_register_raw_size);
- set_gdbarch_deprecated_max_register_raw_size (gdbarch, VAX_MAX_REGISTER_RAW_SIZE);
- set_gdbarch_deprecated_register_virtual_size (gdbarch, vax_register_virtual_size);
- set_gdbarch_deprecated_max_register_virtual_size (gdbarch,
- VAX_MAX_REGISTER_VIRTUAL_SIZE);
- set_gdbarch_deprecated_register_virtual_type (gdbarch, vax_register_virtual_type);
-
/* Frame and stack info */
set_gdbarch_skip_prologue (gdbarch, vax_skip_prologue);
set_gdbarch_deprecated_saved_pc_after_call (gdbarch, vax_saved_pc_after_call);
@@ -373,6 +356,7 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_frame_args_skip (gdbarch, 4);
+ /* Stack grows downward. */
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
/* Return value info */