diff options
author | Stu Grossman <grossman@cygnus> | 1992-05-07 17:47:36 +0000 |
---|---|---|
committer | Stu Grossman <grossman@cygnus> | 1992-05-07 17:47:36 +0000 |
commit | d0b04c6a38747e1b84b36b341e1a9036519ef89a (patch) | |
tree | bc5e24604911cbc1c3628f8a4d565c984aed905c /gdb/tm-29k.h | |
parent | d24fbb206e83b60f17aa145ebc5196a9127715e6 (diff) | |
download | gdb-d0b04c6a38747e1b84b36b341e1a9036519ef89a.zip gdb-d0b04c6a38747e1b84b36b341e1a9036519ef89a.tar.gz gdb-d0b04c6a38747e1b84b36b341e1a9036519ef89a.tar.bz2 |
* am29k-pinsn.c: Use new opcode table in "opcode/a29k.h".
* am29k-tdep.c: Update to latest code from AMD.
(get_saved_register) don't crap out if no frame.
* remote-udi.c: Set/clear inferior_pid as appropriate.
(udi_open) call target_preopen, don't close fd 0!!!, clean up
error handling. Fixup end-of-debugging messages.
(udi_fetch_registers) clean up big time, mainly don't multiply
register_valid indices by 4, and use proper Offset when reading
gr96-gr127. (udi_store_registers) general cleanup.
(fetch_register) cleanup, simplify. (regnum_to_srnum)
INT_REGNUM->INTE_REGNUM.
* tm-29k.h: Upgrade to latest code from AMD.
* 29k-share/udi/udip2soc.c: Get rid of useless errmsg_m macro.
(UDIConnect) Clean up error processing (like, don't do exit() if
execlp fails), make code restartable, make more attractive.
(UDIStop) Use SIGINT instead of SIGUSR1, as isstip won't stop
otherwise.
Diffstat (limited to 'gdb/tm-29k.h')
-rw-r--r-- | gdb/tm-29k.h | 101 |
1 files changed, 61 insertions, 40 deletions
diff --git a/gdb/tm-29k.h b/gdb/tm-29k.h index 2718061..72e4d98 100644 --- a/gdb/tm-29k.h +++ b/gdb/tm-29k.h @@ -147,9 +147,18 @@ CORE_ADDR skip_prologue (); "AI10", "AI11", "AI12", "AI13", "AI14", "AI15", "FP", \ "bp", "fc", "cr", "q", \ "vab", "ops", "cps", "cfg", "cha", "chd", "chc", "rbp", "tmc", "tmr", \ - "pc0", "pc1", "pc2", "mmu", "lru", "fpe", "int", "fps", "exo", "gr1", \ + "pc0", "pc1", "pc2", "mmu", "lru", "fpe", "inte", "fps", "exo", "gr1", \ "alu", "ipc", "ipa", "ipb" } +/* + * Provide the processor register numbers of some registers that are + * expected/written in instructions that might change under different + * register sets. Namely, gcc can compile (-mkernel-registers) so that + * it uses gr64-gr95 in stead of gr96-gr127. + */ +#define MSP_HW_REGNUM 125 /* gr125 */ +#define RAB_HW_REGNUM 126 /* gr126 */ + /* Convert Processor Special register #x to REGISTER_NAMES register # */ #define SR_REGNUM(x) \ ((x) < 15 ? VAB_REGNUM + (x) \ @@ -202,7 +211,7 @@ CORE_ADDR skip_prologue (); #define MMU_REGNUM (VAB_REGNUM + 13) #define LRU_REGNUM (VAB_REGNUM + 14) #define FPE_REGNUM (VAB_REGNUM + 15) -#define INT_REGNUM (VAB_REGNUM + 16) +#define INTE_REGNUM (VAB_REGNUM + 16) #define FPS_REGNUM (VAB_REGNUM + 17) #define EXO_REGNUM (VAB_REGNUM + 18) /* gr1 is defined above as 200 = VAB_REGNUM + 19 */ @@ -422,17 +431,22 @@ long read_register_stack_integer (); #define EXTRA_FRAME_INFO \ CORE_ADDR saved_msp; \ unsigned int rsize; \ - unsigned int msize; + unsigned int msize; \ + unsigned char flags; + +/* Bits for flags in EXTRA_FRAME_INFO */ +#define TRANSPARENT 0x1 /* This is a transparent frame */ +#define MFP_USED 0x2 /* A memory frame pointer is used */ /* Because INIT_FRAME_PC gets passed fromleaf, that's where we init not only ->pc and ->frame, but all the extra stuff, when called from get_prev_frame_info, that is. */ -#define INIT_EXTRA_FRAME_INFO(fromleaf, fci) \ - init_extra_frame_info(fci); +#define INIT_EXTRA_FRAME_INFO(fromleaf, fci) init_extra_frame_info(fci) void init_extra_frame_info (); -#define INIT_FRAME_PC(fromleaf, fci) \ - init_frame_pc(fromleaf, fci); + +#define INIT_FRAME_PC(fromleaf, fci) init_frame_pc(fromleaf, fci) void init_frame_pc (); + /* FRAME_CHAIN takes a FRAME and produces the frame's chain-pointer. @@ -451,15 +465,16 @@ void init_frame_pc (); /* These are mostly dummies for the 29k because INIT_FRAME_PC sets prev->frame instead. */ -#define FRAME_CHAIN(thisframe) (0) +#define FRAME_CHAIN(thisframe) ((thisframe)->frame + (thisframe)->rsize) + +/* Determine if the frame has a 'previous' and back-traceable frame. */ +#define FRAME_IS_UNCHAINED(frame) ((frame)->flags & TRANSPARENT) -/* Not sure how to figure out where the bottom frame is. There is - no frame for start. In my tests so far the - pc has been outside the text segment, though, so check for that. - FIXME!!! - However, allow a pc in a call dummy. */ -#define FRAME_CHAIN_VALID(chain, thisframe) \ - (!inside_entry_file (FRAME_SAVED_PC (thisframe))) +/* Find the previous frame of a transparent routine. + * For now lets not try and trace through a transparent routine (we might + * have to assume that all transparent routines are traps). + */ +#define FIND_PREV_UNCHAINED_FRAME(frame) 0 /* Define other aspects of the stack frame. */ @@ -517,20 +532,20 @@ extern CORE_ADDR frame_locals_address (); | | We must not disturb | args_out_sproc | it. memory stack |________________| - |____lr1_sproc___| - | | |__retaddr_sproc_| <- gr1 (at start) - |____________|<-msp 0 <-----------mfp_dummy_____| - | | (at start) | | - | arg_slop | | saved regs | - | (16 words) | | gr96-gr124 | - |____________|<-msp 1--after | sr128-sr135 | - | | PUSH_DUMMY_FRAME| | - | struct ret | |________________| - | 17+ | | | - |____________|<- lrp | args_out_dummy | - | struct ret | | (16 words) | - | 16 | |________________| - | (16 words) | |____lr1_dummy___| + |____lr1_sproc___|<-+ + | | |__retaddr_sproc_| | <-- gr1 (at start) + |____________|<-msp 0 <-----------mfp_dummy_____| | + | | (at start) | save regs | | + | arg_slop | | pc0,pc1 | | + | (16 words) | | gr96-gr124 | | + |____________|<-msp 1--after | sr160-sr162 | | + | | PUSH_DUMMY_FRAME| sr128-sr135 | | + | struct ret | |________________| | + | 17+ | | | | + |____________|<- lrp | args_out_dummy | | + | struct ret | | (16 words) | | + | 16 | |________________| | + | (16 words) | |____lr1_dummy___|--+ |____________|<- msp 2--after |_retaddr_dummy__|<- gr1 after | | struct ret | | PUSH_DUMMY_FRAME | margs17+ | area allocated | locals_inf | @@ -562,25 +577,29 @@ extern CORE_ADDR frame_locals_address (); /* Number of special registers (sr128-) to save. */ #define DUMMY_SAVE_SR128 8 +/* Number of special registers (sr160-) to save. */ +#define DUMMY_SAVE_SR160 3 /* Number of general (gr96- or gr64-) registers to save. */ #define DUMMY_SAVE_GREGS 29 #define DUMMY_FRAME_RSIZE \ -(4 /* mfp_dummy */ \ - + DUMMY_SAVE_GREGS * 4 \ - + DUMMY_SAVE_SR128 * 4 \ - + DUMMY_ARG \ +(4 /* mfp_dummy */ \ + + 2 * 4 /* pc0, pc1 */ \ + + DUMMY_SAVE_GREGS * 4 \ + + DUMMY_SAVE_SR160 * 4 \ + + DUMMY_SAVE_SR128 * 4 \ + + DUMMY_ARG \ ) /* Push an empty stack frame, to record the current PC, etc. */ -#define PUSH_DUMMY_FRAME push_dummy_frame(); +#define PUSH_DUMMY_FRAME push_dummy_frame() extern void push_dummy_frame (); /* Discard from the stack the innermost frame, restoring all saved registers. */ -#define POP_FRAME pop_frame (); +#define POP_FRAME pop_frame() extern void pop_frame (); /* This sequence of words is the instructions @@ -588,9 +607,9 @@ extern void pop_frame (); loadm 0, 0, lr2, msp ; load first 16 words of arguments into registers add msp, msp, 16 * 4 ; point to the remaining arguments CONST_INSN: - const gr96,inf - consth gr96,inf - calli lr0, gr96 + const lr0,inf + consth lr0,inf + calli lr0, lr0 aseq 0x40,gr1,gr1 ; nop asneq 0x50,gr1,gr1 ; breakpoint */ @@ -598,8 +617,10 @@ extern void pop_frame (); /* Position of the "const" instruction within CALL_DUMMY in bytes. */ #define CONST_INSN (3 * 4) #if TARGET_BYTE_ORDER == HOST_BYTE_ORDER -#define CALL_DUMMY {0x0400870f, 0x3600827d, 0x157d7d40, 0x03ff60ff, \ - 0x02ff60ff, 0xc8008060, 0x70400101, 0x72500101} +#define CALL_DUMMY {0x0400870f,\ + 0x36008200|(MSP_HW_REGNUM), \ + 0x15000040|(MSP_HW_REGNUM<<8)|(MSP_HW_REGNUM<<16), \ + 0x03ff80ff, 0x02ff80ff, 0xc8008080, 0x70400101, 0x72500101} #else /* Byte order differs. */ you lose #endif /* Byte order differs. */ |