1 /* Target-dependent code for GDB, the GNU debugger.
2 Copyright (C) 1986, 1987, 1989, 1991 Free Software Foundation, Inc.
4 This file is part of GDB.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
28 #include <sys/param.h>
32 #include <sys/ioctl.h>
35 #include <sys/ptrace.h>
44 extern int attach_flag;
46 /* Nonzero if we just simulated a single step break. */
51 /* This is Damon's implementation of single step simulation. It suffers the
57 4 strcmp (buf, "test"); puts ("test");
61 You cannot `next' on line 4 in the above program. gdb puts a breakpoint
62 to the return address of `strcmp', and when execution arrives that point,
63 it is still in the line range and gdb attemps to resume it with single
64 steps. At that point the breakpoint at step_resume_break_address (return
65 address of strcmp) and single step's breakpoint mixes up and we end up
66 with a breakpoint which its shadow and itself are identical.
68 Fix that problem and use this version. FIXMEmgo.
72 static struct sstep_breaks {
79 * branch_dest - calculate all places the current instruction may go
83 register struct sstep_breaks *tb;
85 register ulong opcode, iar;
87 int immediate, absolute;;
89 iar = read_pc(); /* current IAR */
90 target_read_memory(iar, &instr, sizeof (instr)); /* current inst */
98 case 0x10: /* branch conditional */
99 immediate = ((instr & ~3) << 16) >> 16;
102 * two possible locations for next instruction
104 tb[0].address = iar + 4;
105 tb[1].address = immediate + (absolute ? 0 : iar);
109 case 0x12: /* branch unconditional */
110 immediate = ((instr & ~3) << 6) >> 6;
113 * only one possible location for next instr
115 tb[0].address = immediate + (absolute ? 0 : iar);
119 case 0x13: /* branch conditional register */
121 * WE NEED TO CHECK THE CR HERE, TO SEE IF THIS IS
122 * REALLY UNCONDITIONAL.
124 tb++->address = iar + 4;
126 switch ((instr >> 1) & 0x3ff) {
127 case 0x10: /* branch conditional register */
128 tb->address = read_register(LR_REGNUM) & ~3;
129 sigtramp_chk(tb); /* return from sig handler? */
132 case 0x210: /* branch cond to CTR */
133 tb->address = read_register(CTR_REGNUM) & ~3;
134 sigtramp_chk(tb); /* return from sig handler? */
141 tb->address = iar + 4;
148 * not a branch, flow proceeds normally
150 tb->address = iar + 4;
156 * sigtramp_chk - heuristic check to see if we think we are returning
157 * from a signal handler.
160 * tb - ^ to a single step branch location
163 * When we are at the "br" instruction returning to a signal handler,
164 * we return in user mode to an address in the kernel. If the
165 * segment of the branch target is 0, we may very well be in a
166 * signal handler. From scrounging through this code, we note that
167 * register 29 has the signal context pointer, from which we can
168 * determine where we will end up next.
171 register struct sstep_breaks *tb; {
172 struct sigcontext sc;
174 if (tb->address & 0xf0000000)
175 return; /* can't have been sigtramp */
177 if (target_read_memory(read_register(GPR29), &sc, sizeof (sc)))
178 return; /* read fails, heuristic fails */
180 if ((sc.sc_jmpbuf.jmp_context.iar & 0xf0000000) == 0x10000000) {
182 * looks like it might be ok.....
184 tb->address = sc.sc_jmpbuf.jmp_context.iar;
190 * single_step - no trace mode harware support, or software support.
193 single_step(signal) {
198 * need to set breakpoints for single step.
199 * figure out all places the current instruction could go.
201 branch_dest(&tbreak[0]);
204 * always at least one place to go to
206 target_insert_breakpoint(tbreak[0].address, &tbreak[0].data);
209 * if there is another possible location, set a breakpoint there
212 if (tbreak[1].address != -1)
213 target_insert_breakpoint(tbreak[1].address, &tbreak[1].data);
216 ptrace(PT_CONTINUE, inferior_pid, 1, signal, 0);
219 * need to clear the breakpoints.
221 for (i = 0; i < 2; ++i)
222 if (tbreak[i].address != -1)
223 target_remove_breakpoint(tbreak[i].address, &tbreak[i].data);
231 #else /* !DAMON'S VERSION */
233 /* Breakpoint shadows for the single step instructions will be kept here. */
235 static struct sstep_breaks {
242 * Calculate the destination of a branch/jump. Return -1 if not a branch.
245 branch_dest (opcode, instr, pc, safety)
246 int opcode, instr, pc, safety;
248 register long offset;
254 absolute = (int) ((instr >> 1) & 1);
258 immediate = ((instr & ~3) << 6) >> 6; /* br unconditionl */
261 if (opcode != 18) /* br conditional */
262 immediate = ((instr & ~3) << 16) >> 16;
266 dest = pc + immediate;
270 ext_op = (instr>>1) & 0x3ff;
272 if (ext_op == 16) /* br conditional register */
273 dest = read_register (LR_REGNUM) & ~3;
275 else if (ext_op == 528) /* br cond to count reg */
276 dest = read_register (CTR_REGNUM) & ~3;
283 return (dest < 0x10000000) ? safety : dest;
288 /* AIX does not support PT_STEP. Simulate it. */
294 #define INSNLEN(OPCODE) 4
296 static char breakp[] = BREAKPOINT;
297 int ii, insn, ret, loc;
298 int breaks[2], opcode;
301 extern CORE_ADDR text_start;
304 ret = read_memory (loc, &insn, sizeof (int));
306 printf ("Error in single_step()!!\n");
308 breaks[0] = loc + INSNLEN(insn);
310 breaks[1] = branch_dest (opcode, insn, loc, breaks[0]);
312 stepBreaks[1].address = -1;
314 for (ii=0; ii < 2; ++ii) {
316 /* ignore invalid breakpoint. */
317 if ( breaks[ii] == -1)
320 read_memory (breaks[ii], &(stepBreaks[ii].data), sizeof(int));
322 ret = write_memory (breaks[ii], breakp, sizeof(int));
323 stepBreaks[ii].address = breaks[ii];
327 ptrace (PT_CONTINUE, inferior_pid, 1, signal);
331 /* remove step breakpoints. */
332 for (ii=0; ii < 2; ++ii)
333 if (stepBreaks[ii].address != -1)
335 (stepBreaks[ii].address, &(stepBreaks[ii].data), sizeof(int));
341 #endif /* !DAMON's version of single step. */
345 /* return pc value after skipping a function prologue. */
353 if (target_read_memory (pc, (char *)&op, sizeof (op)))
354 return pc; /* Can't access it -- assume no prologue. */
355 SWAP_TARGET_AND_HOST (&op, sizeof (op));
357 /* Assume that subsequent fetches can fail with low probability. */
359 if (op == 0x7c0802a6) { /* mflr r0 */
361 op = read_memory_integer (pc, 4);
363 else /* else, this is a frameless invocation */
366 if ((op & 0xfc00003e) == 0x7c000026) { /* mfcr Rx */
368 op = read_memory_integer (pc, 4);
371 if ((op & 0xfc000000) == 0x48000000) { /* bl foo, to save fprs??? */
373 op = read_memory_integer (pc, 4);
376 if ((op & 0xfc1f0000) == 0xd8010000) { /* stfd Rx,NUM(r1) */
377 pc += 4; /* store floating register double */
378 op = read_memory_integer (pc, 4);
381 if ((op & 0xfc1f0000) == 0xbc010000) { /* stm Rx, NUM(r1) */
383 op = read_memory_integer (pc, 4);
386 while (((tmp = op >> 16) == 0x9001) || /* st r0, NUM(r1) */
387 (tmp == 0x9421) || /* stu r1, NUM(r1) */
388 (op == 0x93e1fffc)) /* st r31,-4(r1) */
391 op = read_memory_integer (pc, 4);
394 while ((tmp = (op >> 22)) == 0x20f) { /* l r31, ... or */
395 pc += 4; /* l r30, ... */
396 op = read_memory_integer (pc, 4);
399 while ((op & 0xfc1f0000) == 0x90010000) { /* st r?, NUM(r1) */
401 op = read_memory_integer (pc, 4);
404 if (op == 0x603f0000) { /* oril r31, r1, 0x0 */
405 pc += 4; /* this happens if r31 is used as */
406 op = read_memory_integer (pc, 4); /* frame ptr. (gcc does that) */
408 if ((op >> 16) == 0x907f) { /* st r3, NUM(r31) */
410 op = read_memory_integer (pc, 4);
416 /* text start and end addresses in virtual memory. */
418 CORE_ADDR text_start;
422 /*************************************************************************
423 Support for creating pushind a dummy frame into the stack, and popping
425 *************************************************************************/
427 #define DUMMY_FRAME_ADDR_SIZE 10
429 /* Make sure you initialize these in somewhere, in case gdb gives up what it
430 was debugging and starts debugging something else. FIXMEmgo */
432 static int dummy_frame_count = 0;
433 static int dummy_frame_size = 0;
434 static CORE_ADDR *dummy_frame_addr = 0;
436 extern int stop_stack_dummy;
438 /* push a dummy frame into stack, save all register. Currently we are saving
439 only gpr's and fpr's, which is not good enough! FIXMEmgo */
443 int sp, pc; /* stack pointer and link register */
446 if (dummy_frame_count >= dummy_frame_size) {
447 dummy_frame_size += DUMMY_FRAME_ADDR_SIZE;
448 if (dummy_frame_addr)
449 dummy_frame_addr = (CORE_ADDR*) xrealloc
450 (dummy_frame_addr, sizeof(CORE_ADDR) * (dummy_frame_size));
452 dummy_frame_addr = (CORE_ADDR*)
453 xmalloc (sizeof(CORE_ADDR) * (dummy_frame_size));
456 sp = read_register(SP_REGNUM);
457 pc = read_register(PC_REGNUM);
459 dummy_frame_addr [dummy_frame_count++] = sp;
461 /* Be careful! If the stack pointer is not decremented first, then kernel
462 thinks he is free to use the sapce underneath it. And kernel actually
463 uses that area for IPC purposes when executing ptrace(2) calls. So
464 before writing register values into the new frame, decrement and update
465 %sp first in order to secure your frame. */
467 write_register (SP_REGNUM, sp-408);
470 /* gdb relies on the state of current_frame. We'd better update it,
471 otherwise things like do_registers_info() wouldn't work properly! */
473 flush_cached_frames ();
474 set_current_frame (create_new_frame (sp-408, pc));
477 /* save program counter in link register's space. */
478 write_memory (sp+8, &pc, 4);
480 /* save full floating point registers here. They will be from F14..F31
481 for know. I am not sure if we need to save everything here! */
484 for (ii = 0; ii < 32; ++ii)
485 write_memory (sp-8-(ii*8), ®isters[REGISTER_BYTE (31-ii+FP0_REGNUM)], 8);
488 for (ii=1; ii <=32; ++ii)
489 write_memory (sp-256-(ii*4), ®isters[REGISTER_BYTE (32-ii)], 4);
491 /* so far, 32*2 + 32 words = 384 bytes have been written. We need 6 words
492 (24 bytes) for the rest of the registers. It brings the total to 408
494 save sp or so call back chain right here. */
495 write_memory (sp-408, &sp, 4);
498 /* And finally, this is the back chain. */
499 write_memory (sp+8, &pc, 4);
503 /* Pop a dummy frame.
505 In rs6000 when we push a dummy frame, we save all of the registers. This
506 is usually done before user calls a function explicitly.
508 After a dummy frame is pushed, some instructions are copied into stack, and
509 stack pointer is decremented even more. Since we don't have a frame pointer to
510 get back to the parent frame of the dummy, we start having trouble poping it.
511 Therefore, we keep a dummy frame stack, keeping addresses of dummy frames as
512 such. When poping happens and when we detect that was a dummy frame, we pop
513 it back to its parent by using dummy frame stack (`dummy_frame_addr' array).
520 sp = dummy_frame_addr [--dummy_frame_count];
522 /* restore all fpr's. */
523 for (ii = 1; ii <= 32; ++ii)
524 read_memory (sp-(ii*8), ®isters[REGISTER_BYTE (32-ii+FP0_REGNUM)], 8);
526 /* restore all gpr's */
527 for (ii=1; ii <= 32; ++ii) {
528 read_memory (sp-256-(ii*4), ®isters[REGISTER_BYTE (32-ii)], 4);
531 read_memory (sp-400, ®isters [REGISTER_BYTE(PC_REGNUM)], 4);
533 /* when a dummy frame was being pushed, we had to decrement %sp first, in
534 order to secure astack space. Thus, saved %sp (or %r1) value, is not the
535 one we should restore. Change it with the one we need. */
537 *(int*)®isters [REGISTER_BYTE(FP_REGNUM)] = sp;
539 /* Now we can restore all registers. */
541 store_inferior_registers (-1);
543 flush_cached_frames ();
544 set_current_frame (create_new_frame (sp, pc));
548 /* pop the innermost frame, go back to the caller. */
552 int pc, lr, sp, prev_sp; /* %pc, %lr, %sp */
553 FRAME fr = get_current_frame ();
555 int frameless = 0; /* TRUE if function is frameless */
557 int saved_gpr, saved_fpr; /* # of saved gpr's and fpr's */
562 if (stop_stack_dummy && dummy_frame_count) {
567 /* figure out previous %pc value. If the function is frameless, it is
568 still in the link register, otherwise walk the frames and retrieve the
569 saved %pc value in the previous frame. */
571 addr = get_pc_function_start (fr->pc) + FUNCTION_START_OFFSET;
572 function_frame_info (addr, &frameless, &offset, &saved_gpr, &saved_fpr);
574 read_memory (sp, &prev_sp, 4);
576 lr = read_register (LR_REGNUM);
578 read_memory (prev_sp+8, &lr, 4);
580 /* reset %pc value. */
581 write_register (PC_REGNUM, lr);
583 /* reset register values if any was saved earlier. */
584 addr = prev_sp - offset;
587 for (ii=saved_gpr; ii <= 31; ++ii) {
588 read_memory (addr, ®isters [REGISTER_BYTE (ii)], 4);
589 addr += sizeof (int);
593 for (ii=saved_fpr; ii <= 31; ++ii) {
594 read_memory (addr, ®isters [REGISTER_BYTE (ii+FP0_REGNUM)], 8);
598 write_register (SP_REGNUM, prev_sp);
599 store_inferior_registers (-1);
600 flush_cached_frames ();
601 set_current_frame (create_new_frame (prev_sp, lr));
605 /* fixup the call sequence of a dummy function, with the real function address.
606 its argumets will be passed by gdb. */
608 fix_call_dummy(dummyname, pc, fun, nargs, type)
612 int nargs; /* not used */
613 int type; /* not used */
616 #define TOC_ADDR_OFFSET 20
617 #define TARGET_ADDR_OFFSET 28
620 unsigned long target_addr;
621 unsigned long tocvalue;
624 tocvalue = find_toc_address (target_addr);
626 ii = *(int*)((char*)dummyname + TOC_ADDR_OFFSET);
627 ii = (ii & 0xffff0000) | (tocvalue >> 16);
628 *(int*)((char*)dummyname + TOC_ADDR_OFFSET) = ii;
630 ii = *(int*)((char*)dummyname + TOC_ADDR_OFFSET+4);
631 ii = (ii & 0xffff0000) | (tocvalue & 0x0000ffff);
632 *(int*)((char*)dummyname + TOC_ADDR_OFFSET+4) = ii;
634 ii = *(int*)((char*)dummyname + TARGET_ADDR_OFFSET);
635 ii = (ii & 0xffff0000) | (target_addr >> 16);
636 *(int*)((char*)dummyname + TARGET_ADDR_OFFSET) = ii;
638 ii = *(int*)((char*)dummyname + TARGET_ADDR_OFFSET+4);
639 ii = (ii & 0xffff0000) | (target_addr & 0x0000ffff);
640 *(int*)((char*)dummyname + TARGET_ADDR_OFFSET+4) = ii;
645 /* return information about a function frame.
646 - frameless is TRUE, if function does not save %pc value in its frame.
647 - offset is the number of bytes used in the frame to save registers.
648 - saved_gpr is the number of the first saved gpr.
649 - saved_fpr is the number of the first saved fpr.
651 function_frame_info (pc, frameless, offset, saved_gpr, saved_fpr)
653 int *frameless, *offset, *saved_gpr, *saved_fpr;
656 register unsigned int op;
659 *saved_gpr = *saved_fpr = -1;
664 op = read_memory_integer (pc, 4);
665 if (op == 0x7c0802a6) { /* mflr r0 */
667 op = read_memory_integer (pc, 4);
670 else /* else, this is a frameless invocation */
674 if ((op & 0xfc00003e) == 0x7c000026) { /* mfcr Rx */
676 op = read_memory_integer (pc, 4);
679 if ((op & 0xfc000000) == 0x48000000) { /* bl foo, to save fprs??? */
681 op = read_memory_integer (pc, 4);
684 if ((op & 0xfc1f0000) == 0xd8010000) { /* stfd Rx,NUM(r1) */
685 pc += 4; /* store floating register double */
686 op = read_memory_integer (pc, 4);
689 if ((op & 0xfc1f0000) == 0xbc010000) { /* stm Rx, NUM(r1) */
691 *saved_gpr = (op >> 21) & 0x1f;
694 tmp2 = 0xffff0000 | tmp2;
698 *saved_fpr = (tmp2 - ((32 - *saved_gpr) * 4)) / 8;
700 *saved_fpr = 32 - *saved_fpr;
709 /* Pass the arguments in either registers, or in the stack. In RS6000, the first
710 eight words of the argument list (that might be less than eight parameters if
711 some parameters occupy more than one word) are passed in r3..r11 registers.
712 float and double parameters are passed in fpr's, in addition to that. Rest of
713 the parameters if any are passed in user stack. There might be cases in which
714 half of the parameter is copied into registers, the other half is pushed into
717 If the function is returning a structure, then the return address is passed
718 in r3, then the first 7 words of the parametes can be passed in registers,
722 push_arguments (nargs, args, sp, struct_return, struct_addr)
727 CORE_ADDR struct_addr;
730 int argno; /* current argument number */
731 int argbytes; /* current argument byte */
732 char tmp_buffer [50];
734 int f_argno = 0; /* current floating point argno */
736 CORE_ADDR saved_sp, pc;
738 if ( dummy_frame_count <= 0)
739 printf ("FATAL ERROR -push_arguments()! frame not found!!\n");
741 /* The first eight words of ther arguments are passed in registers. Copy
744 If the function is returning a `struct', then the first word (which
745 will be passed in r3) is used for struct return address. In that
746 case we should advance one word and start from r4 register to copy
749 ii = struct_return ? 1 : 0;
751 for (argno=0, argbytes=0; argno < nargs && ii<8; ++ii) {
753 arg = value_arg_coerce (args[argno]);
754 len = TYPE_LENGTH (VALUE_TYPE (arg));
756 if (TYPE_CODE (VALUE_TYPE (arg)) == TYPE_CODE_FLT) {
758 /* floating point arguments are passed in fpr's, as well as gpr's.
759 There are 13 fpr's reserved for passing parameters. At this point
760 there is no way we would run out of them. */
764 "Fatal Error: a floating point parameter #%d with a size > 8 is found!\n", argno);
766 bcopy (VALUE_CONTENTS (arg),
767 ®isters[REGISTER_BYTE(FP0_REGNUM + 1 + f_argno)], len);
773 /* Argument takes more than one register. */
774 while (argbytes < len) {
776 *(int*)®isters[REGISTER_BYTE(ii+3)] = 0;
777 bcopy ( ((char*)VALUE_CONTENTS (arg))+argbytes,
778 ®isters[REGISTER_BYTE(ii+3)],
779 (len - argbytes) > 4 ? 4 : len - argbytes);
783 goto ran_out_of_registers_for_arguments;
788 else { /* Argument can fit in one register. No problem. */
789 *(int*)®isters[REGISTER_BYTE(ii+3)] = 0;
790 bcopy (VALUE_CONTENTS (arg), ®isters[REGISTER_BYTE(ii+3)], len);
795 ran_out_of_registers_for_arguments:
797 /* location for 8 parameters are always reserved. */
800 /* another six words for back chain, TOC register, link register, etc. */
803 /* if there are more arguments, allocate space for them in
804 the stack, then push them starting from the ninth one. */
806 if ((argno < nargs) || argbytes) {
811 space += ((len - argbytes + 3) & -4);
817 for (; jj < nargs; ++jj) {
818 val = value_arg_coerce (args[jj]);
819 space += ((TYPE_LENGTH (VALUE_TYPE (val))) + 3) & -4;
822 /* add location required for the rest of the parameters */
823 space = (space + 7) & -8;
826 /* This is another instance we need to be concerned about securing our
827 stack space. If we write anything underneath %sp (r1), we might conflict
828 with the kernel who thinks he is free to use this area. So, update %sp
829 first before doing anything else. */
831 write_register (SP_REGNUM, sp);
835 flush_cached_frames ();
836 set_current_frame (create_new_frame (sp, pc));
839 /* if the last argument copied into the registers didn't fit there
840 completely, push the rest of it into stack. */
844 sp+24+(ii*4), ((char*)VALUE_CONTENTS (arg))+argbytes, len - argbytes);
846 ii += ((len - argbytes + 3) & -4) / 4;
849 /* push the rest of the arguments into stack. */
850 for (; argno < nargs; ++argno) {
852 arg = value_arg_coerce (args[argno]);
853 len = TYPE_LENGTH (VALUE_TYPE (arg));
856 /* float types should be passed in fpr's, as well as in the stack. */
857 if (TYPE_CODE (VALUE_TYPE (arg)) == TYPE_CODE_FLT && f_argno < 13) {
861 "Fatal Error: a floating point parameter #%d with a size > 8 is found!\n", argno);
863 bcopy (VALUE_CONTENTS (arg),
864 ®isters[REGISTER_BYTE(FP0_REGNUM + 1 + f_argno)], len);
868 write_memory (sp+24+(ii*4), VALUE_CONTENTS (arg), len);
869 ii += ((len + 3) & -4) / 4;
874 /* Secure stack areas first, before doing anything else. */
875 write_register (SP_REGNUM, sp);
879 flush_cached_frames ();
880 set_current_frame (create_new_frame (sp, pc));
884 saved_sp = dummy_frame_addr [dummy_frame_count - 1];
885 read_memory (saved_sp, tmp_buffer, 24);
886 write_memory (sp, tmp_buffer, 24);
888 write_memory (sp, &saved_sp, 4); /* set back chain properly */
890 store_inferior_registers (-1);
894 /* a given return value in `regbuf' with a type `valtype', extract and copy its
895 value into `valbuf' */
897 extract_return_value (valtype, regbuf, valbuf)
898 struct type *valtype;
899 char regbuf[REGISTER_BYTES];
903 if (TYPE_CODE (valtype) == TYPE_CODE_FLT) {
906 /* floats and doubles are returned in fpr1. fpr's have a size of 8 bytes.
907 We need to truncate the return value into float size (4 byte) if
910 if (TYPE_LENGTH (valtype) > 4) /* this is a double */
911 bcopy (®buf[REGISTER_BYTE (FP0_REGNUM + 1)], valbuf,
912 TYPE_LENGTH (valtype));
914 bcopy (®buf[REGISTER_BYTE (FP0_REGNUM + 1)], &dd, 8);
916 bcopy (&ff, valbuf, sizeof(float));
920 /* return value is copied starting from r3. */
921 bcopy (®buf[REGISTER_BYTE (3)], valbuf, TYPE_LENGTH (valtype));
925 /* keep keep structure return address in this variable. */
927 CORE_ADDR rs6000_struct_return_address;
930 /* Throw away this debugging code. FIXMEmgo. */
935 for (ii=0; ii<40; ++ii) {
938 val = read_memory_integer (fram + ii * 4, 4);
939 printf ("0x%08x\t", val);
946 /* Indirect function calls use a piece of trampoline code do co context switching,
947 i.e. to set the new TOC table. Skip such code if exists. */
949 skip_trampoline_code (pc)
952 register unsigned int ii, op;
954 static unsigned trampoline_code[] = {
955 0x800b0000, /* l r0,0x0(r11) */
956 0x90410014, /* st r2,0x14(r1) */
957 0x7c0903a6, /* mtctr r0 */
958 0x804b0004, /* l r2,0x4(r11) */
959 0x816b0008, /* l r11,0x8(r11) */
960 0x4e800420, /* bctr */
965 for (ii=0; trampoline_code[ii]; ++ii) {
966 op = read_memory_integer (pc + (ii*4), 4);
967 if (op != trampoline_code [ii])
970 ii = read_register (11); /* r11 holds destination addr */
971 pc = read_memory_integer (ii, 4); /* (r11) value */