From 1d049c5e1d1bbd7805cd3403bab79a69fc38fc43 Mon Sep 17 00:00:00 2001 From: Jason Thorpe Date: Wed, 26 Jun 2002 17:20:36 +0000 Subject: [PATCH] * 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. --- gdb/ChangeLog | 11 +++++++++++ gdb/config/vax/nm-vax.h | 2 ++ gdb/config/vax/tm-vax.h | 8 -------- gdb/vax-tdep.c | 23 +++++++++++++++++------ 4 files changed, 30 insertions(+), 14 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 00c823696af..adea6be3ba1 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,14 @@ +2002-06-26 Jason Thorpe + + * 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. + 2002-06-26 Jason Thorpe * Makefile.in (vax_tdep_h): Define. diff --git a/gdb/config/vax/nm-vax.h b/gdb/config/vax/nm-vax.h index c2baef18fa6..efebd6b8936 100644 --- a/gdb/config/vax/nm-vax.h +++ b/gdb/config/vax/nm-vax.h @@ -18,6 +18,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#define AP_REGNUM 12 /* XXXJRT */ + #define REGISTER_U_ADDR(addr, blockend, regno) \ { addr = blockend - 0110 + regno * 4; \ if (regno == PC_REGNUM) addr = blockend - 8; \ diff --git a/gdb/config/vax/tm-vax.h b/gdb/config/vax/tm-vax.h index 204d155ab6d..8d77a2997b2 100644 --- a/gdb/config/vax/tm-vax.h +++ b/gdb/config/vax/tm-vax.h @@ -31,11 +31,6 @@ #define SIGTRAMP_START(pc) STACK_END_ADDR #define SIGTRAMP_END(pc) 0x80000000 -/* Sequence of bytes for breakpoint instruction. */ -#define BREAKPOINT {3} - -#define AP_REGNUM 12 /* XXXJRT */ - /* Offset to saved PC in sigcontext, from . */ /* XXXJRT should go away */ #define SIGCONTEXT_PC_OFFSET 12 @@ -43,6 +38,3 @@ /* XXXJRT not yet under gdbarch control */ #define FRAME_ARGS_ADDRESS_CORRECT(fi) vax_frame_args_address_correct ((fi)) extern CORE_ADDR vax_frame_args_address_correct (struct frame_info *); - -/* If vax pcc says CHAR or SHORT, it provides the correct address. */ -#define BELIEVE_PCC_PROMOTION 1 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); -- 2.30.2