1 // OBSOLETE /* Target-machine dependent code for Motorola 88000 series, for GDB.
3 // OBSOLETE Copyright 1988, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998,
4 // OBSOLETE 2000, 2001, 2002 Free Software Foundation, Inc.
6 // OBSOLETE This file is part of GDB.
8 // OBSOLETE This program is free software; you can redistribute it and/or modify
9 // OBSOLETE it under the terms of the GNU General Public License as published by
10 // OBSOLETE the Free Software Foundation; either version 2 of the License, or
11 // OBSOLETE (at your option) any later version.
13 // OBSOLETE This program is distributed in the hope that it will be useful,
14 // OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // OBSOLETE GNU General Public License for more details.
18 // OBSOLETE You should have received a copy of the GNU General Public License
19 // OBSOLETE along with this program; if not, write to the Free Software
20 // OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330,
21 // OBSOLETE Boston, MA 02111-1307, USA. */
23 // OBSOLETE #include "defs.h"
24 // OBSOLETE #include "frame.h"
25 // OBSOLETE #include "inferior.h"
26 // OBSOLETE #include "value.h"
27 // OBSOLETE #include "gdbcore.h"
28 // OBSOLETE #include "symtab.h"
29 // OBSOLETE #include "setjmp.h"
30 // OBSOLETE #include "value.h"
31 // OBSOLETE #include "regcache.h"
33 // OBSOLETE /* Size of an instruction */
34 // OBSOLETE #define BYTES_PER_88K_INSN 4
36 // OBSOLETE void frame_find_saved_regs ();
38 // OBSOLETE /* Is this target an m88110? Otherwise assume m88100. This has
39 // OBSOLETE relevance for the ways in which we screw with instruction pointers. */
41 // OBSOLETE int target_is_m88110 = 0;
44 // OBSOLETE m88k_target_write_pc (CORE_ADDR pc, ptid_t ptid)
46 // OBSOLETE /* According to the MC88100 RISC Microprocessor User's Manual,
47 // OBSOLETE section 6.4.3.1.2:
49 // OBSOLETE ... can be made to return to a particular instruction by placing
50 // OBSOLETE a valid instruction address in the SNIP and the next sequential
51 // OBSOLETE instruction address in the SFIP (with V bits set and E bits
52 // OBSOLETE clear). The rte resumes execution at the instruction pointed to
53 // OBSOLETE by the SNIP, then the SFIP.
55 // OBSOLETE The E bit is the least significant bit (bit 0). The V (valid)
56 // OBSOLETE bit is bit 1. This is why we logical or 2 into the values we are
57 // OBSOLETE writing below. It turns out that SXIP plays no role when
58 // OBSOLETE returning from an exception so nothing special has to be done
59 // OBSOLETE with it. We could even (presumably) give it a totally bogus
62 // OBSOLETE -- Kevin Buettner */
64 // OBSOLETE write_register_pid (SXIP_REGNUM, pc, ptid);
65 // OBSOLETE write_register_pid (SNIP_REGNUM, (pc | 2), ptid);
66 // OBSOLETE write_register_pid (SFIP_REGNUM, (pc | 2) + 4, ptid);
69 // OBSOLETE /* The type of a register. */
70 // OBSOLETE struct type *
71 // OBSOLETE m88k_register_type (int regnum)
73 // OBSOLETE if (regnum >= XFP_REGNUM)
74 // OBSOLETE return builtin_type_m88110_ext;
75 // OBSOLETE else if (regnum == PC_REGNUM || regnum == FP_REGNUM || regnum == SP_REGNUM)
76 // OBSOLETE return builtin_type_void_func_ptr;
78 // OBSOLETE return builtin_type_int32;
82 // OBSOLETE /* The m88k kernel aligns all instructions on 4-byte boundaries. The
83 // OBSOLETE kernel also uses the least significant two bits for its own hocus
84 // OBSOLETE pocus. When gdb receives an address from the kernel, it needs to
85 // OBSOLETE preserve those right-most two bits, but gdb also needs to be careful
86 // OBSOLETE to realize that those two bits are not really a part of the address
87 // OBSOLETE of an instruction. Shrug. */
90 // OBSOLETE m88k_addr_bits_remove (CORE_ADDR addr)
92 // OBSOLETE return ((addr) & ~3);
96 // OBSOLETE /* Given a GDB frame, determine the address of the calling function's frame.
97 // OBSOLETE This will be used to create a new GDB frame struct, and then
98 // OBSOLETE INIT_EXTRA_FRAME_INFO and INIT_FRAME_PC will be called for the new frame.
100 // OBSOLETE For us, the frame address is its stack pointer value, so we look up
101 // OBSOLETE the function prologue to determine the caller's sp value, and return it. */
103 // OBSOLETE CORE_ADDR
104 // OBSOLETE frame_chain (struct frame_info *thisframe)
107 // OBSOLETE frame_find_saved_regs (thisframe, (struct frame_saved_regs *) 0);
108 // OBSOLETE /* NOTE: this depends on frame_find_saved_regs returning the VALUE, not
109 // OBSOLETE the ADDRESS, of SP_REGNUM. It also depends on the cache of
110 // OBSOLETE frame_find_saved_regs results. */
111 // OBSOLETE if (thisframe->fsr->regs[SP_REGNUM])
112 // OBSOLETE return thisframe->fsr->regs[SP_REGNUM];
114 // OBSOLETE return thisframe->frame; /* Leaf fn -- next frame up has same SP. */
118 // OBSOLETE frameless_function_invocation (struct frame_info *frame)
121 // OBSOLETE frame_find_saved_regs (frame, (struct frame_saved_regs *) 0);
122 // OBSOLETE /* NOTE: this depends on frame_find_saved_regs returning the VALUE, not
123 // OBSOLETE the ADDRESS, of SP_REGNUM. It also depends on the cache of
124 // OBSOLETE frame_find_saved_regs results. */
125 // OBSOLETE if (frame->fsr->regs[SP_REGNUM])
126 // OBSOLETE return 0; /* Frameful -- return addr saved somewhere */
128 // OBSOLETE return 1; /* Frameless -- no saved return address */
132 // OBSOLETE init_extra_frame_info (int fromleaf, struct frame_info *frame)
134 // OBSOLETE frame->fsr = 0; /* Not yet allocated */
135 // OBSOLETE frame->args_pointer = 0; /* Unknown */
136 // OBSOLETE frame->locals_pointer = 0; /* Unknown */
139 // OBSOLETE /* Examine an m88k function prologue, recording the addresses at which
140 // OBSOLETE registers are saved explicitly by the prologue code, and returning
141 // OBSOLETE the address of the first instruction after the prologue (but not
142 // OBSOLETE after the instruction at address LIMIT, as explained below).
144 // OBSOLETE LIMIT places an upper bound on addresses of the instructions to be
145 // OBSOLETE examined. If the prologue code scan reaches LIMIT, the scan is
146 // OBSOLETE aborted and LIMIT is returned. This is used, when examining the
147 // OBSOLETE prologue for the current frame, to keep examine_prologue () from
148 // OBSOLETE claiming that a given register has been saved when in fact the
149 // OBSOLETE instruction that saves it has not yet been executed. LIMIT is used
150 // OBSOLETE at other times to stop the scan when we hit code after the true
151 // OBSOLETE function prologue (e.g. for the first source line) which might
152 // OBSOLETE otherwise be mistaken for function prologue.
154 // OBSOLETE The format of the function prologue matched by this routine is
155 // OBSOLETE derived from examination of the source to gcc 1.95, particularly
156 // OBSOLETE the routine output_prologue () in config/out-m88k.c.
158 // OBSOLETE subu r31,r31,n # stack pointer update
160 // OBSOLETE (st rn,r31,offset)? # save incoming regs
161 // OBSOLETE (st.d rn,r31,offset)?
163 // OBSOLETE (addu r30,r31,n)? # frame pointer update
165 // OBSOLETE (pic sequence)? # PIC code prologue
167 // OBSOLETE (or rn,rm,0)? # Move parameters to other regs
170 // OBSOLETE /* Macros for extracting fields from instructions. */
172 // OBSOLETE #define BITMASK(pos, width) (((0x1 << (width)) - 1) << (pos))
173 // OBSOLETE #define EXTRACT_FIELD(val, pos, width) ((val) >> (pos) & BITMASK (0, width))
174 // OBSOLETE #define SUBU_OFFSET(x) ((unsigned)(x & 0xFFFF))
175 // OBSOLETE #define ST_OFFSET(x) ((unsigned)((x) & 0xFFFF))
176 // OBSOLETE #define ST_SRC(x) EXTRACT_FIELD ((x), 21, 5)
177 // OBSOLETE #define ADDU_OFFSET(x) ((unsigned)(x & 0xFFFF))
180 // OBSOLETE * prologue_insn_tbl is a table of instructions which may comprise a
181 // OBSOLETE * function prologue. Associated with each table entry (corresponding
182 // OBSOLETE * to a single instruction or group of instructions), is an action.
183 // OBSOLETE * This action is used by examine_prologue (below) to determine
184 // OBSOLETE * the state of certain machine registers and where the stack frame lives.
187 // OBSOLETE enum prologue_insn_action
189 // OBSOLETE PIA_SKIP, /* don't care what the instruction does */
190 // OBSOLETE PIA_NOTE_ST, /* note register stored and where */
191 // OBSOLETE PIA_NOTE_STD, /* note pair of registers stored and where */
192 // OBSOLETE PIA_NOTE_SP_ADJUSTMENT, /* note stack pointer adjustment */
193 // OBSOLETE PIA_NOTE_FP_ASSIGNMENT, /* note frame pointer assignment */
194 // OBSOLETE PIA_NOTE_PROLOGUE_END, /* no more prologue */
197 // OBSOLETE struct prologue_insns
199 // OBSOLETE unsigned long insn;
200 // OBSOLETE unsigned long mask;
201 // OBSOLETE enum prologue_insn_action action;
204 // OBSOLETE struct prologue_insns prologue_insn_tbl[] =
206 // OBSOLETE /* Various register move instructions */
207 // OBSOLETE {0x58000000, 0xf800ffff, PIA_SKIP}, /* or/or.u with immed of 0 */
208 // OBSOLETE {0xf4005800, 0xfc1fffe0, PIA_SKIP}, /* or rd, r0, rs */
209 // OBSOLETE {0xf4005800, 0xfc00ffff, PIA_SKIP}, /* or rd, rs, r0 */
211 // OBSOLETE /* Stack pointer setup: "subu sp, sp, n" where n is a multiple of 8 */
212 // OBSOLETE {0x67ff0000, 0xffff0007, PIA_NOTE_SP_ADJUSTMENT},
214 // OBSOLETE /* Frame pointer assignment: "addu r30, r31, n" */
215 // OBSOLETE {0x63df0000, 0xffff0000, PIA_NOTE_FP_ASSIGNMENT},
217 // OBSOLETE /* Store to stack instructions; either "st rx, sp, n" or "st.d rx, sp, n" */
218 // OBSOLETE {0x241f0000, 0xfc1f0000, PIA_NOTE_ST}, /* st rx, sp, n */
219 // OBSOLETE {0x201f0000, 0xfc1f0000, PIA_NOTE_STD}, /* st.d rs, sp, n */
221 // OBSOLETE /* Instructions needed for setting up r25 for pic code. */
222 // OBSOLETE {0x5f200000, 0xffff0000, PIA_SKIP}, /* or.u r25, r0, offset_high */
223 // OBSOLETE {0xcc000002, 0xffffffff, PIA_SKIP}, /* bsr.n Lab */
224 // OBSOLETE {0x5b390000, 0xffff0000, PIA_SKIP}, /* or r25, r25, offset_low */
225 // OBSOLETE {0xf7396001, 0xffffffff, PIA_SKIP}, /* Lab: addu r25, r25, r1 */
227 // OBSOLETE /* Various branch or jump instructions which have a delay slot -- these
228 // OBSOLETE do not form part of the prologue, but the instruction in the delay
229 // OBSOLETE slot might be a store instruction which should be noted. */
230 // OBSOLETE {0xc4000000, 0xe4000000, PIA_NOTE_PROLOGUE_END},
231 // OBSOLETE /* br.n, bsr.n, bb0.n, or bb1.n */
232 // OBSOLETE {0xec000000, 0xfc000000, PIA_NOTE_PROLOGUE_END}, /* bcnd.n */
233 // OBSOLETE {0xf400c400, 0xfffff7e0, PIA_NOTE_PROLOGUE_END} /* jmp.n or jsr.n */
238 // OBSOLETE /* Fetch the instruction at ADDR, returning 0 if ADDR is beyond LIM or
239 // OBSOLETE is not the address of a valid instruction, the address of the next
240 // OBSOLETE instruction beyond ADDR otherwise. *PWORD1 receives the first word
241 // OBSOLETE of the instruction. */
243 // OBSOLETE #define NEXT_PROLOGUE_INSN(addr, lim, pword1) \
244 // OBSOLETE (((addr) < (lim)) ? next_insn (addr, pword1) : 0)
246 // OBSOLETE /* Read the m88k instruction at 'memaddr' and return the address of
247 // OBSOLETE the next instruction after that, or 0 if 'memaddr' is not the
248 // OBSOLETE address of a valid instruction. The instruction
249 // OBSOLETE is stored at 'pword1'. */
251 // OBSOLETE CORE_ADDR
252 // OBSOLETE next_insn (CORE_ADDR memaddr, unsigned long *pword1)
254 // OBSOLETE *pword1 = read_memory_integer (memaddr, BYTES_PER_88K_INSN);
255 // OBSOLETE return memaddr + BYTES_PER_88K_INSN;
258 // OBSOLETE /* Read a register from frames called by us (or from the hardware regs). */
260 // OBSOLETE static int
261 // OBSOLETE read_next_frame_reg (struct frame_info *frame, int regno)
263 // OBSOLETE for (; frame; frame = frame->next)
265 // OBSOLETE if (regno == SP_REGNUM)
266 // OBSOLETE return FRAME_FP (frame);
267 // OBSOLETE else if (frame->fsr->regs[regno])
268 // OBSOLETE return read_memory_integer (frame->fsr->regs[regno], 4);
270 // OBSOLETE return read_register (regno);
273 // OBSOLETE /* Examine the prologue of a function. `ip' points to the first instruction.
274 // OBSOLETE `limit' is the limit of the prologue (e.g. the addr of the first
275 // OBSOLETE linenumber, or perhaps the program counter if we're stepping through).
276 // OBSOLETE `frame_sp' is the stack pointer value in use in this frame.
277 // OBSOLETE `fsr' is a pointer to a frame_saved_regs structure into which we put
278 // OBSOLETE info about the registers saved by this frame.
279 // OBSOLETE `fi' is a struct frame_info pointer; we fill in various fields in it
280 // OBSOLETE to reflect the offsets of the arg pointer and the locals pointer. */
282 // OBSOLETE static CORE_ADDR
283 // OBSOLETE examine_prologue (register CORE_ADDR ip, register CORE_ADDR limit,
284 // OBSOLETE CORE_ADDR frame_sp, struct frame_saved_regs *fsr,
285 // OBSOLETE struct frame_info *fi)
287 // OBSOLETE register CORE_ADDR next_ip;
288 // OBSOLETE register int src;
289 // OBSOLETE unsigned long insn;
290 // OBSOLETE int size, offset;
291 // OBSOLETE char must_adjust[32]; /* If set, must adjust offsets in fsr */
292 // OBSOLETE int sp_offset = -1; /* -1 means not set (valid must be mult of 8) */
293 // OBSOLETE int fp_offset = -1; /* -1 means not set */
294 // OBSOLETE CORE_ADDR frame_fp;
295 // OBSOLETE CORE_ADDR prologue_end = 0;
297 // OBSOLETE memset (must_adjust, '\0', sizeof (must_adjust));
298 // OBSOLETE next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn);
300 // OBSOLETE while (next_ip)
302 // OBSOLETE struct prologue_insns *pip;
304 // OBSOLETE for (pip = prologue_insn_tbl; (insn & pip->mask) != pip->insn;)
305 // OBSOLETE if (++pip >= prologue_insn_tbl + sizeof prologue_insn_tbl)
306 // OBSOLETE goto end_of_prologue_found; /* not a prologue insn */
308 // OBSOLETE switch (pip->action)
310 // OBSOLETE case PIA_NOTE_ST:
311 // OBSOLETE case PIA_NOTE_STD:
312 // OBSOLETE if (sp_offset != -1)
314 // OBSOLETE src = ST_SRC (insn);
315 // OBSOLETE offset = ST_OFFSET (insn);
316 // OBSOLETE must_adjust[src] = 1;
317 // OBSOLETE fsr->regs[src++] = offset; /* Will be adjusted later */
318 // OBSOLETE if (pip->action == PIA_NOTE_STD && src < 32)
320 // OBSOLETE offset += 4;
321 // OBSOLETE must_adjust[src] = 1;
322 // OBSOLETE fsr->regs[src++] = offset;
326 // OBSOLETE goto end_of_prologue_found;
328 // OBSOLETE case PIA_NOTE_SP_ADJUSTMENT:
329 // OBSOLETE if (sp_offset == -1)
330 // OBSOLETE sp_offset = -SUBU_OFFSET (insn);
332 // OBSOLETE goto end_of_prologue_found;
334 // OBSOLETE case PIA_NOTE_FP_ASSIGNMENT:
335 // OBSOLETE if (fp_offset == -1)
336 // OBSOLETE fp_offset = ADDU_OFFSET (insn);
338 // OBSOLETE goto end_of_prologue_found;
340 // OBSOLETE case PIA_NOTE_PROLOGUE_END:
341 // OBSOLETE if (!prologue_end)
342 // OBSOLETE prologue_end = ip;
344 // OBSOLETE case PIA_SKIP:
346 // OBSOLETE /* Do nothing */
350 // OBSOLETE ip = next_ip;
351 // OBSOLETE next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn);
354 // OBSOLETE end_of_prologue_found:
356 // OBSOLETE if (prologue_end)
357 // OBSOLETE ip = prologue_end;
359 // OBSOLETE /* We're done with the prologue. If we don't care about the stack
360 // OBSOLETE frame itself, just return. (Note that fsr->regs has been trashed,
361 // OBSOLETE but the one caller who calls with fi==0 passes a dummy there.) */
363 // OBSOLETE if (fi == 0)
364 // OBSOLETE return ip;
367 // OBSOLETE OK, now we have:
369 // OBSOLETE sp_offset original (before any alloca calls) displacement of SP
370 // OBSOLETE (will be negative).
372 // OBSOLETE fp_offset displacement from original SP to the FP for this frame
375 // OBSOLETE fsr->regs[0..31] displacement from original SP to the stack
376 // OBSOLETE location where reg[0..31] is stored.
378 // OBSOLETE must_adjust[0..31] set if corresponding offset was set.
380 // OBSOLETE If alloca has been called between the function prologue and the current
381 // OBSOLETE IP, then the current SP (frame_sp) will not be the original SP as set by
382 // OBSOLETE the function prologue. If the current SP is not the original SP, then the
383 // OBSOLETE compiler will have allocated an FP for this frame, fp_offset will be set,
384 // OBSOLETE and we can use it to calculate the original SP.
386 // OBSOLETE Then, we figure out where the arguments and locals are, and relocate the
387 // OBSOLETE offsets in fsr->regs to absolute addresses. */
389 // OBSOLETE if (fp_offset != -1)
391 // OBSOLETE /* We have a frame pointer, so get it, and base our calc's on it. */
392 // OBSOLETE frame_fp = (CORE_ADDR) read_next_frame_reg (fi->next, ACTUAL_FP_REGNUM);
393 // OBSOLETE frame_sp = frame_fp - fp_offset;
397 // OBSOLETE /* We have no frame pointer, therefore frame_sp is still the same value
398 // OBSOLETE as set by prologue. But where is the frame itself? */
399 // OBSOLETE if (must_adjust[SRP_REGNUM])
401 // OBSOLETE /* Function header saved SRP (r1), the return address. Frame starts
402 // OBSOLETE 4 bytes down from where it was saved. */
403 // OBSOLETE frame_fp = frame_sp + fsr->regs[SRP_REGNUM] - 4;
404 // OBSOLETE fi->locals_pointer = frame_fp;
408 // OBSOLETE /* Function header didn't save SRP (r1), so we are in a leaf fn or
409 // OBSOLETE are otherwise confused. */
410 // OBSOLETE frame_fp = -1;
414 // OBSOLETE /* The locals are relative to the FP (whether it exists as an allocated
415 // OBSOLETE register, or just as an assumed offset from the SP) */
416 // OBSOLETE fi->locals_pointer = frame_fp;
418 // OBSOLETE /* The arguments are just above the SP as it was before we adjusted it
419 // OBSOLETE on entry. */
420 // OBSOLETE fi->args_pointer = frame_sp - sp_offset;
422 // OBSOLETE /* Now that we know the SP value used by the prologue, we know where
423 // OBSOLETE it saved all the registers. */
424 // OBSOLETE for (src = 0; src < 32; src++)
425 // OBSOLETE if (must_adjust[src])
426 // OBSOLETE fsr->regs[src] += frame_sp;
428 // OBSOLETE /* The saved value of the SP is always known. */
429 // OBSOLETE /* (we hope...) */
430 // OBSOLETE if (fsr->regs[SP_REGNUM] != 0
431 // OBSOLETE && fsr->regs[SP_REGNUM] != frame_sp - sp_offset)
432 // OBSOLETE fprintf_unfiltered (gdb_stderr, "Bad saved SP value %lx != %lx, offset %x!\n",
433 // OBSOLETE fsr->regs[SP_REGNUM],
434 // OBSOLETE frame_sp - sp_offset, sp_offset);
436 // OBSOLETE fsr->regs[SP_REGNUM] = frame_sp - sp_offset;
438 // OBSOLETE return (ip);
441 // OBSOLETE /* Given an ip value corresponding to the start of a function,
442 // OBSOLETE return the ip of the first instruction after the function
443 // OBSOLETE prologue. */
445 // OBSOLETE CORE_ADDR
446 // OBSOLETE m88k_skip_prologue (CORE_ADDR ip)
448 // OBSOLETE struct frame_saved_regs saved_regs_dummy;
449 // OBSOLETE struct symtab_and_line sal;
450 // OBSOLETE CORE_ADDR limit;
452 // OBSOLETE sal = find_pc_line (ip, 0);
453 // OBSOLETE limit = (sal.end) ? sal.end : 0xffffffff;
455 // OBSOLETE return (examine_prologue (ip, limit, (CORE_ADDR) 0, &saved_regs_dummy,
456 // OBSOLETE (struct frame_info *) 0));
459 // OBSOLETE /* Put here the code to store, into a struct frame_saved_regs,
460 // OBSOLETE the addresses of the saved registers of frame described by FRAME_INFO.
461 // OBSOLETE This includes special registers such as pc and fp saved in special
462 // OBSOLETE ways in the stack frame. sp is even more special:
463 // OBSOLETE the address we return for it IS the sp for the next frame.
465 // OBSOLETE We cache the result of doing this in the frame_obstack, since it is
466 // OBSOLETE fairly expensive. */
469 // OBSOLETE frame_find_saved_regs (struct frame_info *fi, struct frame_saved_regs *fsr)
471 // OBSOLETE register struct frame_saved_regs *cache_fsr;
472 // OBSOLETE CORE_ADDR ip;
473 // OBSOLETE struct symtab_and_line sal;
474 // OBSOLETE CORE_ADDR limit;
476 // OBSOLETE if (!fi->fsr)
478 // OBSOLETE cache_fsr = (struct frame_saved_regs *)
479 // OBSOLETE frame_obstack_alloc (sizeof (struct frame_saved_regs));
480 // OBSOLETE memset (cache_fsr, '\0', sizeof (struct frame_saved_regs));
481 // OBSOLETE fi->fsr = cache_fsr;
483 // OBSOLETE /* Find the start and end of the function prologue. If the PC
484 // OBSOLETE is in the function prologue, we only consider the part that
485 // OBSOLETE has executed already. In the case where the PC is not in
486 // OBSOLETE the function prologue, we set limit to two instructions beyond
487 // OBSOLETE where the prologue ends in case if any of the prologue instructions
488 // OBSOLETE were moved into a delay slot of a branch instruction. */
490 // OBSOLETE ip = get_pc_function_start (fi->pc);
491 // OBSOLETE sal = find_pc_line (ip, 0);
492 // OBSOLETE limit = (sal.end && sal.end < fi->pc) ? sal.end + 2 * BYTES_PER_88K_INSN
493 // OBSOLETE : fi->pc;
495 // OBSOLETE /* This will fill in fields in *fi as well as in cache_fsr. */
496 // OBSOLETE #ifdef SIGTRAMP_FRAME_FIXUP
497 // OBSOLETE if (fi->signal_handler_caller)
498 // OBSOLETE SIGTRAMP_FRAME_FIXUP (fi->frame);
500 // OBSOLETE examine_prologue (ip, limit, fi->frame, cache_fsr, fi);
501 // OBSOLETE #ifdef SIGTRAMP_SP_FIXUP
502 // OBSOLETE if (fi->signal_handler_caller && fi->fsr->regs[SP_REGNUM])
503 // OBSOLETE SIGTRAMP_SP_FIXUP (fi->fsr->regs[SP_REGNUM]);
508 // OBSOLETE *fsr = *fi->fsr;
511 // OBSOLETE /* Return the address of the locals block for the frame
512 // OBSOLETE described by FI. Returns 0 if the address is unknown.
513 // OBSOLETE NOTE! Frame locals are referred to by negative offsets from the
514 // OBSOLETE argument pointer, so this is the same as frame_args_address(). */
516 // OBSOLETE CORE_ADDR
517 // OBSOLETE frame_locals_address (struct frame_info *fi)
519 // OBSOLETE struct frame_saved_regs fsr;
521 // OBSOLETE if (fi->args_pointer) /* Cached value is likely there. */
522 // OBSOLETE return fi->args_pointer;
524 // OBSOLETE /* Nope, generate it. */
526 // OBSOLETE get_frame_saved_regs (fi, &fsr);
528 // OBSOLETE return fi->args_pointer;
531 // OBSOLETE /* Return the address of the argument block for the frame
532 // OBSOLETE described by FI. Returns 0 if the address is unknown. */
534 // OBSOLETE CORE_ADDR
535 // OBSOLETE frame_args_address (struct frame_info *fi)
537 // OBSOLETE struct frame_saved_regs fsr;
539 // OBSOLETE if (fi->args_pointer) /* Cached value is likely there. */
540 // OBSOLETE return fi->args_pointer;
542 // OBSOLETE /* Nope, generate it. */
544 // OBSOLETE get_frame_saved_regs (fi, &fsr);
546 // OBSOLETE return fi->args_pointer;
549 // OBSOLETE /* Return the saved PC from this frame.
551 // OBSOLETE If the frame has a memory copy of SRP_REGNUM, use that. If not,
552 // OBSOLETE just use the register SRP_REGNUM itself. */
554 // OBSOLETE CORE_ADDR
555 // OBSOLETE frame_saved_pc (struct frame_info *frame)
557 // OBSOLETE return read_next_frame_reg (frame, SRP_REGNUM);
561 // OBSOLETE #define DUMMY_FRAME_SIZE 192
563 // OBSOLETE static void
564 // OBSOLETE write_word (CORE_ADDR sp, ULONGEST word)
566 // OBSOLETE register int len = REGISTER_SIZE;
567 // OBSOLETE char buffer[MAX_REGISTER_RAW_SIZE];
569 // OBSOLETE store_unsigned_integer (buffer, len, word);
570 // OBSOLETE write_memory (sp, buffer, len);
574 // OBSOLETE m88k_push_dummy_frame (void)
576 // OBSOLETE register CORE_ADDR sp = read_register (SP_REGNUM);
577 // OBSOLETE register int rn;
578 // OBSOLETE int offset;
580 // OBSOLETE sp -= DUMMY_FRAME_SIZE; /* allocate a bunch of space */
582 // OBSOLETE for (rn = 0, offset = 0; rn <= SP_REGNUM; rn++, offset += 4)
583 // OBSOLETE write_word (sp + offset, read_register (rn));
585 // OBSOLETE write_word (sp + offset, read_register (SXIP_REGNUM));
586 // OBSOLETE offset += 4;
588 // OBSOLETE write_word (sp + offset, read_register (SNIP_REGNUM));
589 // OBSOLETE offset += 4;
591 // OBSOLETE write_word (sp + offset, read_register (SFIP_REGNUM));
592 // OBSOLETE offset += 4;
594 // OBSOLETE write_word (sp + offset, read_register (PSR_REGNUM));
595 // OBSOLETE offset += 4;
597 // OBSOLETE write_word (sp + offset, read_register (FPSR_REGNUM));
598 // OBSOLETE offset += 4;
600 // OBSOLETE write_word (sp + offset, read_register (FPCR_REGNUM));
601 // OBSOLETE offset += 4;
603 // OBSOLETE write_register (SP_REGNUM, sp);
604 // OBSOLETE write_register (ACTUAL_FP_REGNUM, sp);
608 // OBSOLETE pop_frame (void)
610 // OBSOLETE register struct frame_info *frame = get_current_frame ();
611 // OBSOLETE register int regnum;
612 // OBSOLETE struct frame_saved_regs fsr;
614 // OBSOLETE get_frame_saved_regs (frame, &fsr);
616 // OBSOLETE if (PC_IN_CALL_DUMMY (read_pc (), read_register (SP_REGNUM), frame->frame))
618 // OBSOLETE /* FIXME: I think get_frame_saved_regs should be handling this so
619 // OBSOLETE that we can deal with the saved registers properly (e.g. frame
620 // OBSOLETE 1 is a call dummy, the user types "frame 2" and then "print $ps"). */
621 // OBSOLETE register CORE_ADDR sp = read_register (ACTUAL_FP_REGNUM);
622 // OBSOLETE int offset;
624 // OBSOLETE for (regnum = 0, offset = 0; regnum <= SP_REGNUM; regnum++, offset += 4)
625 // OBSOLETE (void) write_register (regnum, read_memory_integer (sp + offset, 4));
627 // OBSOLETE write_register (SXIP_REGNUM, read_memory_integer (sp + offset, 4));
628 // OBSOLETE offset += 4;
630 // OBSOLETE write_register (SNIP_REGNUM, read_memory_integer (sp + offset, 4));
631 // OBSOLETE offset += 4;
633 // OBSOLETE write_register (SFIP_REGNUM, read_memory_integer (sp + offset, 4));
634 // OBSOLETE offset += 4;
636 // OBSOLETE write_register (PSR_REGNUM, read_memory_integer (sp + offset, 4));
637 // OBSOLETE offset += 4;
639 // OBSOLETE write_register (FPSR_REGNUM, read_memory_integer (sp + offset, 4));
640 // OBSOLETE offset += 4;
642 // OBSOLETE write_register (FPCR_REGNUM, read_memory_integer (sp + offset, 4));
643 // OBSOLETE offset += 4;
648 // OBSOLETE for (regnum = FP_REGNUM; regnum > 0; regnum--)
649 // OBSOLETE if (fsr.regs[regnum])
650 // OBSOLETE write_register (regnum,
651 // OBSOLETE read_memory_integer (fsr.regs[regnum], 4));
652 // OBSOLETE write_pc (frame_saved_pc (frame));
654 // OBSOLETE reinit_frame_cache ();
658 // OBSOLETE _initialize_m88k_tdep (void)
660 // OBSOLETE tm_print_insn = print_insn_m88k;
This page took 0.042316 seconds and 4 git commands to generate.