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