* vax-tdep.c: Include regcache.h.

(vax_call_dummy_words): New.
(sizeof_vax_call_dummy_words): New.
(vax_fix_call_dummy): New function.
(vax_saved_pc_after_call): Ditto.
* config/vax/tm-vax.h: Don't include regcache.h.
(SAVED_PC_AFTER_CALL): Use vax_saved_pc_after_call.
(CALL_DUMMY): Remove.
(CALL_DUMMY_WORDS): Define.
(SIZEOF_CALL_DUMMY_WORDS): Define.
(FIX_CALL_DUMMY): Use vax_fix_call_dummy.
This commit is contained in:
Jason Thorpe 2002-04-22 23:13:50 +00:00
parent 47a73475e9
commit a33f755889
3 changed files with 53 additions and 25 deletions

View File

@ -1,3 +1,17 @@
2002-04-22 Jason Thorpe <thorpej@wasabisystems.com>
* vax-tdep.c: Include regcache.h.
(vax_call_dummy_words): New.
(sizeof_vax_call_dummy_words): New.
(vax_fix_call_dummy): New function.
(vax_saved_pc_after_call): Ditto.
* config/vax/tm-vax.h: Don't include regcache.h.
(SAVED_PC_AFTER_CALL): Use vax_saved_pc_after_call.
(CALL_DUMMY): Remove.
(CALL_DUMMY_WORDS): Define.
(SIZEOF_CALL_DUMMY_WORDS): Define.
(FIX_CALL_DUMMY): Use vax_fix_call_dummy.
2002-04-18 Michael Snyder <msnyder@redhat.com> 2002-04-18 Michael Snyder <msnyder@redhat.com>
* arm-tdep.h: Change regnum defines to enums for ease of debugging. * arm-tdep.h: Change regnum defines to enums for ease of debugging.

View File

@ -19,25 +19,16 @@
Foundation, Inc., 59 Temple Place - Suite 330, Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
#include "regcache.h"
/* Offset from address of function to start of its code. /* Offset from address of function to start of its code.
Zero on most machines. */ Zero on most machines. */
#define FUNCTION_START_OFFSET 2 #define FUNCTION_START_OFFSET 2
/* Advance PC across any function entry prologue instructions
to reach some "real" code. */
extern CORE_ADDR vax_skip_prologue (CORE_ADDR); extern CORE_ADDR vax_skip_prologue (CORE_ADDR);
#define SKIP_PROLOGUE(pc) (vax_skip_prologue (pc)) #define SKIP_PROLOGUE(pc) (vax_skip_prologue (pc))
/* Immediately after a function call, return the saved pc. #define SAVED_PC_AFTER_CALL(frame) vax_saved_pc_after_call ((frame))
Can't always go through the frames for this because on some machines extern CORE_ADDR vax_saved_pc_after_call (struct frame_info *);
the new frame is not set up until the new function executes
some instructions. */
#define SAVED_PC_AFTER_CALL(frame) FRAME_SAVED_PC(frame)
#define TARGET_UPAGES 14 #define TARGET_UPAGES 14
#define TARGET_NBPG 512 #define TARGET_NBPG 512
@ -177,24 +168,23 @@ extern void vax_push_dummy_frame (void);
#define POP_FRAME vax_pop_frame() #define POP_FRAME vax_pop_frame()
extern void vax_pop_frame (void); extern void vax_pop_frame (void);
/* This sequence of words is the instructions #define CALL_DUMMY_WORDS vax_call_dummy_words
calls #69, @#32323232 extern LONGEST vax_call_dummy_words[];
bpt
Note this is 8 bytes. */
#define CALL_DUMMY {0x329f69fb, 0x03323232} #define SIZEOF_CALL_DUMMY_WORDS sizeof_vax_call_dummy_words
extern int sizeof_vax_call_dummy_words;
#define CALL_DUMMY_START_OFFSET 0 /* Start execution at beginning of dummy */ struct value;
#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
vax_fix_call_dummy ((dummyname), (pc), (fun), (nargs), (args), (type), \
(gcc_p))
extern void vax_fix_call_dummy (char *, CORE_ADDR, CORE_ADDR, int,
struct value **, struct type *, int);
#define CALL_DUMMY_START_OFFSET 0 /* Start execution at beginning of dummy */
#define CALL_DUMMY_BREAKPOINT_OFFSET 7 #define CALL_DUMMY_BREAKPOINT_OFFSET 7
/* Insert the specified number of args and function address
into a call sequence of the above form stored at DUMMYNAME. */
#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
{ *((char *) dummyname + 1) = nargs; \
*(int *)((char *) dummyname + 3) = fun; }
/* If vax pcc says CHAR or SHORT, it provides the correct address. */ /* If vax pcc says CHAR or SHORT, it provides the correct address. */
#define BELIEVE_PCC_PROMOTION 1 #define BELIEVE_PCC_PROMOTION 1

View File

@ -23,6 +23,7 @@
#include "symtab.h" #include "symtab.h"
#include "opcode/vax.h" #include "opcode/vax.h"
#include "gdbcore.h" #include "gdbcore.h"
#include "regcache.h"
#include "frame.h" #include "frame.h"
#include "value.h" #include "value.h"
@ -234,6 +235,24 @@ vax_pop_frame (void)
write_register (SP_REGNUM, fp); write_register (SP_REGNUM, fp);
flush_cached_frames (); flush_cached_frames ();
} }
/* The VAX call dummy sequence:
calls #69, @#32323232
bpt
It is 8 bytes long. The address and argc are patched by
vax_fix_call_dummy(). */
LONGEST vax_call_dummy_words[] = { 0x329f69fb, 0x03323232 };
int sizeof_vax_call_dummy_words = sizeof(vax_call_dummy_words);
void
vax_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs,
struct value **args, struct type *type, int gcc_p)
{
dummy[1] = nargs;
store_unsigned_integer (dummy + 3, 4, fun);
}
void void
vax_store_struct_return (CORE_ADDR addr, CORE_ADDR sp) vax_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
@ -288,7 +307,12 @@ vax_skip_prologue (CORE_ADDR pc)
return pc; return pc;
} }
CORE_ADDR
vax_saved_pc_after_call (struct frame_info *frame)
{
return (FRAME_SAVED_PC(frame));
}
/* Print the vax instruction at address MEMADDR in debugged memory, /* Print the vax instruction at address MEMADDR in debugged memory,
from disassembler info INFO. from disassembler info INFO.
Returns length of the instruction, in bytes. */ Returns length of the instruction, in bytes. */