1 /* Stack unwinding code based on dwarf2 frame info for GDB, the GNU debugger.
2 Copyright 2001, 2002 Free Software Foundation, Inc.
3 Contributed by Jiri Smid, SuSE Labs.
4 Based on code written by Daniel Berlin (dan@dberlin.org).
6 This file is part of GDB.
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.
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.
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. */
29 #include "elf/dwarf2.h"
32 #include "dwarf2cfi.h"
33 #include "gdb_assert.h"
35 /* Common Information Entry - holds information that is shared among many
39 /* Offset of this unit in .debug_frame or .eh_frame. */
42 /* A null-terminated string that identifies the augmentation to this CIE or
43 to the FDEs that use it. */
46 /* A constant that is factored out of all advance location instructions. */
47 unsigned int code_align
;
49 /* A constant that is factored out of all offset instructions. */
52 /* A constant that indicates which regiter represents the return address
56 /* Indicates how addresses are encoded. */
57 unsigned char addr_encoding
;
59 /* Pointer and length of the cie program. */
61 unsigned int data_length
;
63 struct objfile
*objfile
;
66 struct cie_unit
*next
;
69 /* Frame Description Entry. */
72 /* Address of the first location associated with this entry. */
73 CORE_ADDR initial_location
;
75 /* Length of program section described by this entry. */
76 CORE_ADDR address_range
;
78 /* Pointer to asociated CIE. */
79 struct cie_unit
*cie_ptr
;
81 /* Pointer and length of the cie program. */
83 unsigned int data_length
;
88 struct fde_unit
**array
;
105 REG_CTX_SAVED_OFFSET
,
113 /* This is the register and unwind state for a particular frame. */
116 struct context_reg
*reg
;
124 struct frame_state_reg
145 /* Each register save state can be described in terms of a CFA slot,
146 another register, or a location expression. */
147 struct frame_state_regs
149 struct frame_state_reg
*reg
;
151 /* Used to implement DW_CFA_remember_state. */
152 struct frame_state_regs
*prev
;
156 /* The CFA can be described in terms of a reg+offset or a
157 location expression. */
160 unsigned char *cfa_exp
;
169 /* The PC described by the current frame state. */
172 /* The information we care about from the CIE/FDE. */
174 unsigned int code_align
;
175 unsigned char retaddr_column
;
176 unsigned char addr_encoding
;
178 struct objfile
*objfile
;
183 PE_absptr
= DW_EH_PE_absptr
,
184 PE_pcrel
= DW_EH_PE_pcrel
,
185 PE_textrel
= DW_EH_PE_textrel
,
186 PE_datarel
= DW_EH_PE_datarel
,
187 PE_funcrel
= DW_EH_PE_funcrel
190 #define UNWIND_CONTEXT(fi) ((struct context *) (fi->context))
193 static struct cie_unit
*cie_chunks
;
194 static struct fde_array fde_chunks
;
195 /* Obstack for allocating temporary storage used during unwind operations. */
196 static struct obstack unwind_tmp_obstack
;
198 extern file_ptr dwarf_frame_offset
;
199 extern unsigned int dwarf_frame_size
;
200 extern file_ptr dwarf_eh_frame_offset
;
201 extern unsigned int dwarf_eh_frame_size
;
204 extern char *dwarf2_read_section (struct objfile
*objfile
, file_ptr offset
,
207 static struct fde_unit
*fde_unit_alloc (void);
208 static struct cie_unit
*cie_unit_alloc (void);
209 static void fde_chunks_need_space ();
211 static struct context
*context_alloc ();
212 static struct frame_state
*frame_state_alloc ();
213 static void unwind_tmp_obstack_init ();
214 static void unwind_tmp_obstack_free ();
215 static void context_cpy (struct context
*dst
, struct context
*src
);
217 static unsigned int read_1u (bfd
* abfd
, char **p
);
218 static int read_1s (bfd
* abfd
, char **p
);
219 static unsigned int read_2u (bfd
* abfd
, char **p
);
220 static int read_2s (bfd
* abfd
, char **p
);
221 static unsigned int read_4u (bfd
* abfd
, char **p
);
222 static int read_4s (bfd
* abfd
, char **p
);
223 static ULONGEST
read_8u (bfd
* abfd
, char **p
);
224 static LONGEST
read_8s (bfd
* abfd
, char **p
);
226 static ULONGEST
read_uleb128 (bfd
* abfd
, char **p
);
227 static LONGEST
read_sleb128 (bfd
* abfd
, char **p
);
228 static CORE_ADDR
read_pointer (bfd
* abfd
, char **p
);
229 static CORE_ADDR
read_encoded_pointer (bfd
* abfd
, char **p
,
230 unsigned char encoding
);
231 static enum ptr_encoding
pointer_encoding (unsigned char encoding
);
233 static LONGEST
read_initial_length (bfd
* abfd
, char *buf
, int *bytes_read
);
234 static ULONGEST
read_length (bfd
* abfd
, char *buf
, int *bytes_read
,
237 static int is_cie (ULONGEST cie_id
, int dwarf64
);
238 static int compare_fde_unit (const void *a
, const void *b
);
239 void dwarf2_build_frame_info (struct objfile
*objfile
);
241 static void execute_cfa_program (struct objfile
*objfile
, char *insn_ptr
,
242 char *insn_end
, struct context
*context
,
243 struct frame_state
*fs
);
244 static struct fde_unit
*get_fde_for_addr (CORE_ADDR pc
);
245 static void frame_state_for (struct context
*context
, struct frame_state
*fs
);
246 static void get_reg (char *reg
, struct context
*context
, int regnum
);
247 static CORE_ADDR
execute_stack_op (struct objfile
*objfile
,
248 char *op_ptr
, char *op_end
,
249 struct context
*context
,
251 static void update_context (struct context
*context
, struct frame_state
*fs
,
255 /* Memory allocation functions. */
256 static struct fde_unit
*
257 fde_unit_alloc (void)
259 struct fde_unit
*fde
;
261 fde
= (struct fde_unit
*) xmalloc (sizeof (struct fde_unit
));
262 memset (fde
, 0, sizeof (struct fde_unit
));
266 static struct cie_unit
*
267 cie_unit_alloc (void)
269 struct cie_unit
*cie
;
271 cie
= (struct cie_unit
*) xmalloc (sizeof (struct cie_unit
));
272 memset (cie
, 0, sizeof (struct cie_unit
));
277 fde_chunks_need_space (void)
279 if (fde_chunks
.elems
< fde_chunks
.array_size
)
281 fde_chunks
.array_size
=
282 fde_chunks
.array_size
? 2 * fde_chunks
.array_size
: 1024;
284 xrealloc (fde_chunks
.array
,
285 sizeof (struct fde_unit
) * fde_chunks
.array_size
);
288 /* Alocate a new `struct context' on temporary obstack. */
289 static struct context
*
292 struct context
*context
;
294 int regs_size
= sizeof (struct context_reg
) * NUM_REGS
;
296 context
= (struct context
*) obstack_alloc (&unwind_tmp_obstack
,
297 sizeof (struct context
));
298 memset (context
, 0, sizeof (struct context
));
299 context
->reg
= (struct context_reg
*) obstack_alloc (&unwind_tmp_obstack
,
301 memset (context
->reg
, 0, regs_size
);
305 /* Alocate a new `struct frame_state' on temporary obstack. */
306 static struct frame_state
*
307 frame_state_alloc (void)
309 struct frame_state
*fs
;
311 int regs_size
= sizeof (struct frame_state_reg
) * NUM_REGS
;
313 fs
= (struct frame_state
*) obstack_alloc (&unwind_tmp_obstack
,
314 sizeof (struct frame_state
));
315 memset (fs
, 0, sizeof (struct frame_state
));
317 (struct frame_state_reg
*) obstack_alloc (&unwind_tmp_obstack
, regs_size
);
318 memset (fs
->regs
.reg
, 0, regs_size
);
323 unwind_tmp_obstack_init (void)
325 obstack_init (&unwind_tmp_obstack
);
329 unwind_tmp_obstack_free (void)
331 obstack_free (&unwind_tmp_obstack
, NULL
);
332 unwind_tmp_obstack_init ();
336 context_cpy (struct context
*dst
, struct context
*src
)
338 int regs_size
= sizeof (struct context_reg
) * NUM_REGS
;
339 struct context_reg
*dreg
;
341 /* Structure dst contains a pointer to an array of
342 * registers of a given frame as well as src does. This
343 * array was already allocated before dst was passed to
344 * context_cpy but the pointer to it was overriden by
345 * '*dst = *src' and the array was lost. This led to the
346 * situation, that we've had a copy of src placed in dst,
347 * but both of them pointed to the same regs array and
348 * thus we've sometimes blindly rewritten it. Now we save
349 * the pointer before copying src to dst, return it back
350 * after that and copy the registers into their new place
351 * finally. --- mludvig@suse.cz */
356 memcpy (dst
->reg
, src
->reg
, regs_size
);
360 read_1u (bfd
* abfd
, char **p
)
364 ret
= bfd_get_8 (abfd
, (bfd_byte
*) * p
);
370 read_1s (bfd
* abfd
, char **p
)
374 ret
= bfd_get_signed_8 (abfd
, (bfd_byte
*) * p
);
380 read_2u (bfd
* abfd
, char **p
)
384 ret
= bfd_get_16 (abfd
, (bfd_byte
*) * p
);
390 read_2s (bfd
* abfd
, char **p
)
394 ret
= bfd_get_signed_16 (abfd
, (bfd_byte
*) * p
);
400 read_4u (bfd
* abfd
, char **p
)
404 ret
= bfd_get_32 (abfd
, (bfd_byte
*) * p
);
410 read_4s (bfd
* abfd
, char **p
)
414 ret
= bfd_get_signed_32 (abfd
, (bfd_byte
*) * p
);
420 read_8u (bfd
* abfd
, char **p
)
424 ret
= bfd_get_64 (abfd
, (bfd_byte
*) * p
);
430 read_8s (bfd
* abfd
, char **p
)
434 ret
= bfd_get_signed_64 (abfd
, (bfd_byte
*) * p
);
440 read_uleb128 (bfd
* abfd
, char **p
)
451 byte
= bfd_get_8 (abfd
, (bfd_byte
*) * p
);
453 ret
|= ((unsigned long) (byte
& 127) << shift
);
454 if ((byte
& 128) == 0)
464 read_sleb128 (bfd
* abfd
, char **p
)
467 int i
, shift
, size
, num_read
;
477 byte
= bfd_get_8 (abfd
, (bfd_byte
*) * p
);
479 ret
|= ((long) (byte
& 127) << shift
);
481 if ((byte
& 128) == 0)
486 if ((shift
< size
) && (byte
& 0x40))
488 ret
|= -(1 << shift
);
494 read_pointer (bfd
* abfd
, char **p
)
496 switch (TARGET_ADDR_BIT
/ TARGET_CHAR_BIT
)
499 return read_4u (abfd
, p
);
501 return read_8u (abfd
, p
);
503 error ("dwarf cfi error: unsupported target address length.");
507 /* This functions only reads appropriate amount of data from *p
508 * and returns the resulting value. Calling function must handle
509 * different encoding possibilities itself! */
511 read_encoded_pointer (bfd
* abfd
, char **p
, unsigned char encoding
)
515 switch (encoding
& 0x0f)
517 case DW_EH_PE_absptr
:
518 ret
= read_pointer (abfd
, p
);
521 case DW_EH_PE_uleb128
:
522 ret
= read_uleb128 (abfd
, p
);
524 case DW_EH_PE_sleb128
:
525 ret
= read_sleb128 (abfd
, p
);
528 case DW_EH_PE_udata2
:
529 ret
= read_2u (abfd
, p
);
531 case DW_EH_PE_udata4
:
532 ret
= read_4u (abfd
, p
);
534 case DW_EH_PE_udata8
:
535 ret
= read_8u (abfd
, p
);
538 case DW_EH_PE_sdata2
:
539 ret
= read_2s (abfd
, p
);
541 case DW_EH_PE_sdata4
:
542 ret
= read_4s (abfd
, p
);
544 case DW_EH_PE_sdata8
:
545 ret
= read_8s (abfd
, p
);
549 internal_error (__FILE__
, __LINE__
,
550 "read_encoded_pointer: unknown pointer encoding");
556 /* Variable 'encoding' carries 3 different flags:
557 * - encoding & 0x0f : size of the address (handled in read_encoded_pointer())
558 * - encoding & 0x70 : type (absolute, relative, ...)
559 * - encoding & 0x80 : indirect flag (DW_EH_PE_indirect == 0x80). */
561 pointer_encoding (unsigned char encoding
)
565 if (encoding
& DW_EH_PE_indirect
)
566 warning ("CFI: Unsupported pointer encoding: DW_EH_PE_indirect");
568 switch (encoding
& 0x70)
570 case DW_EH_PE_absptr
:
572 case DW_EH_PE_textrel
:
573 case DW_EH_PE_datarel
:
574 case DW_EH_PE_funcrel
:
575 ret
= encoding
& 0x70;
578 internal_error (__FILE__
, __LINE__
, "CFI: unknown pointer encoding");
584 read_initial_length (bfd
* abfd
, char *buf
, int *bytes_read
)
588 ret
= bfd_get_32 (abfd
, (bfd_byte
*) buf
);
590 if (ret
== 0xffffffff)
592 ret
= bfd_get_64 (abfd
, (bfd_byte
*) buf
+ 4);
604 read_length (bfd
* abfd
, char *buf
, int *bytes_read
, int dwarf64
)
609 return read_8u (abfd
, &buf
);
614 return read_4u (abfd
, &buf
);
619 execute_cfa_program (struct objfile
*objfile
, char *insn_ptr
, char *insn_end
,
620 struct context
*context
, struct frame_state
*fs
)
622 struct frame_state_regs
*unused_rs
= NULL
;
624 /* Don't allow remember/restore between CIE and FDE programs. */
625 fs
->regs
.prev
= NULL
;
627 while (insn_ptr
< insn_end
&& fs
->pc
< context
->ra
)
629 unsigned char insn
= *insn_ptr
++;
630 ULONGEST reg
, uoffset
;
633 if (insn
& DW_CFA_advance_loc
)
634 fs
->pc
+= (insn
& 0x3f) * fs
->code_align
;
635 else if (insn
& DW_CFA_offset
)
638 uoffset
= read_uleb128 (objfile
->obfd
, &insn_ptr
);
639 offset
= (long) uoffset
*fs
->data_align
;
640 fs
->regs
.reg
[reg
].how
= REG_SAVED_OFFSET
;
641 fs
->regs
.reg
[reg
].loc
.offset
= offset
;
643 else if (insn
& DW_CFA_restore
)
646 fs
->regs
.reg
[reg
].how
= REG_UNSAVED
;
652 fs
->pc
= read_encoded_pointer (objfile
->obfd
, &insn_ptr
,
655 if (pointer_encoding (fs
->addr_encoding
) != PE_absptr
)
656 warning ("CFI: DW_CFA_set_loc uses relative addressing");
660 case DW_CFA_advance_loc1
:
661 fs
->pc
+= read_1u (objfile
->obfd
, &insn_ptr
);
663 case DW_CFA_advance_loc2
:
664 fs
->pc
+= read_2u (objfile
->obfd
, &insn_ptr
);
666 case DW_CFA_advance_loc4
:
667 fs
->pc
+= read_4u (objfile
->obfd
, &insn_ptr
);
670 case DW_CFA_offset_extended
:
671 reg
= read_uleb128 (objfile
->obfd
, &insn_ptr
);
672 uoffset
= read_uleb128 (objfile
->obfd
, &insn_ptr
);
673 offset
= (long) uoffset
*fs
->data_align
;
674 fs
->regs
.reg
[reg
].how
= REG_SAVED_OFFSET
;
675 fs
->regs
.reg
[reg
].loc
.offset
= offset
;
678 case DW_CFA_restore_extended
:
679 reg
= read_uleb128 (objfile
->obfd
, &insn_ptr
);
680 fs
->regs
.reg
[reg
].how
= REG_UNSAVED
;
683 case DW_CFA_undefined
:
684 case DW_CFA_same_value
:
688 case DW_CFA_register
:
691 reg
= read_uleb128 (objfile
->obfd
, &insn_ptr
);
692 reg2
= read_uleb128 (objfile
->obfd
, &insn_ptr
);
693 fs
->regs
.reg
[reg
].how
= REG_SAVED_REG
;
694 fs
->regs
.reg
[reg
].loc
.reg
= reg2
;
698 case DW_CFA_remember_state
:
700 struct frame_state_regs
*new_rs
;
704 unused_rs
= unused_rs
->prev
;
707 new_rs
= xmalloc (sizeof (struct frame_state_regs
));
710 fs
->regs
.prev
= new_rs
;
714 case DW_CFA_restore_state
:
716 struct frame_state_regs
*old_rs
= fs
->regs
.prev
;
718 old_rs
->prev
= unused_rs
;
724 reg
= read_uleb128 (objfile
->obfd
, &insn_ptr
);
725 uoffset
= read_uleb128 (objfile
->obfd
, &insn_ptr
);
727 fs
->cfa_offset
= uoffset
;
728 fs
->cfa_how
= CFA_REG_OFFSET
;
731 case DW_CFA_def_cfa_register
:
732 reg
= read_uleb128 (objfile
->obfd
, &insn_ptr
);
734 fs
->cfa_how
= CFA_REG_OFFSET
;
737 case DW_CFA_def_cfa_offset
:
738 uoffset
= read_uleb128 (objfile
->obfd
, &insn_ptr
);
739 fs
->cfa_offset
= uoffset
;
742 case DW_CFA_def_cfa_expression
:
743 uoffset
= read_uleb128 (objfile
->obfd
, &insn_ptr
);
744 fs
->cfa_exp
= insn_ptr
;
745 fs
->cfa_how
= CFA_EXP
;
749 case DW_CFA_expression
:
750 reg
= read_uleb128 (objfile
->obfd
, &insn_ptr
);
751 uoffset
= read_uleb128 (objfile
->obfd
, &insn_ptr
);
752 fs
->regs
.reg
[reg
].how
= REG_SAVED_EXP
;
753 fs
->regs
.reg
[reg
].loc
.exp
= insn_ptr
;
757 /* From the 2.1 draft. */
758 case DW_CFA_offset_extended_sf
:
759 reg
= read_uleb128 (objfile
->obfd
, &insn_ptr
);
760 offset
= read_sleb128 (objfile
->obfd
, &insn_ptr
);
761 offset
*= fs
->data_align
;
762 fs
->regs
.reg
[reg
].how
= REG_SAVED_OFFSET
;
763 fs
->regs
.reg
[reg
].loc
.offset
= offset
;
766 case DW_CFA_def_cfa_sf
:
767 reg
= read_uleb128 (objfile
->obfd
, &insn_ptr
);
768 offset
= read_sleb128 (objfile
->obfd
, &insn_ptr
);
769 fs
->cfa_offset
= offset
;
771 fs
->cfa_how
= CFA_REG_OFFSET
;
774 case DW_CFA_def_cfa_offset_sf
:
775 uoffset
= read_uleb128 (objfile
->obfd
, &insn_ptr
);
776 fs
->cfa_offset
= uoffset
;
777 /* cfa_how deliberately not set. */
780 case DW_CFA_GNU_window_save
:
781 /* ??? Hardcoded for SPARC register window configuration. */
782 for (reg
= 16; reg
< 32; ++reg
)
784 fs
->regs
.reg
[reg
].how
= REG_SAVED_OFFSET
;
785 fs
->regs
.reg
[reg
].loc
.offset
= (reg
- 16) * sizeof (void *);
789 case DW_CFA_GNU_args_size
:
790 uoffset
= read_uleb128 (objfile
->obfd
, &insn_ptr
);
791 context
->args_size
= uoffset
;
794 case DW_CFA_GNU_negative_offset_extended
:
795 /* Obsoleted by DW_CFA_offset_extended_sf, but used by
796 older PowerPC code. */
797 reg
= read_uleb128 (objfile
->obfd
, &insn_ptr
);
798 uoffset
= read_uleb128 (objfile
->obfd
, &insn_ptr
);
799 offset
= (long) uoffset
*fs
->data_align
;
800 fs
->regs
.reg
[reg
].how
= REG_SAVED_OFFSET
;
801 fs
->regs
.reg
[reg
].loc
.offset
= -offset
;
805 error ("dwarf cfi error: unknown cfa instruction %d.", insn
);
810 static struct fde_unit
*
811 get_fde_for_addr (CORE_ADDR pc
)
814 struct fde_unit
*fde
= NULL
;
816 hi
= fde_chunks
.elems
;
820 size_t i
= (lo
+ hi
) / 2;
821 fde
= fde_chunks
.array
[i
];
822 if (pc
< fde
->initial_location
)
824 else if (pc
>= fde
->initial_location
+ fde
->address_range
)
833 frame_state_for (struct context
*context
, struct frame_state
*fs
)
835 struct fde_unit
*fde
;
836 struct cie_unit
*cie
;
838 context
->args_size
= 0;
841 fde
= get_fde_for_addr (context
->ra
- 1);
846 fs
->pc
= fde
->initial_location
;
848 gdb_assert (fde
->cie_ptr
!= NULL
);
852 fs
->code_align
= cie
->code_align
;
853 fs
->data_align
= cie
->data_align
;
854 fs
->retaddr_column
= cie
->ra
;
855 fs
->addr_encoding
= cie
->addr_encoding
;
856 fs
->objfile
= cie
->objfile
;
858 execute_cfa_program (cie
->objfile
, cie
->data
,
859 cie
->data
+ cie
->data_length
, context
, fs
);
860 execute_cfa_program (cie
->objfile
, fde
->data
,
861 fde
->data
+ fde
->data_length
, context
, fs
);
865 get_reg (char *reg
, struct context
*context
, int regnum
)
867 switch (context
->reg
[regnum
].how
)
869 case REG_CTX_UNSAVED
:
870 read_register_gen (regnum
, reg
);
872 case REG_CTX_SAVED_OFFSET
:
873 target_read_memory (context
->cfa
+ context
->reg
[regnum
].loc
.offset
,
874 reg
, REGISTER_RAW_SIZE (regnum
));
876 case REG_CTX_SAVED_REG
:
877 read_register_gen (context
->reg
[regnum
].loc
.reg
, reg
);
879 case REG_CTX_SAVED_ADDR
:
880 target_read_memory (context
->reg
[regnum
].loc
.addr
,
881 reg
, REGISTER_RAW_SIZE (regnum
));
884 memcpy (reg
, &context
->reg
[regnum
].loc
.addr
,
885 REGISTER_RAW_SIZE (regnum
));
888 internal_error (__FILE__
, __LINE__
, "get_reg: unknown register rule");
892 /* Decode a DW_OP stack program. Return the top of stack. Push INITIAL
893 onto the stack to start. */
895 execute_stack_op (struct objfile
*objfile
,
896 char *op_ptr
, char *op_end
, struct context
*context
,
899 CORE_ADDR stack
[64]; /* ??? Assume this is enough. */
905 while (op_ptr
< op_end
)
907 enum dwarf_location_atom op
= *op_ptr
++;
946 result
= op
- DW_OP_lit0
;
950 result
= read_pointer (objfile
->obfd
, &op_ptr
);
954 result
= read_1u (objfile
->obfd
, &op_ptr
);
957 result
= read_1s (objfile
->obfd
, &op_ptr
);
960 result
= read_2u (objfile
->obfd
, &op_ptr
);
963 result
= read_2s (objfile
->obfd
, &op_ptr
);
966 result
= read_4u (objfile
->obfd
, &op_ptr
);
969 result
= read_4s (objfile
->obfd
, &op_ptr
);
972 result
= read_8u (objfile
->obfd
, &op_ptr
);
975 result
= read_8s (objfile
->obfd
, &op_ptr
);
978 result
= read_uleb128 (objfile
->obfd
, &op_ptr
);
981 result
= read_sleb128 (objfile
->obfd
, &op_ptr
);
1016 get_reg ((char *) &result
, context
, op
- DW_OP_reg0
);
1019 reg
= read_uleb128 (objfile
->obfd
, &op_ptr
);
1020 get_reg ((char *) &result
, context
, reg
);
1055 offset
= read_sleb128 (objfile
->obfd
, &op_ptr
);
1056 get_reg ((char *) &result
, context
, op
- DW_OP_breg0
);
1060 reg
= read_uleb128 (objfile
->obfd
, &op_ptr
);
1061 offset
= read_sleb128 (objfile
->obfd
, &op_ptr
);
1062 get_reg ((char *) &result
, context
, reg
);
1068 internal_error (__FILE__
, __LINE__
, "execute_stack_op error");
1069 result
= stack
[stack_elt
- 1];
1073 if (--stack_elt
< 0)
1074 internal_error (__FILE__
, __LINE__
, "execute_stack_op error");
1079 if (offset
>= stack_elt
- 1)
1080 internal_error (__FILE__
, __LINE__
, "execute_stack_op error");
1081 result
= stack
[stack_elt
- 1 - offset
];
1086 internal_error (__FILE__
, __LINE__
, "execute_stack_op error");
1087 result
= stack
[stack_elt
- 2];
1092 CORE_ADDR t1
, t2
, t3
;
1095 internal_error (__FILE__
, __LINE__
, "execute_stack_op error");
1096 t1
= stack
[stack_elt
- 1];
1097 t2
= stack
[stack_elt
- 2];
1098 t3
= stack
[stack_elt
- 3];
1099 stack
[stack_elt
- 1] = t2
;
1100 stack
[stack_elt
- 2] = t3
;
1101 stack
[stack_elt
- 3] = t1
;
1106 case DW_OP_deref_size
:
1110 case DW_OP_plus_uconst
:
1111 /* Unary operations. */
1112 if (--stack_elt
< 0)
1113 internal_error (__FILE__
, __LINE__
, "execute_stack_op error");
1114 result
= stack
[stack_elt
];
1120 int len
= TARGET_ADDR_BIT
/ TARGET_CHAR_BIT
;
1121 if (len
!= 4 && len
!= 8)
1122 internal_error (__FILE__
, __LINE__
,
1123 "execute_stack_op error");
1124 result
= read_memory_unsigned_integer (result
, len
);
1128 case DW_OP_deref_size
:
1130 int len
= *op_ptr
++;
1131 if (len
!= 1 && len
!= 2 && len
!= 4 && len
!=8)
1132 internal_error (__FILE__
, __LINE__
,
1133 "execute_stack_op error");
1134 result
= read_memory_unsigned_integer (result
, len
);
1148 case DW_OP_plus_uconst
:
1149 result
+= read_uleb128 (objfile
->obfd
, &op_ptr
);
1170 /* Binary operations. */
1171 CORE_ADDR first
, second
;
1172 if ((stack_elt
-= 2) < 0)
1173 internal_error (__FILE__
, __LINE__
, "execute_stack_op error");
1174 second
= stack
[stack_elt
];
1175 first
= stack
[stack_elt
+ 1];
1180 result
= second
& first
;
1183 result
= (LONGEST
) second
/ (LONGEST
) first
;
1186 result
= second
- first
;
1189 result
= (LONGEST
) second
% (LONGEST
) first
;
1192 result
= second
* first
;
1195 result
= second
| first
;
1198 result
= second
+ first
;
1201 result
= second
<< first
;
1204 result
= second
>> first
;
1207 result
= (LONGEST
) second
>> first
;
1210 result
= second
^ first
;
1213 result
= (LONGEST
) first
<= (LONGEST
) second
;
1216 result
= (LONGEST
) first
>= (LONGEST
) second
;
1219 result
= (LONGEST
) first
== (LONGEST
) second
;
1222 result
= (LONGEST
) first
< (LONGEST
) second
;
1225 result
= (LONGEST
) first
> (LONGEST
) second
;
1228 result
= (LONGEST
) first
!= (LONGEST
) second
;
1230 default: /* This label is here just to avoid warning. */
1237 offset
= read_2s (objfile
->obfd
, &op_ptr
);
1242 if (--stack_elt
< 0)
1243 internal_error (__FILE__
, __LINE__
, "execute_stack_op error");
1244 offset
= read_2s (objfile
->obfd
, &op_ptr
);
1245 if (stack
[stack_elt
] != 0)
1253 internal_error (__FILE__
, __LINE__
, "execute_stack_op error");
1256 /* Most things push a result value. */
1257 if ((size_t) stack_elt
>= sizeof (stack
) / sizeof (*stack
))
1258 internal_error (__FILE__
, __LINE__
, "execute_stack_op error");
1259 stack
[++stack_elt
] = result
;
1263 /* We were executing this program to get a value. It should be
1265 if (--stack_elt
< 0)
1266 internal_error (__FILE__
, __LINE__
, "execute_stack_op error");
1267 return stack
[stack_elt
];
1271 update_context (struct context
*context
, struct frame_state
*fs
, int chain
)
1273 struct context
*orig_context
;
1277 unwind_tmp_obstack_init ();
1279 orig_context
= context_alloc ();
1280 context_cpy (orig_context
, context
);
1282 /* Compute this frame's CFA. */
1283 switch (fs
->cfa_how
)
1285 case CFA_REG_OFFSET
:
1286 get_reg ((char *) &cfa
, context
, fs
->cfa_reg
);
1287 cfa
+= fs
->cfa_offset
;
1291 /* ??? No way of knowing what register number is the stack pointer
1292 to do the same sort of handling as above. Assume that if the
1293 CFA calculation is so complicated as to require a stack program
1294 that this will not be a problem. */
1296 char *exp
= fs
->cfa_exp
;
1299 len
= read_uleb128 (fs
->objfile
->obfd
, &exp
);
1300 cfa
= (CORE_ADDR
) execute_stack_op (fs
->objfile
, exp
,
1301 exp
+ len
, context
, 0);
1310 orig_context
->cfa
= cfa
;
1312 /* Compute the addresses of all registers saved in this frame. */
1313 for (i
= 0; i
< NUM_REGS
; ++i
)
1314 switch (fs
->regs
.reg
[i
].how
)
1319 context
->reg
[i
].how
= REG_CTX_VALUE
;
1320 context
->reg
[i
].loc
.addr
= cfa
;
1323 context
->reg
[i
].how
= REG_CTX_UNSAVED
;
1325 case REG_SAVED_OFFSET
:
1326 context
->reg
[i
].how
= REG_CTX_SAVED_OFFSET
;
1327 context
->reg
[i
].loc
.offset
= fs
->regs
.reg
[i
].loc
.offset
;
1330 switch (orig_context
->reg
[fs
->regs
.reg
[i
].loc
.reg
].how
)
1332 case REG_CTX_UNSAVED
:
1333 context
->reg
[i
].how
= REG_CTX_UNSAVED
;
1335 case REG_CTX_SAVED_OFFSET
:
1336 context
->reg
[i
].how
= REG_CTX_SAVED_OFFSET
;
1337 context
->reg
[i
].loc
.offset
= orig_context
->cfa
- context
->cfa
+
1338 orig_context
->reg
[fs
->regs
.reg
[i
].loc
.reg
].loc
.offset
;
1340 case REG_CTX_SAVED_REG
:
1341 context
->reg
[i
].how
= REG_CTX_SAVED_REG
;
1342 context
->reg
[i
].loc
.reg
=
1343 orig_context
->reg
[fs
->regs
.reg
[i
].loc
.reg
].loc
.reg
;
1345 case REG_CTX_SAVED_ADDR
:
1346 context
->reg
[i
].how
= REG_CTX_SAVED_ADDR
;
1347 context
->reg
[i
].loc
.addr
=
1348 orig_context
->reg
[fs
->regs
.reg
[i
].loc
.reg
].loc
.addr
;
1351 internal_error (__FILE__
, __LINE__
, "bad switch");
1356 char *exp
= fs
->regs
.reg
[i
].loc
.exp
;
1360 len
= read_uleb128 (fs
->objfile
->obfd
, &exp
);
1361 val
= execute_stack_op (fs
->objfile
, exp
, exp
+ len
,
1363 context
->reg
[i
].how
= REG_CTX_SAVED_ADDR
;
1364 context
->reg
[i
].loc
.addr
= val
;
1368 internal_error (__FILE__
, __LINE__
, "bad switch");
1370 get_reg ((char *) &context
->ra
, context
, fs
->retaddr_column
);
1371 unwind_tmp_obstack_free ();
1375 is_cie (ULONGEST cie_id
, int dwarf64
)
1377 return dwarf64
? (cie_id
== 0xffffffffffffffff) : (cie_id
== 0xffffffff);
1381 compare_fde_unit (const void *a
, const void *b
)
1383 struct fde_unit
**first
, **second
;
1384 first
= (struct fde_unit
**) a
;
1385 second
= (struct fde_unit
**) b
;
1386 if ((*first
)->initial_location
> (*second
)->initial_location
)
1388 else if ((*first
)->initial_location
< (*second
)->initial_location
)
1394 /* Build the cie_chunks and fde_chunks tables from informations
1395 found in .debug_frame and .eh_frame sections. */
1396 /* We can handle both of these sections almost in the same way, however there
1397 are some exceptions:
1398 - CIE ID is -1 in debug_frame, but 0 in eh_frame
1399 - eh_frame may contain some more information that are used only by gcc
1400 (eg. personality pointer, LSDA pointer, ...). Most of them we can ignore.
1401 - In debug_frame FDE's item cie_id contains offset of it's parent CIE.
1402 In eh_frame FDE's item cie_id is a relative pointer to the parent CIE.
1403 Anyway we don't need to bother with this, because we are smart enough
1404 to keep the pointer to the parent CIE of oncomming FDEs in 'last_cie'.
1405 - Although debug_frame items can contain Augmentation as well as
1406 eh_frame ones, I have never seen them non-empty. Thus only in eh_frame
1407 we can encounter for example non-absolute pointers (Aug. 'R').
1410 parse_frame_info (struct objfile
*objfile
, file_ptr frame_offset
,
1411 unsigned int frame_size
, int eh_frame
)
1413 bfd
*abfd
= objfile
->obfd
;
1414 asection
*curr_section_ptr
;
1417 char *frame_buffer
= NULL
;
1418 char *curr_section_name
, *aug_data
;
1419 struct cie_unit
*last_cie
= NULL
;
1420 int last_dup_fde
= 0;
1422 CORE_ADDR curr_section_vma
= 0;
1424 unwind_tmp_obstack_init ();
1426 frame_buffer
= dwarf2_read_section (objfile
, frame_offset
, frame_size
);
1428 start
= frame_buffer
;
1429 end
= frame_buffer
+ frame_size
;
1431 curr_section_name
= eh_frame
? ".eh_frame" : ".debug_frame";
1432 curr_section_ptr
= bfd_get_section_by_name (abfd
, curr_section_name
);
1433 if (curr_section_ptr
)
1434 curr_section_vma
= curr_section_ptr
->vma
;
1440 unsigned long length
;
1442 ULONGEST unit_offset
= start
- frame_buffer
;
1443 int bytes_read
, dwarf64
;
1446 length
= read_initial_length (abfd
, start
, &bytes_read
);
1447 start
+= bytes_read
;
1448 dwarf64
= (bytes_read
== 12);
1449 block_end
= start
+ length
;
1457 cie_id
= read_length (abfd
, start
, &bytes_read
, dwarf64
);
1458 start
+= bytes_read
;
1460 if ((eh_frame
&& cie_id
== 0) || is_cie (cie_id
, dwarf64
))
1462 struct cie_unit
*cie
= cie_unit_alloc ();
1465 cie
->objfile
= objfile
;
1466 cie
->next
= cie_chunks
;
1469 cie
->objfile
= objfile
;
1471 cie
->offset
= unit_offset
;
1473 start
++; /* version */
1475 cie
->augmentation
= aug
= start
;
1476 while (*start
++); /* Skips last NULL as well */
1478 cie
->code_align
= read_uleb128 (abfd
, &start
);
1479 cie
->data_align
= read_sleb128 (abfd
, &start
);
1480 cie
->ra
= read_1u (abfd
, &start
);
1483 z Indicates that a uleb128 is present to size the
1484 augmentation section.
1485 L Indicates the encoding (and thus presence) of
1486 an LSDA pointer in the FDE augmentation.
1487 R Indicates a non-default pointer encoding for
1489 P Indicates the presence of an encoding + language
1490 personality routine in the CIE augmentation.
1492 [This info comes from GCC's dwarf2out.c]
1496 aug_len
= read_uleb128 (abfd
, &start
);
1503 cie
->data_length
= block_end
- cie
->data
;
1505 while (*aug
!= '\0')
1507 if (aug
[0] == 'e' && aug
[1] == 'h')
1509 aug_data
+= sizeof (void *);
1512 else if (aug
[0] == 'R')
1513 cie
->addr_encoding
= *aug_data
++;
1514 else if (aug
[0] == 'P')
1516 CORE_ADDR pers_addr
;
1519 pers_addr_enc
= *aug_data
++;
1520 /* We don't need pers_addr value and so we
1521 don't care about it's encoding. */
1522 pers_addr
= read_encoded_pointer (abfd
, &aug_data
,
1525 else if (aug
[0] == 'L' && eh_frame
)
1529 /* Perhaps we should save this to CIE for later use?
1530 Do we need it for something in GDB? */
1531 lsda_addr_enc
= *aug_data
++;
1534 warning ("CFI warning: unknown augmentation \"%c\""
1536 "\t%s", aug
[0], curr_section_name
,
1545 struct fde_unit
*fde
;
1546 struct cie_unit
*cie
;
1550 /* We assume that debug_frame is in order
1551 CIE,FDE,CIE,FDE,FDE,... and thus the CIE for this FDE
1552 should be stored in last_cie pointer. If not, we'll
1553 try to find it by the older way. */
1558 warning ("CFI: last_cie == NULL. "
1559 "Perhaps a malformed %s section in '%s'...?\n",
1560 curr_section_name
, objfile
->name
);
1565 if (cie
->objfile
== objfile
)
1569 (unit_offset
+ bytes_read
- cie_id
)))
1571 if (!eh_frame
&& (cie
->offset
== cie_id
))
1578 error ("CFI: can't find CIE pointer");
1581 init_loc
= read_encoded_pointer (abfd
, &start
,
1582 cie
->addr_encoding
);
1584 switch (pointer_encoding (cie
->addr_encoding
))
1589 /* start-frame_buffer gives offset from
1590 the beginning of actual section. */
1591 init_loc
+= curr_section_vma
+ start
- frame_buffer
;
1594 warning ("CFI: Unsupported pointer encoding\n");
1597 /* For relocatable objects we must add an offset telling
1598 where the section is actually mapped in the memory. */
1599 init_loc
+= ANOFFSET (objfile
->section_offsets
,
1600 SECT_OFF_TEXT (objfile
));
1602 /* If we have both .debug_frame and .eh_frame present in
1603 a file, we must eliminate duplicate FDEs. For now we'll
1604 run through all entries in fde_chunks and check it one
1605 by one. Perhaps in the future we can implement a faster
1606 searching algorithm. */
1607 /* eh_frame==2 indicates, that this file has an already
1608 parsed .debug_frame too. When eh_frame==1 it means, that no
1609 .debug_frame is present and thus we don't need to check for
1610 duplicities. eh_frame==0 means, that we parse .debug_frame
1611 and don't need to care about duplicate FDEs, because
1612 .debug_frame is parsed first. */
1614 for (i
= 0; eh_frame
== 2 && i
< fde_chunks
.elems
; i
++)
1616 /* We assume that FDEs in .debug_frame and .eh_frame
1617 have the same order (if they are present, of course).
1618 If we find a duplicate entry for one FDE and save
1619 it's index to last_dup_fde it's very likely, that
1620 we'll find an entry for the following FDE right after
1621 the previous one. Thus in many cases we'll run this
1623 last_dup_fde
= (last_dup_fde
+ i
) % fde_chunks
.elems
;
1624 if (fde_chunks
.array
[last_dup_fde
]->initial_location
1632 /* Allocate a new entry only if this FDE isn't a duplicate of
1633 something we have already seen. */
1636 fde_chunks_need_space ();
1637 fde
= fde_unit_alloc ();
1639 fde_chunks
.array
[fde_chunks
.elems
++] = fde
;
1641 fde
->initial_location
= init_loc
;
1642 fde
->address_range
= read_encoded_pointer (abfd
, &start
,
1648 /* Here we intentionally ignore augmentation data
1649 from FDE, because we don't need them. */
1650 if (cie
->augmentation
[0] == 'z')
1651 start
+= read_uleb128 (abfd
, &start
);
1654 fde
->data_length
= block_end
- start
;
1659 qsort (fde_chunks
.array
, fde_chunks
.elems
,
1660 sizeof (struct fde_unit
*), compare_fde_unit
);
1664 /* We must parse both .debug_frame section and .eh_frame because
1665 * not all frames must be present in both of these sections. */
1667 dwarf2_build_frame_info (struct objfile
*objfile
)
1669 int after_debug_frame
= 0;
1671 /* If we have .debug_frame then the parser is called with
1672 eh_frame==0 for .debug_frame and eh_frame==2 for .eh_frame,
1673 otherwise it's only called once for .eh_frame with argument
1676 if (dwarf_frame_offset
)
1678 parse_frame_info (objfile
, dwarf_frame_offset
,
1679 dwarf_frame_size
, 0 /* = debug_frame */ );
1680 after_debug_frame
= 1;
1683 if (dwarf_eh_frame_offset
)
1684 parse_frame_info (objfile
, dwarf_eh_frame_offset
, dwarf_eh_frame_size
,
1685 1 /* = eh_frame */ + after_debug_frame
);
1688 /* Return the frame address. */
1692 struct context
*context
;
1693 struct frame_state
*fs
;
1696 unwind_tmp_obstack_init ();
1698 context
= context_alloc ();
1699 fs
= frame_state_alloc ();
1701 context
->ra
= read_pc () + 1;
1703 frame_state_for (context
, fs
);
1704 update_context (context
, fs
, 0);
1708 unwind_tmp_obstack_free ();
1713 /* Store the frame address. This function is not used. */
1716 cfi_write_fp (CORE_ADDR val
)
1718 struct context
*context
;
1719 struct frame_state
*fs
;
1721 unwind_tmp_obstack_init ();
1723 context
= context_alloc ();
1724 fs
= frame_state_alloc ();
1726 context
->ra
= read_pc () + 1;
1728 frame_state_for (context
, fs
);
1730 if (fs
->cfa_how
== CFA_REG_OFFSET
)
1732 val
-= fs
->cfa_offset
;
1733 write_register_gen (fs
->cfa_reg
, (char *) &val
);
1736 warning ("Can't write fp.");
1738 unwind_tmp_obstack_free ();
1741 /* Restore the machine to the state it had before the current frame
1744 cfi_pop_frame (struct frame_info
*fi
)
1746 char *regbuf
= alloca (MAX_REGISTER_RAW_SIZE
);
1749 for (regnum
= 0; regnum
< NUM_REGS
; regnum
++)
1751 get_reg (regbuf
, UNWIND_CONTEXT (fi
), regnum
);
1752 write_register_bytes (REGISTER_BYTE (regnum
), regbuf
,
1753 REGISTER_RAW_SIZE (regnum
));
1755 write_register (PC_REGNUM
, UNWIND_CONTEXT (fi
)->ra
);
1757 flush_cached_frames ();
1760 /* Determine the address of the calling function's frame. */
1762 cfi_frame_chain (struct frame_info
*fi
)
1764 struct context
*context
;
1765 struct frame_state
*fs
;
1768 unwind_tmp_obstack_init ();
1770 context
= context_alloc ();
1771 fs
= frame_state_alloc ();
1772 context_cpy (context
, UNWIND_CONTEXT (fi
));
1774 /* outermost frame */
1775 if (context
->ra
== 0)
1777 unwind_tmp_obstack_free ();
1781 frame_state_for (context
, fs
);
1782 update_context (context
, fs
, 1);
1785 unwind_tmp_obstack_free ();
1790 /* Sets the pc of the frame. */
1792 cfi_init_frame_pc (int fromleaf
, struct frame_info
*fi
)
1795 get_reg ((char *) &(fi
->pc
), UNWIND_CONTEXT (fi
->next
), PC_REGNUM
);
1797 fi
->pc
= read_pc ();
1800 /* Initialize unwind context informations of the frame. */
1802 cfi_init_extra_frame_info (int fromleaf
, struct frame_info
*fi
)
1804 struct frame_state
*fs
;
1806 unwind_tmp_obstack_init ();
1808 fs
= frame_state_alloc ();
1809 fi
->context
= frame_obstack_alloc (sizeof (struct context
));
1810 UNWIND_CONTEXT (fi
)->reg
=
1811 frame_obstack_alloc (sizeof (struct context_reg
) * NUM_REGS
);
1812 memset (UNWIND_CONTEXT (fi
)->reg
, 0,
1813 sizeof (struct context_reg
) * NUM_REGS
);
1817 context_cpy (UNWIND_CONTEXT (fi
), UNWIND_CONTEXT (fi
->next
));
1818 frame_state_for (UNWIND_CONTEXT (fi
), fs
);
1819 update_context (UNWIND_CONTEXT (fi
), fs
, 1);
1823 UNWIND_CONTEXT (fi
)->ra
= fi
->pc
+ 1;
1824 frame_state_for (UNWIND_CONTEXT (fi
), fs
);
1825 update_context (UNWIND_CONTEXT (fi
), fs
, 0);
1828 unwind_tmp_obstack_free ();
1831 /* Obtain return address of the frame. */
1833 cfi_get_ra (struct frame_info
*fi
)
1835 return UNWIND_CONTEXT (fi
)->ra
;
1838 /* Find register number REGNUM relative to FRAME and put its
1839 (raw) contents in *RAW_BUFFER. Set *OPTIMIZED if the variable
1840 was optimized out (and thus can't be fetched). If the variable
1841 was fetched from memory, set *ADDRP to where it was fetched from,
1842 otherwise it was fetched from a register.
1844 The argument RAW_BUFFER must point to aligned memory. */
1846 cfi_get_saved_register (char *raw_buffer
,
1849 struct frame_info
*frame
,
1850 int regnum
, enum lval_type
*lval
)
1852 if (!target_has_registers
)
1853 error ("No registers.");
1855 /* Normal systems don't optimize out things with register numbers. */
1856 if (optimized
!= NULL
)
1859 if (addrp
) /* default assumption: not found in memory */
1864 read_register_gen (regnum
, raw_buffer
);
1866 *lval
= lval_register
;
1868 *addrp
= REGISTER_BYTE (regnum
);
1872 frame
= frame
->next
;
1873 switch (UNWIND_CONTEXT (frame
)->reg
[regnum
].how
)
1875 case REG_CTX_UNSAVED
:
1876 read_register_gen (regnum
, raw_buffer
);
1879 if (optimized
!= NULL
)
1882 case REG_CTX_SAVED_OFFSET
:
1883 target_read_memory (UNWIND_CONTEXT (frame
)->cfa
+
1884 UNWIND_CONTEXT (frame
)->reg
[regnum
].loc
.offset
,
1885 raw_buffer
, REGISTER_RAW_SIZE (regnum
));
1887 *lval
= lval_memory
;
1890 UNWIND_CONTEXT (frame
)->cfa
+
1891 UNWIND_CONTEXT (frame
)->reg
[regnum
].loc
.offset
;
1893 case REG_CTX_SAVED_REG
:
1894 read_register_gen (UNWIND_CONTEXT (frame
)->reg
[regnum
].loc
.reg
,
1897 *lval
= lval_register
;
1900 REGISTER_BYTE (UNWIND_CONTEXT (frame
)->reg
[regnum
].loc
.reg
);
1902 case REG_CTX_SAVED_ADDR
:
1903 target_read_memory (UNWIND_CONTEXT (frame
)->reg
[regnum
].loc
.addr
,
1904 raw_buffer
, REGISTER_RAW_SIZE (regnum
));
1906 *lval
= lval_memory
;
1908 *addrp
= UNWIND_CONTEXT (frame
)->reg
[regnum
].loc
.addr
;
1911 memcpy (raw_buffer
, &UNWIND_CONTEXT (frame
)->reg
[regnum
].loc
.addr
,
1912 REGISTER_RAW_SIZE (regnum
));
1915 if (optimized
!= NULL
)
1919 internal_error (__FILE__
, __LINE__
,
1920 "cfi_get_saved_register: unknown register rule");
1925 /* Return the register that the function uses for a frame pointer,
1926 plus any necessary offset to be applied to the register before
1927 any frame pointer offsets. */
1929 cfi_virtual_frame_pointer (CORE_ADDR pc
, int *frame_reg
,
1930 LONGEST
* frame_offset
)
1932 struct context
*context
;
1933 struct frame_state
*fs
;
1935 unwind_tmp_obstack_init ();
1937 context
= context_alloc ();
1938 fs
= frame_state_alloc ();
1940 context
->ra
= read_pc () + 1;
1942 frame_state_for (context
, fs
);
1944 if (fs
->cfa_how
== CFA_REG_OFFSET
)
1946 *frame_reg
= fs
->cfa_reg
;
1947 *frame_offset
= fs
->cfa_offset
;
1950 error ("dwarf cfi error: CFA is not defined as CFA_REG_OFFSET");
1952 unwind_tmp_obstack_free ();