OSDN Git Service

Fix mips64vr4100-elf build failure.
[pf3gnuchains/gcc-fork.git] / gcc / frame.c
1 /* Subroutines needed for unwinding stack frames for exception handling.  */
2 /* Compile this one with gcc.  */
3 /* Copyright (C) 1997 Free Software Foundation, Inc.
4    Contributed by Jason Merrill <jason@cygnus.com>.
5
6 This file is part of GNU CC.
7
8 GNU CC 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, or (at your option)
11 any later version.
12
13 GNU CC 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 GNU CC; see the file COPYING.  If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA.  */
22
23 /* As a special exception, if you link this library with other files,
24    some of which are compiled with GCC, to produce an executable,
25    this library does not by itself cause the resulting executable
26    to be covered by the GNU General Public License.
27    This exception does not however invalidate any other reasons why
28    the executable file might be covered by the GNU General Public License.  */
29
30 /* It is incorrect to include config.h here, because this file is being
31    compiled for the target, and hence definitions concerning only the host
32    do not apply.  */
33
34 #include "tconfig.h"
35
36 /* We disable this when inhibit_libc, so that gcc can still be built without
37    needing header files first.  */
38 /* ??? This is not a good solution, since prototypes may be required in
39    some cases for correct code.  See also libgcc2.c.  */
40 #ifndef inhibit_libc
41 /* fixproto guarantees these system headers exist. */
42 #include <stdlib.h>
43 #include <unistd.h>
44 #endif
45
46 #include "defaults.h"
47
48 #ifdef DWARF2_UNWIND_INFO
49 #include "gansidecl.h"
50 #include "dwarf2.h"
51 #include <stddef.h>
52 #include "frame.h"
53 #include "gthr.h"
54
55 #ifdef __GTHREAD_MUTEX_INIT
56 static __gthread_mutex_t object_mutex = __GTHREAD_MUTEX_INIT;
57 #else
58 static __gthread_mutex_t object_mutex;
59 #endif
60
61 /* Don't use `fancy_abort' here even if config.h says to use it.  */
62 #ifdef abort
63 #undef abort
64 #endif
65
66 /* Some types used by the DWARF 2 spec.  */
67
68 typedef          int  sword __attribute__ ((mode (SI)));
69 typedef unsigned int  uword __attribute__ ((mode (SI)));
70 typedef unsigned int  uaddr __attribute__ ((mode (pointer)));
71 typedef          int  saddr __attribute__ ((mode (pointer)));
72 typedef unsigned char ubyte;
73
74 /* The first few fields of a CIE.  The CIE_id field is 0 for a CIE,
75    to distinguish it from a valid FDE.  FDEs are aligned to an addressing
76    unit boundary, but the fields within are unaligned.  */
77
78 struct dwarf_cie {
79   uword length;
80   sword CIE_id;
81   ubyte version;
82   char augmentation[0];
83 } __attribute__ ((packed, aligned (__alignof__ (void *))));
84
85 /* The first few fields of an FDE.  */
86
87 struct dwarf_fde {
88   uword length;
89   sword CIE_delta;
90   void* pc_begin;
91   uaddr pc_range;
92 } __attribute__ ((packed, aligned (__alignof__ (void *))));
93
94 typedef struct dwarf_fde fde;
95
96 /* Objects to be searched for frame unwind info.  */
97
98 static struct object *objects;
99
100 /* The information we care about from a CIE.  */
101
102 struct cie_info {
103   char *augmentation;
104   void *eh_ptr;
105   int code_align;
106   int data_align;
107   unsigned ra_regno;
108 };
109
110 /* The current unwind state, plus a saved copy for DW_CFA_remember_state.  */
111
112 struct frame_state_internal
113 {
114   struct frame_state s;
115   struct frame_state_internal *saved_state;
116 };
117 \f  
118 /* Decode the unsigned LEB128 constant at BUF into the variable pointed to
119    by R, and return the new value of BUF.  */
120
121 static void *
122 decode_uleb128 (unsigned char *buf, unsigned *r)
123 {
124   unsigned shift = 0;
125   unsigned result = 0;
126
127   while (1)
128     {
129       unsigned byte = *buf++;
130       result |= (byte & 0x7f) << shift;
131       if ((byte & 0x80) == 0)
132         break;
133       shift += 7;
134     }
135   *r = result;
136   return buf;
137 }
138
139 /* Decode the signed LEB128 constant at BUF into the variable pointed to
140    by R, and return the new value of BUF.  */
141
142 static void *
143 decode_sleb128 (unsigned char *buf, int *r)
144 {
145   unsigned shift = 0;
146   unsigned result = 0;
147   unsigned byte;
148
149   while (1)
150     {
151       byte = *buf++;
152       result |= (byte & 0x7f) << shift;
153       shift += 7;
154       if ((byte & 0x80) == 0)
155         break;
156     }
157   if (shift < (sizeof (*r) * 8) && (byte & 0x40) != 0)
158     result |= - (1 << shift);
159
160   *r = result;
161   return buf;
162 }
163
164 /* Read unaligned data from the instruction buffer.  */
165
166 union unaligned {
167   void *p;
168   unsigned b2 __attribute__ ((mode (HI)));
169   unsigned b4 __attribute__ ((mode (SI)));
170   unsigned b8 __attribute__ ((mode (DI)));
171 } __attribute__ ((packed));
172 static inline void *
173 read_pointer (void *p)
174 { union unaligned *up = p; return up->p; }
175 static inline unsigned
176 read_1byte (void *p)
177 { return *(unsigned char *)p; }
178 static inline unsigned
179 read_2byte (void *p)
180 { union unaligned *up = p; return up->b2; }
181 static inline unsigned
182 read_4byte (void *p)
183 { union unaligned *up = p; return up->b4; }
184 static inline unsigned long
185 read_8byte (void *p)
186 { union unaligned *up = p; return up->b8; }
187 \f
188 /* Ordering function for FDEs.  Functions can't overlap, so we just compare
189    their starting addresses.  */
190
191 static inline saddr
192 fde_compare (fde *x, fde *y)
193 {
194   return (saddr)x->pc_begin - (saddr)y->pc_begin;
195 }
196
197 /* Return the address of the FDE after P.  */
198
199 static inline fde *
200 next_fde (fde *p)
201 {
202   return (fde *)(((char *)p) + p->length + sizeof (p->length));
203 }
204
205 /* Sorting an array of FDEs by address.
206    (Ideally we would have the linker sort the FDEs so we don't have to do
207    it at run time. But the linkers are not yet prepared for this.)  */
208
209 /* This is a special mix of insertion sort and heap sort, optimized for
210    the data sets that actually occur. They look like
211    101 102 103 127 128 105 108 110 190 111 115 119 125 160 126 129 130.
212    I.e. a linearly increasing sequence (coming from functions in the text
213    section), with additionally a few unordered elements (coming from functions
214    in gnu_linkonce sections) whose values are higher than the values in the
215    surrounding linear sequence (but not necessarily higher than the values
216    at the end of the linear sequence!).
217    The worst-case total run time is O(N) + O(n log (n)), where N is the
218    total number of FDEs and n is the number of erratic ones.  */
219
220 typedef struct fde_vector
221 {
222   fde **array;
223   size_t count;
224 } fde_vector;
225
226 typedef struct fde_accumulator
227 {
228   fde_vector linear;
229   fde_vector erratic;
230 } fde_accumulator;
231
232 static inline void
233 start_fde_sort (fde_accumulator *accu, size_t count)
234 {
235   accu->linear.array = (fde **) malloc (sizeof (fde *) * count);
236   accu->erratic.array = (fde **) malloc (sizeof (fde *) * count);
237   accu->linear.count = 0;
238   accu->erratic.count = 0;
239 }
240
241 static inline void
242 fde_insert (fde_accumulator *accu, fde *this_fde)
243 {
244   accu->linear.array[accu->linear.count++] = this_fde;
245 }
246
247 /* Split LINEAR into a linear sequence with low values and an erratic
248    sequence with high values, put the linear one (of longest possible
249    length) into LINEAR and the erratic one into ERRATIC. This is O(N).  */
250 static inline void
251 fde_split (fde_vector *linear, fde_vector *erratic)
252 {
253   size_t count = linear->count;
254   size_t linear_max = (size_t) -1;
255   size_t previous_max[count];
256   size_t i, j;
257
258   for (i = 0; i < count; i++)
259     {
260       for (j = linear_max;
261            j != (size_t) -1
262            && fde_compare (linear->array[i], linear->array[j]) < 0;
263            j = previous_max[j])
264         {
265           erratic->array[erratic->count++] = linear->array[j];
266           linear->array[j] = (fde *) NULL;
267         }
268       previous_max[i] = j;
269       linear_max = i;
270     }
271
272   for (i = 0, j = 0; i < count; i++)
273     if (linear->array[i] != (fde *) NULL)
274       linear->array[j++] = linear->array[i];
275   linear->count = j;
276 }
277
278 /* This is O(n log(n)).  BSD/OS defines heapsort in stdlib.h, so we must
279    use a name that does not conflict.  */
280 static inline void
281 frame_heapsort (fde_vector *erratic)
282 {
283   /* For a description of this algorithm, see:
284      Samuel P. Harbison, Guy L. Steele Jr.: C, a reference manual, 2nd ed.,
285      p. 60-61. */
286   fde ** a = erratic->array;
287   /* A portion of the array is called a "heap" if for all i>=0:
288      If i and 2i+1 are valid indices, then a[i] >= a[2i+1].
289      If i and 2i+2 are valid indices, then a[i] >= a[2i+2]. */
290 #define SWAP(x,y) do { fde * tmp = x; x = y; y = tmp; } while (0)
291   size_t n = erratic->count;
292   size_t m = n;
293   size_t i;
294
295   while (m > 0)
296     {
297       /* Invariant: a[m..n-1] is a heap. */
298       m--;
299       for (i = m; 2*i+1 < n; )
300         {
301           if (2*i+2 < n
302               && fde_compare (a[2*i+2], a[2*i+1]) > 0
303               && fde_compare (a[2*i+2], a[i]) > 0)
304             {
305               SWAP (a[i], a[2*i+2]);
306               i = 2*i+2;
307             }
308           else if (fde_compare (a[2*i+1], a[i]) > 0)
309             {
310               SWAP (a[i], a[2*i+1]);
311               i = 2*i+1;
312             }
313           else
314             break;
315         }
316     }
317   while (n > 1)
318     {
319       /* Invariant: a[0..n-1] is a heap. */
320       n--;
321       SWAP (a[0], a[n]);
322       for (i = 0; 2*i+1 < n; )
323         {
324           if (2*i+2 < n
325               && fde_compare (a[2*i+2], a[2*i+1]) > 0
326               && fde_compare (a[2*i+2], a[i]) > 0)
327             {
328               SWAP (a[i], a[2*i+2]);
329               i = 2*i+2;
330             }
331           else if (fde_compare (a[2*i+1], a[i]) > 0)
332             {
333               SWAP (a[i], a[2*i+1]);
334               i = 2*i+1;
335             }
336           else
337             break;
338         }
339     }
340 #undef SWAP
341 }
342
343 /* Merge V1 and V2, both sorted, and put the result into V1. */
344 static void
345 fde_merge (fde_vector *v1, const fde_vector *v2)
346 {
347   size_t i1, i2;
348   fde * fde2;
349
350   i2 = v2->count;
351   if (i2 > 0)
352     {
353       i1 = v1->count;
354       do {
355         i2--;
356         fde2 = v2->array[i2];
357         while (i1 > 0 && fde_compare (v1->array[i1-1], fde2) > 0)
358           {
359             v1->array[i1+i2] = v1->array[i1-1];
360             i1--;
361           }
362         v1->array[i1+i2] = fde2;
363       } while (i2 > 0);
364       v1->count += v2->count;
365     }
366 }
367
368 static fde **
369 end_fde_sort (fde_accumulator *accu, size_t count)
370 {
371   if (accu->linear.count != count)
372     abort ();
373   fde_split (&accu->linear, &accu->erratic);
374   if (accu->linear.count + accu->erratic.count != count)
375     abort ();
376   frame_heapsort (&accu->erratic);
377   fde_merge (&accu->linear, &accu->erratic);
378   free (accu->erratic.array);
379   return accu->linear.array;
380 }
381
382 static size_t
383 count_fdes (fde *this_fde)
384 {
385   size_t count;
386
387   for (count = 0; this_fde->length != 0; this_fde = next_fde (this_fde))
388     {
389       /* Skip CIEs and linked once FDE entries.  */
390       if (this_fde->CIE_delta == 0 || this_fde->pc_begin == 0)
391         continue;
392
393       ++count;
394     }
395
396   return count;
397 }
398
399 static void
400 add_fdes (fde *this_fde, fde_accumulator *accu, void **beg_ptr, void **end_ptr)
401 {
402   void *pc_begin = *beg_ptr;
403   void *pc_end = *end_ptr;
404
405   for (; this_fde->length != 0; this_fde = next_fde (this_fde))
406     {
407       /* Skip CIEs and linked once FDE entries.  */
408       if (this_fde->CIE_delta == 0 || this_fde->pc_begin == 0)
409         continue;
410
411       fde_insert (accu, this_fde);
412
413       if (this_fde->pc_begin < pc_begin)
414         pc_begin = this_fde->pc_begin;
415       if (this_fde->pc_begin + this_fde->pc_range > pc_end)
416         pc_end = this_fde->pc_begin + this_fde->pc_range;
417     }
418
419   *beg_ptr = pc_begin;
420   *end_ptr = pc_end;
421 }
422
423 /* Set up a sorted array of pointers to FDEs for a loaded object.  We
424    count up the entries before allocating the array because it's likely to
425    be faster.  */
426
427 static void
428 frame_init (struct object* ob)
429 {
430   size_t count;
431   fde_accumulator accu;
432   void *pc_begin, *pc_end;
433
434   if (ob->fde_array)
435     {
436       fde **p = ob->fde_array;
437       for (count = 0; *p; ++p)
438         count += count_fdes (*p);
439     }
440   else
441     count = count_fdes (ob->fde_begin);
442
443   ob->count = count;
444
445   start_fde_sort (&accu, count);
446   pc_begin = (void*)(uaddr)-1;
447   pc_end = 0;
448
449   if (ob->fde_array)
450     {
451       fde **p = ob->fde_array;
452       for (; *p; ++p)
453         add_fdes (*p, &accu, &pc_begin, &pc_end);
454     }
455   else
456     add_fdes (ob->fde_begin, &accu, &pc_begin, &pc_end);
457
458   ob->fde_array = end_fde_sort (&accu, count);
459   ob->pc_begin = pc_begin;
460   ob->pc_end = pc_end;
461 }
462
463 /* Return a pointer to the FDE for the function containing PC.  */
464
465 static fde *
466 find_fde (void *pc)
467 {
468   struct object *ob;
469   size_t lo, hi;
470
471   __gthread_mutex_lock (&object_mutex);
472
473   for (ob = objects; ob; ob = ob->next)
474     {
475       if (ob->pc_begin == 0)
476         frame_init (ob);
477       if (pc >= ob->pc_begin && pc < ob->pc_end)
478         break;
479     }
480
481   __gthread_mutex_unlock (&object_mutex);
482
483   if (ob == 0)
484     return 0;
485
486   /* Standard binary search algorithm.  */
487   for (lo = 0, hi = ob->count; lo < hi; )
488     {
489       size_t i = (lo + hi) / 2;
490       fde *f = ob->fde_array[i];
491
492       if (pc < f->pc_begin)
493         hi = i;
494       else if (pc >= f->pc_begin + f->pc_range)
495         lo = i + 1;
496       else
497         return f;
498     }
499
500   return 0;
501 }
502 \f
503 static inline struct dwarf_cie *
504 get_cie (fde *f)
505 {
506   return ((void *)&f->CIE_delta) - f->CIE_delta;
507 }
508
509 /* Extract any interesting information from the CIE for the translation
510    unit F belongs to.  */
511
512 static void *
513 extract_cie_info (fde *f, struct cie_info *c)
514 {
515   void *p;
516   int i;
517
518   c->augmentation = get_cie (f)->augmentation;
519
520   if (strcmp (c->augmentation, "") != 0
521       && strcmp (c->augmentation, "eh") != 0
522       && c->augmentation[0] != 'z')
523     return 0;
524
525   p = c->augmentation + strlen (c->augmentation) + 1;
526
527   if (strcmp (c->augmentation, "eh") == 0)
528     {
529       c->eh_ptr = read_pointer (p);
530       p += sizeof (void *);
531     }
532   else
533     c->eh_ptr = 0;
534
535   p = decode_uleb128 (p, &c->code_align);
536   p = decode_sleb128 (p, &c->data_align);
537   c->ra_regno = *(unsigned char *)p++;
538
539   /* If the augmentation starts with 'z', we now see the length of the
540      augmentation fields.  */
541   if (c->augmentation[0] == 'z')
542     {
543       p = decode_uleb128 (p, &i);
544       p += i;
545     }
546
547   return p;
548 }
549
550 /* Decode one instruction's worth of DWARF 2 call frame information.
551    Used by __frame_state_for.  Takes pointers P to the instruction to
552    decode, STATE to the current register unwind information, INFO to the
553    current CIE information, and PC to the current PC value.  Returns a
554    pointer to the next instruction.  */
555
556 static void *
557 execute_cfa_insn (void *p, struct frame_state_internal *state,
558                   struct cie_info *info, void **pc)
559 {
560   unsigned insn = *(unsigned char *)p++;
561   unsigned reg;
562   int offset;
563
564   if (insn & DW_CFA_advance_loc)
565     *pc += ((insn & 0x3f) * info->code_align);
566   else if (insn & DW_CFA_offset)
567     {
568       reg = (insn & 0x3f);
569       p = decode_uleb128 (p, &offset);
570       offset *= info->data_align;
571       state->s.saved[reg] = REG_SAVED_OFFSET;
572       state->s.reg_or_offset[reg] = offset;
573     }
574   else if (insn & DW_CFA_restore)
575     {
576       reg = (insn & 0x3f);
577       state->s.saved[reg] = REG_UNSAVED;
578     }
579   else switch (insn)
580     {
581     case DW_CFA_set_loc:
582       *pc = read_pointer (p);
583       p += sizeof (void *);
584       break;
585     case DW_CFA_advance_loc1:
586       *pc += read_1byte (p);
587       p += 1;
588       break;
589     case DW_CFA_advance_loc2:
590       *pc += read_2byte (p);
591       p += 2;
592       break;
593     case DW_CFA_advance_loc4:
594       *pc += read_4byte (p);
595       p += 4;
596       break;
597
598     case DW_CFA_offset_extended:
599       p = decode_uleb128 (p, &reg);
600       p = decode_uleb128 (p, &offset);
601       offset *= info->data_align;
602       state->s.saved[reg] = REG_SAVED_OFFSET;
603       state->s.reg_or_offset[reg] = offset;
604       break;
605     case DW_CFA_restore_extended:
606       p = decode_uleb128 (p, &reg);
607       state->s.saved[reg] = REG_UNSAVED;
608       break;
609
610     case DW_CFA_undefined:
611     case DW_CFA_same_value:
612     case DW_CFA_nop:
613       break;
614
615     case DW_CFA_register:
616       {
617         unsigned reg2;
618         p = decode_uleb128 (p, &reg);
619         p = decode_uleb128 (p, &reg2);
620         state->s.saved[reg] = REG_SAVED_REG;
621         state->s.reg_or_offset[reg] = reg2;
622       }
623       break;
624
625     case DW_CFA_def_cfa:
626       p = decode_uleb128 (p, &reg);
627       p = decode_uleb128 (p, &offset);
628       state->s.cfa_reg = reg;
629       state->s.cfa_offset = offset;
630       break;
631     case DW_CFA_def_cfa_register:
632       p = decode_uleb128 (p, &reg);
633       state->s.cfa_reg = reg;
634       break;
635     case DW_CFA_def_cfa_offset:
636       p = decode_uleb128 (p, &offset);
637       state->s.cfa_offset = offset;
638       break;
639       
640     case DW_CFA_remember_state:
641       {
642         struct frame_state_internal *save =
643           (struct frame_state_internal *)
644           malloc (sizeof (struct frame_state_internal));
645         memcpy (save, state, sizeof (struct frame_state_internal));
646         state->saved_state = save;
647       }
648       break;
649     case DW_CFA_restore_state:
650       {
651         struct frame_state_internal *save = state->saved_state;
652         memcpy (state, save, sizeof (struct frame_state_internal));
653         free (save);
654       }
655       break;
656
657       /* FIXME: Hardcoded for SPARC register window configuration.  */
658     case DW_CFA_GNU_window_save:
659       for (reg = 16; reg < 32; ++reg)
660         {
661           state->s.saved[reg] = REG_SAVED_OFFSET;
662           state->s.reg_or_offset[reg] = (reg - 16) * sizeof (void *);
663         }
664       break;
665
666     case DW_CFA_GNU_args_size:
667       p = decode_uleb128 (p, &offset);
668       state->s.args_size = offset;
669       break;
670
671     default:
672       abort ();
673     }
674   return p;
675 }
676 \f
677 /* Called from crtbegin.o to register the unwind info for an object.  */
678
679 void
680 __register_frame_info (void *begin, struct object *ob)
681 {
682   ob->fde_begin = begin;
683
684   ob->pc_begin = ob->pc_end = 0;
685   ob->fde_array = 0;
686   ob->count = 0;
687
688   __gthread_mutex_lock (&object_mutex);
689
690   ob->next = objects;
691   objects = ob;
692
693   __gthread_mutex_unlock (&object_mutex);
694 }
695
696 void
697 __register_frame (void *begin)
698 {
699   struct object *ob = (struct object *) malloc (sizeof (struct object));
700   __register_frame_info (begin, ob);                       
701 }
702
703 /* Similar, but BEGIN is actually a pointer to a table of unwind entries
704    for different translation units.  Called from the file generated by
705    collect2.  */
706
707 void
708 __register_frame_info_table (void *begin, struct object *ob)
709 {
710   ob->fde_begin = begin;
711   ob->fde_array = begin;
712
713   ob->pc_begin = ob->pc_end = 0;
714   ob->count = 0;
715
716   __gthread_mutex_lock (&object_mutex);
717
718   ob->next = objects;
719   objects = ob;
720
721   __gthread_mutex_unlock (&object_mutex);
722 }
723
724 void
725 __register_frame_table (void *begin)
726 {
727   struct object *ob = (struct object *) malloc (sizeof (struct object));
728   __register_frame_info_table (begin, ob);
729 }
730
731 /* Called from crtbegin.o to deregister the unwind info for an object.  */
732
733 void *
734 __deregister_frame_info (void *begin)
735 {
736   struct object **p;
737
738   __gthread_mutex_lock (&object_mutex);
739
740   p = &objects;
741   while (*p)
742     {
743       if ((*p)->fde_begin == begin)
744         {
745           struct object *ob = *p;
746           *p = (*p)->next;
747
748           /* If we've run init_frame for this object, free the FDE array.  */
749           if (ob->pc_begin)
750             free (ob->fde_array);
751
752           __gthread_mutex_unlock (&object_mutex);
753           return (void *) ob;
754         }
755       p = &((*p)->next);
756     }
757
758   __gthread_mutex_unlock (&object_mutex);
759   abort ();
760 }
761
762 void
763 __deregister_frame (void *begin)
764 {
765   free (__deregister_frame_info (begin));
766 }
767
768 /* Called from __throw to find the registers to restore for a given
769    PC_TARGET.  The caller should allocate a local variable of `struct
770    frame_state' (declared in frame.h) and pass its address to STATE_IN.  */
771
772 struct frame_state *
773 __frame_state_for (void *pc_target, struct frame_state *state_in)
774 {
775   fde *f;
776   void *insn, *end, *pc;
777   struct cie_info info;
778   struct frame_state_internal state;
779
780   f = find_fde (pc_target);
781   if (f == 0)
782     return 0;
783
784   insn = extract_cie_info (f, &info);
785   if (insn == 0)
786     return 0;
787
788   memset (&state, 0, sizeof (state));
789   state.s.retaddr_column = info.ra_regno;
790   state.s.eh_ptr = info.eh_ptr;
791
792   /* First decode all the insns in the CIE.  */
793   end = next_fde ((fde*) get_cie (f));
794   while (insn < end)
795     insn = execute_cfa_insn (insn, &state, &info, 0);
796
797   insn = ((fde *)f) + 1;
798
799   if (info.augmentation[0] == 'z')
800     {
801       int i;
802       insn = decode_uleb128 (insn, &i);
803       insn += i;
804     }
805
806   /* Then the insns in the FDE up to our target PC.  */
807   end = next_fde (f);
808   pc = f->pc_begin;
809   while (insn < end && pc <= pc_target)
810     insn = execute_cfa_insn (insn, &state, &info, &pc);
811
812   memcpy (state_in, &state.s, sizeof (state.s));
813   return state_in;
814 }
815 #endif /* DWARF2_UNWIND_INFO */