summaryrefslogtreecommitdiff
path: root/gdb/vax-tdep.c
diff options
context:
space:
mode:
authorJason Thorpe <thorpej@netbsd.org>2002-06-26 17:20:36 +0000
committerJason Thorpe <thorpej@netbsd.org>2002-06-26 17:20:36 +0000
commit1e779d4991e41964c30bed527ead1733db81aedc (patch)
treedc25c6d28d7925977101785ef8e2ac78456dab02 /gdb/vax-tdep.c
parent0e56c149bfa5f3fc88afbc0271462d199210d631 (diff)
downloadgdb-1e779d4991e41964c30bed527ead1733db81aedc.tar.gz
* config/vax/tm-vax.h (BREAKPOINT): Remove.
(BELIEVE_PCC_PROMOTION): Remove. (AP_REGNUM): Move to... * config/vax/nm-vax.h: ...here. * vax-tdep.c: Use VAX_AP_REGNUM instead of AP_REGNUM. (vax_breakpoint_from_pc): New function. (vax_gdbarch_init): Initialize gdbarch_breakpoint_from_pc and gdbarch_believe_pcc_promotion.
Diffstat (limited to 'gdb/vax-tdep.c')
-rw-r--r--gdb/vax-tdep.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c
index 40e4e96d545..46dce5a6cd4 100644
--- a/gdb/vax-tdep.c
+++ b/gdb/vax-tdep.c
@@ -186,7 +186,7 @@ vax_frame_init_saved_regs (struct frame_info *frame)
/* regmask's low bit is for register 0, which is the first one
what would be pushed. */
- for (regnum = 0; regnum < AP_REGNUM; regnum++)
+ for (regnum = 0; regnum < VAX_AP_REGNUM; regnum++)
{
if (regmask & (1 << regnum))
frame->saved_regs[regnum] = next_addr += 4;
@@ -199,7 +199,7 @@ vax_frame_init_saved_regs (struct frame_info *frame)
frame->saved_regs[PC_REGNUM] = frame->frame + 16;
frame->saved_regs[FP_REGNUM] = frame->frame + 12;
- frame->saved_regs[AP_REGNUM] = frame->frame + 8;
+ frame->saved_regs[VAX_AP_REGNUM] = frame->frame + 8;
frame->saved_regs[PS_REGNUM] = frame->frame + 4;
}
@@ -239,7 +239,7 @@ vax_frame_args_address (struct frame_info *frame)
if (frame->next)
return (read_memory_integer (frame->next->frame + 8, 4));
- return (read_register (AP_REGNUM));
+ return (read_register (VAX_AP_REGNUM));
}
static CORE_ADDR
@@ -276,12 +276,12 @@ vax_push_dummy_frame (void)
sp = push_word (sp, read_register (regnum));
sp = push_word (sp, read_register (PC_REGNUM));
sp = push_word (sp, read_register (FP_REGNUM));
- sp = push_word (sp, read_register (AP_REGNUM));
+ sp = push_word (sp, read_register (VAX_AP_REGNUM));
sp = push_word (sp, (read_register (PS_REGNUM) & 0xffef) + 0x2fff0000);
sp = push_word (sp, 0);
write_register (SP_REGNUM, sp);
write_register (FP_REGNUM, sp);
- write_register (AP_REGNUM, sp + (17 * 4));
+ write_register (VAX_AP_REGNUM, sp + (17 * 4));
}
static void
@@ -296,7 +296,7 @@ vax_pop_frame (void)
| (read_register (PS_REGNUM) & 0xffff0000));
write_register (PC_REGNUM, read_memory_integer (fp + 16, 4));
write_register (FP_REGNUM, read_memory_integer (fp + 12, 4));
- write_register (AP_REGNUM, read_memory_integer (fp + 8, 4));
+ write_register (VAX_AP_REGNUM, read_memory_integer (fp + 8, 4));
fp += 16;
for (regnum = 0; regnum < 12; regnum++)
if (regmask & (0x10000 << regnum))
@@ -353,6 +353,15 @@ vax_extract_struct_value_address (char *regbuf)
return (extract_address (regbuf + REGISTER_BYTE (0), REGISTER_RAW_SIZE (0)));
}
+static const unsigned char *
+vax_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
+{
+ static const unsigned char vax_breakpoint[] = { 3 };
+
+ *lenptr = sizeof(vax_breakpoint);
+ return (vax_breakpoint);
+}
+
/* Advance PC across any function entry prologue instructions
to reach some "real" code. */
@@ -708,10 +717,12 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0);
/* Breakpoint info */
+ set_gdbarch_breakpoint_from_pc (gdbarch, vax_breakpoint_from_pc);
set_gdbarch_decr_pc_after_break (gdbarch, 0);
/* Misc info */
set_gdbarch_function_start_offset (gdbarch, 2);
+ set_gdbarch_believe_pcc_promotion (gdbarch, 1);
/* Hook in ABI-specific overrides, if they have been registered. */
gdbarch_init_osabi (info, gdbarch, osabi);