home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / D / GDB / GDB-4.13 / GDB-4 / gdb-4.13 / gdb / i386-tdep.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-02  |  17.3 KB  |  669 lines

  1. /* Intel 386 target-dependent stuff.
  2.    Copyright (C) 1988, 1989, 1991, 1994 Free Software Foundation, Inc.
  3.  
  4. This file is part of GDB.
  5.  
  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.
  10.  
  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.
  15.  
  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.  */
  19.  
  20. #include "defs.h"
  21. #include "frame.h"
  22. #include "inferior.h"
  23. #include "gdbcore.h"
  24. #include "target.h"
  25. #include "floatformat.h"
  26. #include "symtab.h"
  27.  
  28. static long
  29. i386_get_frame_setup PARAMS ((int));
  30.  
  31. static void
  32. i386_follow_jump PARAMS ((void));
  33.  
  34. static void
  35. codestream_read PARAMS ((unsigned char *, int));
  36.  
  37. static void
  38. codestream_seek PARAMS ((int));
  39.  
  40. static unsigned char 
  41. codestream_fill PARAMS ((int));
  42.  
  43. /* helper functions for tm-i386.h */
  44.  
  45. /* Stdio style buffering was used to minimize calls to ptrace, but this
  46.    buffering did not take into account that the code section being accessed
  47.    may not be an even number of buffers long (even if the buffer is only
  48.    sizeof(int) long).  In cases where the code section size happened to
  49.    be a non-integral number of buffers long, attempting to read the last
  50.    buffer would fail.  Simply using target_read_memory and ignoring errors,
  51.    rather than read_memory, is not the correct solution, since legitimate
  52.    access errors would then be totally ignored.  To properly handle this
  53.    situation and continue to use buffering would require that this code
  54.    be able to determine the minimum code section size granularity (not the
  55.    alignment of the section itself, since the actual failing case that
  56.    pointed out this problem had a section alignment of 4 but was not a
  57.    multiple of 4 bytes long), on a target by target basis, and then
  58.    adjust it's buffer size accordingly.  This is messy, but potentially
  59.    feasible.  It probably needs the bfd library's help and support.  For
  60.    now, the buffer size is set to 1.  (FIXME -fnf) */
  61.  
  62. #define CODESTREAM_BUFSIZ 1    /* Was sizeof(int), see note above. */
  63. static CORE_ADDR codestream_next_addr;
  64. static CORE_ADDR codestream_addr;
  65. static unsigned char codestream_buf[CODESTREAM_BUFSIZ];
  66. static int codestream_off;
  67. static int codestream_cnt;
  68.  
  69. #define codestream_tell() (codestream_addr + codestream_off)
  70. #define codestream_peek() (codestream_cnt == 0 ? \
  71.                codestream_fill(1): codestream_buf[codestream_off])
  72. #define codestream_get() (codestream_cnt-- == 0 ? \
  73.              codestream_fill(0) : codestream_buf[codestream_off++])
  74.  
  75. static unsigned char 
  76. codestream_fill (peek_flag)
  77.     int peek_flag;
  78. {
  79.   codestream_addr = codestream_next_addr;
  80.   codestream_next_addr += CODESTREAM_BUFSIZ;
  81.   codestream_off = 0;
  82.   codestream_cnt = CODESTREAM_BUFSIZ;
  83.   read_memory (codestream_addr, (char *) codestream_buf, CODESTREAM_BUFSIZ);
  84.   
  85.   if (peek_flag)
  86.     return (codestream_peek());
  87.   else
  88.     return (codestream_get());
  89. }
  90.  
  91. static void
  92. codestream_seek (place)
  93.     int place;
  94. {
  95.   codestream_next_addr = place / CODESTREAM_BUFSIZ;
  96.   codestream_next_addr *= CODESTREAM_BUFSIZ;
  97.   codestream_cnt = 0;
  98.   codestream_fill (1);
  99.   while (codestream_tell() != place)
  100.     codestream_get ();
  101. }
  102.  
  103. static void
  104. codestream_read (buf, count)
  105.      unsigned char *buf;
  106.      int count;
  107. {
  108.   unsigned char *p;
  109.   int i;
  110.   p = buf;
  111.   for (i = 0; i < count; i++)
  112.     *p++ = codestream_get ();
  113. }
  114.  
  115. /* next instruction is a jump, move to target */
  116.  
  117. static void
  118. i386_follow_jump ()
  119. {
  120.   unsigned char buf[4];
  121.   long delta;
  122.  
  123.   int data16;
  124.   CORE_ADDR pos;
  125.  
  126.   pos = codestream_tell ();
  127.  
  128.   data16 = 0;
  129.   if (codestream_peek () == 0x66)
  130.     {
  131.       codestream_get ();
  132.       data16 = 1;
  133.     }
  134.  
  135.   switch (codestream_get ())
  136.     {
  137.     case 0xe9:
  138.       /* relative jump: if data16 == 0, disp32, else disp16 */
  139.       if (data16)
  140.     {
  141.       codestream_read (buf, 2);
  142.       delta = extract_signed_integer (buf, 2);
  143.  
  144.       /* include size of jmp inst (including the 0x66 prefix).  */
  145.       pos += delta + 4; 
  146.     }
  147.       else
  148.     {
  149.       codestream_read (buf, 4);
  150.       delta = extract_signed_integer (buf, 4);
  151.  
  152.       pos += delta + 5;
  153.     }
  154.       break;
  155.     case 0xeb:
  156.       /* relative jump, disp8 (ignore data16) */
  157.       codestream_read (buf, 1);
  158.       /* Sign-extend it.  */
  159.       delta = extract_signed_integer (buf, 1);
  160.  
  161.       pos += delta + 2;
  162.       break;
  163.     }
  164.   codestream_seek (pos);
  165. }
  166.  
  167. /*
  168.  * find & return amound a local space allocated, and advance codestream to
  169.  * first register push (if any)
  170.  *
  171.  * if entry sequence doesn't make sense, return -1, and leave 
  172.  * codestream pointer random
  173.  */
  174.  
  175. static long
  176. i386_get_frame_setup (pc)
  177.      int pc;
  178. {
  179.   unsigned char op;
  180.  
  181.   codestream_seek (pc);
  182.  
  183.   i386_follow_jump ();
  184.  
  185.   op = codestream_get ();
  186.  
  187.   if (op == 0x58)        /* popl %eax */
  188.     {
  189.       /*
  190.        * this function must start with
  191.        * 
  192.        *    popl %eax          0x58
  193.        *    xchgl %eax, (%esp)  0x87 0x04 0x24
  194.        * or xchgl %eax, 0(%esp) 0x87 0x44 0x24 0x00
  195.        *
  196.        * (the system 5 compiler puts out the second xchg
  197.        * inst, and the assembler doesn't try to optimize it,
  198.        * so the 'sib' form gets generated)
  199.        * 
  200.        * this sequence is used to get the address of the return
  201.        * buffer for a function that returns a structure
  202.        */
  203.       int pos;
  204.       unsigned char buf[4];
  205.       static unsigned char proto1[3] = { 0x87,0x04,0x24 };
  206.       static unsigned char proto2[4] = { 0x87,0x44,0x24,0x00 };
  207.       pos = codestream_tell ();
  208.       codestream_read (buf, 4);
  209.       if (memcmp (buf, proto1, 3) == 0)
  210.     pos += 3;
  211.       else if (memcmp (buf, proto2, 4) == 0)
  212.     pos += 4;
  213.  
  214.       codestream_seek (pos);
  215.       op = codestream_get (); /* update next opcode */
  216.     }
  217.  
  218.   if (op == 0x55)        /* pushl %ebp */
  219.     {            
  220.       /* check for movl %esp, %ebp - can be written two ways */
  221.       switch (codestream_get ())
  222.     {
  223.     case 0x8b:
  224.       if (codestream_get () != 0xec)
  225.         return (-1);
  226.       break;
  227.     case 0x89:
  228.       if (codestream_get () != 0xe5)
  229.         return (-1);
  230.       break;
  231.     default:
  232.       return (-1);
  233.     }
  234.       /* check for stack adjustment 
  235.        *
  236.        *  subl $XXX, %esp
  237.        *
  238.        * note: you can't subtract a 16 bit immediate
  239.        * from a 32 bit reg, so we don't have to worry
  240.        * about a data16 prefix 
  241.        */
  242.       op = codestream_peek ();
  243.       if (op == 0x83)
  244.     {
  245.       /* subl with 8 bit immed */
  246.       codestream_get ();
  247.       if (codestream_get () != 0xec)
  248.         /* Some instruction starting with 0x83 other than subl.  */
  249.         {
  250.           codestream_seek (codestream_tell () - 2);
  251.           return 0;
  252.         }
  253.       /* subl with signed byte immediate 
  254.        * (though it wouldn't make sense to be negative)
  255.        */
  256.       return (codestream_get());
  257.     }
  258.       else if (op == 0x81)
  259.     {
  260.       char buf[4];
  261.       /* Maybe it is subl with 32 bit immedediate.  */
  262.       codestream_get();
  263.       if (codestream_get () != 0xec)
  264.         /* Some instruction starting with 0x81 other than subl.  */
  265.         {
  266.           codestream_seek (codestream_tell () - 2);
  267.           return 0;
  268.         }
  269.       /* It is subl with 32 bit immediate.  */
  270.       codestream_read ((unsigned char *)buf, 4);
  271.       return extract_signed_integer (buf, 4);
  272.     }
  273.       else
  274.     {
  275.       return (0);
  276.     }
  277.     }
  278.   else if (op == 0xc8)
  279.     {
  280.       char buf[2];
  281.       /* enter instruction: arg is 16 bit unsigned immed */
  282.       codestream_read ((unsigned char *)buf, 2);
  283.       codestream_get (); /* flush final byte of enter instruction */
  284.       return extract_unsigned_integer (buf, 2);
  285.     }
  286.   return (-1);
  287. }
  288.  
  289. /* Return number of args passed to a frame.
  290.    Can return -1, meaning no way to tell.  */
  291.  
  292. int
  293. i386_frame_num_args (fi)
  294.      struct frame_info *fi;
  295. {
  296. #if 1
  297.   return -1;
  298. #else
  299.   /* This loses because not only might the compiler not be popping the
  300.      args right after the function call, it might be popping args from both
  301.      this call and a previous one, and we would say there are more args
  302.      than there really are.  */
  303.  
  304.   int retpc;                        
  305.   unsigned char op;                    
  306.   struct frame_info *pfi;
  307.  
  308.   /* on the 386, the instruction following the call could be:
  309.      popl %ecx        -  one arg
  310.      addl $imm, %esp  -  imm/4 args; imm may be 8 or 32 bits
  311.      anything else    -  zero args  */
  312.  
  313.   int frameless;
  314.  
  315.   FRAMELESS_FUNCTION_INVOCATION (fi, frameless);
  316.   if (frameless)
  317.     /* In the absence of a frame pointer, GDB doesn't get correct values
  318.        for nameless arguments.  Return -1, so it doesn't print any
  319.        nameless arguments.  */
  320.     return -1;
  321.  
  322.   pfi = get_prev_frame_info (fi);            
  323.   if (pfi == 0)
  324.     {
  325.       /* Note:  this can happen if we are looking at the frame for
  326.      main, because FRAME_CHAIN_VALID won't let us go into
  327.      start.  If we have debugging symbols, that's not really
  328.      a big deal; it just means it will only show as many arguments
  329.      to main as are declared.  */
  330.       return -1;
  331.     }
  332.   else
  333.     {
  334.       retpc = pfi->pc;                    
  335.       op = read_memory_integer (retpc, 1);            
  336.       if (op == 0x59)                    
  337.     /* pop %ecx */                   
  338.     return 1;                
  339.       else if (op == 0x83)
  340.     {
  341.       op = read_memory_integer (retpc+1, 1);    
  342.       if (op == 0xc4)                
  343.         /* addl $<signed imm 8 bits>, %esp */    
  344.         return (read_memory_integer (retpc+2,1)&0xff)/4;
  345.       else
  346.         return 0;
  347.     }
  348.       else if (op == 0x81)
  349.     { /* add with 32 bit immediate */
  350.       op = read_memory_integer (retpc+1, 1);    
  351.       if (op == 0xc4)                
  352.         /* addl $<imm 32>, %esp */        
  353.         return read_memory_integer (retpc+2, 4) / 4;
  354.       else
  355.         return 0;
  356.     }
  357.       else
  358.     {
  359.       return 0;
  360.     }
  361.     }
  362. #endif
  363. }
  364.  
  365. /*
  366.  * parse the first few instructions of the function to see
  367.  * what registers were stored.
  368.  *
  369.  * We handle these cases:
  370.  *
  371.  * The startup sequence can be at the start of the function,
  372.  * or the function can start with a branch to startup code at the end.
  373.  *
  374.  * %ebp can be set up with either the 'enter' instruction, or 
  375.  * 'pushl %ebp, movl %esp, %ebp' (enter is too slow to be useful,
  376.  * but was once used in the sys5 compiler)
  377.  *
  378.  * Local space is allocated just below the saved %ebp by either the
  379.  * 'enter' instruction, or by 'subl $<size>, %esp'.  'enter' has
  380.  * a 16 bit unsigned argument for space to allocate, and the
  381.  * 'addl' instruction could have either a signed byte, or
  382.  * 32 bit immediate.
  383.  *
  384.  * Next, the registers used by this function are pushed.  In
  385.  * the sys5 compiler they will always be in the order: %edi, %esi, %ebx
  386.  * (and sometimes a harmless bug causes it to also save but not restore %eax);
  387.  * however, the code below is willing to see the pushes in any order,
  388.  * and will handle up to 8 of them.
  389.  *
  390.  * If the setup sequence is at the end of the function, then the
  391.  * next instruction will be a branch back to the start.
  392.  */
  393.  
  394. void
  395. i386_frame_find_saved_regs (fip, fsrp)
  396.      struct frame_info *fip;
  397.      struct frame_saved_regs *fsrp;
  398. {
  399.   long locals;
  400.   unsigned char op;
  401.   CORE_ADDR dummy_bottom;
  402.   CORE_ADDR adr;
  403.   int i;
  404.   
  405.   memset (fsrp, 0, sizeof *fsrp);
  406.   
  407.   /* if frame is the end of a dummy, compute where the
  408.    * beginning would be
  409.    */
  410.   dummy_bottom = fip->frame - 4 - REGISTER_BYTES - CALL_DUMMY_LENGTH;
  411.   
  412.   /* check if the PC is in the stack, in a dummy frame */
  413.   if (dummy_bottom <= fip->pc && fip->pc <= fip->frame) 
  414.     {
  415.       /* all regs were saved by push_call_dummy () */
  416.       adr = fip->frame;
  417.       for (i = 0; i < NUM_REGS; i++) 
  418.     {
  419.       adr -= REGISTER_RAW_SIZE (i);
  420.       fsrp->regs[i] = adr;
  421.     }
  422.       return;
  423.     }
  424.   
  425.   locals = i386_get_frame_setup (get_pc_function_start (fip->pc));
  426.   
  427.   if (locals >= 0) 
  428.     {
  429.       adr = fip->frame - 4 - locals;
  430.       for (i = 0; i < 8; i++) 
  431.     {
  432.       op = codestream_get ();
  433.       if (op < 0x50 || op > 0x57)
  434.         break;
  435. #ifdef I386_REGNO_TO_SYMMETRY
  436.       /* Dynix uses different internal numbering.  Ick.  */
  437.       fsrp->regs[I386_REGNO_TO_SYMMETRY(op - 0x50)] = adr;
  438. #else
  439.       fsrp->regs[op - 0x50] = adr;
  440. #endif
  441.       adr -= 4;
  442.     }
  443.     }
  444.   
  445.   fsrp->regs[PC_REGNUM] = fip->frame + 4;
  446.   fsrp->regs[FP_REGNUM] = fip->frame;
  447. }
  448.  
  449. /* return pc of first real instruction */
  450.  
  451. int
  452. i386_skip_prologue (pc)
  453.      int pc;
  454. {
  455.   unsigned char op;
  456.   int i;
  457.   static unsigned char pic_pat[6] = { 0xe8, 0, 0, 0, 0, /* call   0x0 */
  458.                       0x5b,             /* popl   %ebx */
  459.                     };
  460.   CORE_ADDR pos;
  461.   
  462.   if (i386_get_frame_setup (pc) < 0)
  463.     return (pc);
  464.   
  465.   /* found valid frame setup - codestream now points to 
  466.    * start of push instructions for saving registers
  467.    */
  468.   
  469.   /* skip over register saves */
  470.   for (i = 0; i < 8; i++)
  471.     {
  472.       op = codestream_peek ();
  473.       /* break if not pushl inst */
  474.       if (op < 0x50 || op > 0x57) 
  475.     break;
  476.       codestream_get ();
  477.     }
  478.  
  479.   /* The native cc on SVR4 in -K PIC mode inserts the following code to get
  480.      the address of the global offset table (GOT) into register %ebx.
  481.       call    0x0
  482.       popl    %ebx
  483.       movl    %ebx,x(%ebp)    (optional)
  484.       addl    y,%ebx
  485.      This code is with the rest of the prologue (at the end of the
  486.      function), so we have to skip it to get to the first real
  487.      instruction at the start of the function.  */
  488.      
  489.   pos = codestream_tell ();
  490.   for (i = 0; i < 6; i++)
  491.     {
  492.       op = codestream_get ();
  493.       if (pic_pat [i] != op)
  494.     break;
  495.     }
  496.   if (i == 6)
  497.     {
  498.       unsigned char buf[4];
  499.       long delta = 6;
  500.  
  501.       op = codestream_get ();
  502.       if (op == 0x89)            /* movl %ebx, x(%ebp) */
  503.     {
  504.       op = codestream_get ();
  505.       if (op == 0x5d)        /* one byte offset from %ebp */
  506.         {
  507.           delta += 3;
  508.           codestream_read (buf, 1);
  509.         }
  510.       else if (op == 0x9d)        /* four byte offset from %ebp */
  511.         {
  512.           delta += 6;
  513.           codestream_read (buf, 4);
  514.         }
  515.       else                /* unexpected instruction */
  516.           delta = -1;
  517.           op = codestream_get ();
  518.     }
  519.                     /* addl y,%ebx */
  520.       if (delta > 0 && op == 0x81 && codestream_get () == 0xc3) 
  521.     {
  522.         pos += delta + 6;
  523.     }
  524.     }
  525.   codestream_seek (pos);
  526.   
  527.   i386_follow_jump ();
  528.   
  529.   return (codestream_tell ());
  530. }
  531.  
  532. void
  533. i386_push_dummy_frame ()
  534. {
  535.   CORE_ADDR sp = read_register (SP_REGNUM);
  536.   int regnum;
  537.   char regbuf[MAX_REGISTER_RAW_SIZE];
  538.   
  539.   sp = push_word (sp, read_register (PC_REGNUM));
  540.   sp = push_word (sp, read_register (FP_REGNUM));
  541.   write_register (FP_REGNUM, sp);
  542.   for (regnum = 0; regnum < NUM_REGS; regnum++)
  543.     {
  544.       read_register_gen (regnum, regbuf);
  545.       sp = push_bytes (sp, regbuf, REGISTER_RAW_SIZE (regnum));
  546.     }
  547.   write_register (SP_REGNUM, sp);
  548. }
  549.  
  550. void
  551. i386_pop_frame ()
  552. {
  553.   FRAME frame = get_current_frame ();
  554.   CORE_ADDR fp;
  555.   int regnum;
  556.   struct frame_saved_regs fsr;
  557.   struct frame_info *fi;
  558.   char regbuf[MAX_REGISTER_RAW_SIZE];
  559.   
  560.   fi = get_frame_info (frame);
  561.   fp = fi->frame;
  562.   get_frame_saved_regs (fi, &fsr);
  563.   for (regnum = 0; regnum < NUM_REGS; regnum++) 
  564.     {
  565.       CORE_ADDR adr;
  566.       adr = fsr.regs[regnum];
  567.       if (adr)
  568.     {
  569.       read_memory (adr, regbuf, REGISTER_RAW_SIZE (regnum));
  570.       write_register_bytes (REGISTER_BYTE (regnum), regbuf,
  571.                 REGISTER_RAW_SIZE (regnum));
  572.     }
  573.     }
  574.   write_register (FP_REGNUM, read_memory_integer (fp, 4));
  575.   write_register (PC_REGNUM, read_memory_integer (fp + 4, 4));
  576.   write_register (SP_REGNUM, fp + 8);
  577.   flush_cached_frames ();
  578.   set_current_frame ( create_new_frame (read_register (FP_REGNUM),
  579.                     read_pc ()));
  580. }
  581.  
  582. #ifdef GET_LONGJMP_TARGET
  583.  
  584. /* Figure out where the longjmp will land.  Slurp the args out of the stack.
  585.    We expect the first arg to be a pointer to the jmp_buf structure from which
  586.    we extract the pc (JB_PC) that we will land at.  The pc is copied into PC.
  587.    This routine returns true on success. */
  588.  
  589. int
  590. get_longjmp_target(pc)
  591.      CORE_ADDR *pc;
  592. {
  593.   char buf[TARGET_PTR_BIT / TARGET_CHAR_BIT];
  594.   CORE_ADDR sp, jb_addr;
  595.  
  596.   sp = read_register (SP_REGNUM);
  597.  
  598.   if (target_read_memory (sp + SP_ARG0, /* Offset of first arg on stack */
  599.               buf,
  600.               TARGET_PTR_BIT / TARGET_CHAR_BIT))
  601.     return 0;
  602.  
  603.   jb_addr = extract_address (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT);
  604.  
  605.   if (target_read_memory (jb_addr + JB_PC * JB_ELEMENT_SIZE, buf,
  606.               TARGET_PTR_BIT / TARGET_CHAR_BIT))
  607.     return 0;
  608.  
  609.   *pc = extract_address (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT);
  610.  
  611.   return 1;
  612. }
  613.  
  614. #endif /* GET_LONGJMP_TARGET */
  615.  
  616. #ifdef I386_AIX_TARGET
  617. /* On AIX, floating point values are returned in floating point registers.  */
  618.  
  619. void
  620. i386_extract_return_value(type, regbuf, valbuf)
  621.      struct type *type;
  622.      char regbuf[REGISTER_BYTES];
  623.      char *valbuf;
  624. {
  625.   if (TYPE_CODE_FLT == TYPE_CODE(type))
  626.     {
  627.       double d;
  628.       /* 387 %st(0), gcc uses this */
  629.       floatformat_to_double (&floatformat_i387_ext,
  630.                  ®buf[REGISTER_BYTE(FP0_REGNUM)],
  631.                  &d);
  632.       store_floating (valbuf, TYPE_LENGTH (type), d);
  633.     }
  634.   else
  635.     { 
  636.       memcpy (valbuf, regbuf, TYPE_LENGTH (type)); 
  637.     }
  638. }
  639. #endif /* I386_AIX_TARGET */
  640.  
  641. #ifdef I386V4_SIGTRAMP_SAVED_PC
  642. /* Get saved user PC for sigtramp from the pushed ucontext on the stack
  643.    for all three variants of SVR4 sigtramps.  */
  644.  
  645. CORE_ADDR
  646. i386v4_sigtramp_saved_pc (frame)
  647.      FRAME frame;
  648. {
  649.   CORE_ADDR saved_pc_offset = 4;
  650.   char *name = NULL;
  651.  
  652.   find_pc_partial_function (frame->pc, &name,
  653.                 (CORE_ADDR *)NULL,(CORE_ADDR *)NULL);
  654.   if (name)
  655.     {
  656.       if (STREQ (name, "_sigreturn"))
  657.     saved_pc_offset = 132 + 14 * 4;
  658.       else if (STREQ (name, "_sigacthandler"))
  659.     saved_pc_offset = 80 + 14 * 4;
  660.       else if (STREQ (name, "sigvechandler"))
  661.     saved_pc_offset = 120 + 14 * 4;
  662.     }
  663.  
  664.   if (frame->next)
  665.     return read_memory_integer (frame->next->frame + saved_pc_offset, 4);
  666.   return read_memory_integer (read_register (SP_REGNUM) + saved_pc_offset, 4);
  667. }
  668. #endif /* I386V4_SIGTRAMP_SAVED_PC */
  669.