2001-03-28 13:04:51 +02:00
|
|
|
|
/* DWARF2 exception handling and frame unwind runtime interface routines.
|
2013-02-04 20:06:20 +01:00
|
|
|
|
Copyright (C) 1997-2013 Free Software Foundation, Inc.
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
Makefile.in, [...]: replace "GNU CC" with "GCC".
* Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c,
bitmap.h, builtin-types.def, builtins.c, builtins.def,
c-aux-info.c, c-common.c, c-common.def, c-common.h,
c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c,
c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in,
c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c,
caller-save.c, calls.c, collect2.c, collect2.h, combine.c,
conditions.h, config.gcc, configure.frag, configure.in,
conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c,
cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h,
dependence.c, df.c, df.h, diagnostic.c, diagnostic.h,
doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c,
dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c,
emit-rtl.c, errors.c, errors.h, except.c, except.h,
exgettext, explow.c, expmed.c, expr.c, expr.h, final.c,
fixproto, flags.h, flow.c, fold-const.c, fp-test.c,
function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp,
gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c,
gencheck.c, gencodes.c, genconfig.c, genemit.c,
genextract.c, genflags.c, gengenrtl.c, genmultilib,
genopinit.c, genoutput.c, genpeep.c, genrecog.c,
gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c,
ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c,
graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h,
gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h,
gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h,
hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h,
integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c,
libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h,
machmode.def, machmode.h, main.c, mbchar.c, mbchar.h,
mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk,
mkmap-symver.awk, optabs.c, output.h, params.c, params.def,
params.h, predict.c, predict.def, predict.h, prefix.c,
prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c,
read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c,
regclass.c, regmove.c, regrename.c, regs.h, reload.c,
reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c,
rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h,
sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c,
sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c,
ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c,
stringpool.c, system.h, timevar.c, timevar.def, timevar.h,
tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h,
tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h,
unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c,
xcoffout.h: replace "GNU CC" with "GCC".
From-SVN: r45105
2001-08-22 16:35:51 +02:00
|
|
|
|
This file is part of GCC.
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
Makefile.in, [...]: replace "GNU CC" with "GCC".
* Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c,
bitmap.h, builtin-types.def, builtins.c, builtins.def,
c-aux-info.c, c-common.c, c-common.def, c-common.h,
c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c,
c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in,
c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c,
caller-save.c, calls.c, collect2.c, collect2.h, combine.c,
conditions.h, config.gcc, configure.frag, configure.in,
conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c,
cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h,
dependence.c, df.c, df.h, diagnostic.c, diagnostic.h,
doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c,
dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c,
emit-rtl.c, errors.c, errors.h, except.c, except.h,
exgettext, explow.c, expmed.c, expr.c, expr.h, final.c,
fixproto, flags.h, flow.c, fold-const.c, fp-test.c,
function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp,
gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c,
gencheck.c, gencodes.c, genconfig.c, genemit.c,
genextract.c, genflags.c, gengenrtl.c, genmultilib,
genopinit.c, genoutput.c, genpeep.c, genrecog.c,
gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c,
ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c,
graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h,
gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h,
gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h,
hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h,
integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c,
libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h,
machmode.def, machmode.h, main.c, mbchar.c, mbchar.h,
mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk,
mkmap-symver.awk, optabs.c, output.h, params.c, params.def,
params.h, predict.c, predict.def, predict.h, prefix.c,
prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c,
read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c,
regclass.c, regmove.c, regrename.c, regs.h, reload.c,
reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c,
rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h,
sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c,
sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c,
ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c,
stringpool.c, system.h, timevar.c, timevar.def, timevar.h,
tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h,
tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h,
unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c,
xcoffout.h: replace "GNU CC" with "GCC".
From-SVN: r45105
2001-08-22 16:35:51 +02:00
|
|
|
|
GCC is free software; you can redistribute it and/or modify it
|
|
|
|
|
under the terms of the GNU General Public License as published by
|
2009-04-09 17:00:19 +02:00
|
|
|
|
the Free Software Foundation; either version 3, or (at your option)
|
2001-03-28 13:04:51 +02:00
|
|
|
|
any later version.
|
|
|
|
|
|
Makefile.in, [...]: replace "GNU CC" with "GCC".
* Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c,
bitmap.h, builtin-types.def, builtins.c, builtins.def,
c-aux-info.c, c-common.c, c-common.def, c-common.h,
c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c,
c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in,
c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c,
caller-save.c, calls.c, collect2.c, collect2.h, combine.c,
conditions.h, config.gcc, configure.frag, configure.in,
conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c,
cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h,
dependence.c, df.c, df.h, diagnostic.c, diagnostic.h,
doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c,
dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c,
emit-rtl.c, errors.c, errors.h, except.c, except.h,
exgettext, explow.c, expmed.c, expr.c, expr.h, final.c,
fixproto, flags.h, flow.c, fold-const.c, fp-test.c,
function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp,
gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c,
gencheck.c, gencodes.c, genconfig.c, genemit.c,
genextract.c, genflags.c, gengenrtl.c, genmultilib,
genopinit.c, genoutput.c, genpeep.c, genrecog.c,
gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c,
ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c,
graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h,
gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h,
gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h,
hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h,
integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c,
libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h,
machmode.def, machmode.h, main.c, mbchar.c, mbchar.h,
mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk,
mkmap-symver.awk, optabs.c, output.h, params.c, params.def,
params.h, predict.c, predict.def, predict.h, prefix.c,
prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c,
read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c,
regclass.c, regmove.c, regrename.c, regs.h, reload.c,
reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c,
rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h,
sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c,
sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c,
ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c,
stringpool.c, system.h, timevar.c, timevar.def, timevar.h,
tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h,
tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h,
unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c,
xcoffout.h: replace "GNU CC" with "GCC".
From-SVN: r45105
2001-08-22 16:35:51 +02:00
|
|
|
|
GCC is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
|
|
|
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
|
|
|
|
License for more details.
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
2009-04-09 17:00:19 +02:00
|
|
|
|
Under Section 7 of GPL version 3, you are granted additional
|
|
|
|
|
permissions described in the GCC Runtime Library Exception, version
|
|
|
|
|
3.1, as published by the Free Software Foundation.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License and
|
|
|
|
|
a copy of the GCC Runtime Library Exception along with this program;
|
|
|
|
|
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
|
|
|
|
<http://www.gnu.org/licenses/>. */
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
|
|
|
|
#include "tconfig.h"
|
|
|
|
|
#include "tsystem.h"
|
2002-12-16 19:23:00 +01:00
|
|
|
|
#include "coretypes.h"
|
|
|
|
|
#include "tm.h"
|
Move libgcc_tm_file to toplevel libgcc
gcc:
* configure.ac (libgcc_tm_file_list, libgcc_tm_include_list):
Remove.
* configure: Regenerate.
* Makefile.in (libgcc_tm_file_list, libgcc_tm_include_list): Remove.
(TM_H): Remove libgcc_tm.h, $(libgcc_tm_file_list).
(libgcc_tm.h, cs-libgcc_tm.h): Remove.
(clean): Remove libgcc_tm.h
* mkconfig.sh: Don't include libgcc_tm.h in tm.h.
* config.gcc (libgcc_tm_file): Remove.
(arm*-*-linux*): Remove libgcc_tm_file for arm*-*-linux-*eabi.
(arm*-*-uclinux*): Remove libgcc_tm_file for arm*-*-uclinux*eabi.
(arm*-*-eabi*, arm*-*-symbianelf*): Remove libgcc_tm_file.
(avr-*-rtems*): Likewise.
(avr-*-*): Likewise.
(frv-*-elf): Likewise.
(frv-*-*linux*): Likewise.
(h8300-*-rtems*): Likewise.
(h8300-*-elf*): Likewise.
(i[34567]86-*-darwin*): Likewise.
(x86_64-*-darwin*): Likewise.
(rx-*-elf*): Likewise.
(tic6x-*-elf): Likewise.
(tic6x-*-uclinux): Likewise.
(i[34567]86-*-linux*, x86_64-*-linux*): Likewise.
libgcc:
* configure.ac (tm_file_): New variable.
Determine from tm_file.
(tm_file, tm_defines): Substitute.
* configure: Regenerate.
* mkheader.sh: New file.
* Makefile.in (clean): Remove libgcc_tm.h.
($(objects)): Depend on libgcc_tm.h.
(libgcc_tm_defines, libgcc_tm_file): New variables.
(libgcc_tm.h, libgcc_tm.stamp): New targets.
($(libgcc-objects), $(libgcc-s-objects), $(libgcc-eh-objects))
($(libgcov-objects), $(libunwind-objects), $(libunwind-s-objects))
($(extra-parts)): Depend on libgcc_tm.h.
* config.host (tm_defines, tm_file): New variable.
(arm*-*-linux*): Set tm_file for arm*-*-linux-*eabi.
(arm*-*-uclinux*): Set tm_file for arm*-*-uclinux*eabi.
(arm*-*-eabi*, arm*-*-symbianelf*): Set tm_file.
(avr-*-rtems*): Likewise.
(avr-*-*): Likewise.
(frv-*-elf): Likewise.
(frv-*-*linux*): Likewise.
(h8300-*-rtems*): Likewise.
(h8300-*-elf*): Likewise.
(i[34567]86-*-darwin*): Likewise.
(x86_64-*-darwin*): Likewise.
(rx-*-elf): Likewise.
(tic6x-*-uclinux): Likewise.
(tic6x-*-elf): Likewise.
(i[34567]86-*-linux*, x86_64-*-linux*): Likewise.
* config/alpha/gthr-posix.c: Include libgcc_tm.h.
* config/i386/cygming-crtbegin.c: Likewise.
* config/i386/cygming-crtend.c: Likewise.
* config/ia64/fde-vms.c: Likewise.
* config/ia64/unwind-ia64.c: Likewise.
* config/libbid/bid_gcc_intrinsics.h: Likewise.
* config/rs6000/darwin-fallback.c: Likewise.
* config/stormy16/lib2funcs.c: Likewise.
* config/xtensa/unwind-dw2-xtensa.c: Likewise.
* crtstuff.c: Likewise.
* dfp-bit.h: Likewise.
* emutls.c: Likewise.
* fixed-bit.c: Likewise.
* fp-bit.c: Likewise.
* generic-morestack-thread.c: Likewise.
* generic-morestack.c: Likewise.
* libgcc2.c: Likewise.
* libgcov.c: Likewise.
* unwind-dw2-fde-dip.c: Likewise.
* unwind-dw2-fde.c: Likewise.
* unwind-dw2.c: Likewise.
* unwind-sjlj.c: Likewise.
Co-Authored-By: Paolo Bonzini <bonzini@gnu.org>
From-SVN: r180775
2011-11-02 16:26:35 +01:00
|
|
|
|
#include "libgcc_tm.h"
|
2009-07-09 21:41:25 +02:00
|
|
|
|
#include "dwarf2.h"
|
2001-03-28 13:04:51 +02:00
|
|
|
|
#include "unwind.h"
|
2003-10-28 04:47:37 +01:00
|
|
|
|
#ifdef __USING_SJLJ_EXCEPTIONS__
|
|
|
|
|
# define NO_SIZE_OF_ENCODED_VALUE
|
|
|
|
|
#endif
|
except.c (eh_data_format_name): Move to ...
* except.c (eh_data_format_name): Move to ...
* dwarf2asm.c: ... here. Use designated initializers if available.
(dw2_asm_output_encoded_addr_rtx): Accept varargs commentary.
* dwarf2asm.h: Update declarations.
* dwarf2out.c (output_cfi) [DW_CFA_set_loc]: If for_eh, mind
ASM_PREFERRED_EH_DATA_FORMAT.
(output_call_frame_info): Likewise. Use 'L' augmentation for
the LSDA encoding.
* unwind-dw2-fde.h (struct fde_vector): New.
(struct old_object): Rename from struct object.
(struct object): New.
(__register_frame_info_bases): Declare.
(__register_frame_info_table_bases): Declare.
(struct dwarf_fde): Remove explicit pc_begin/pc_range members.
* unwind-dw2-fde.c (objects): Remove.
(unseen_objects, seen_objects): New.
(__register_frame_info_bases): New.
(__register_frame_info): Use it.
(__register_frame_info_table_bases): New.
(__register_frame_info_table): Use it.
(__deregister_frame_info): Rewrite for changed object struct.
(base_from_object, get_cie_encoding, get_fde_encoding): New.
(fde_unencoded_compare): Rename from fde_compare; uninline.
(fde_single_encoding_compare, fde_mixed_encoding_compare): New.
(start_fde_sort): Adjust for new definition of fde_vector.
(fde_insert): Likewise.
(end_fde_sort): Likewise. Select comparison function based
on properties of the object.
(fde_split): Take object and fde_compare_t arguments.
(frame_heapsort, fde_merge): Likewise.
(classify_object_over_fdes): Rename from count_fdes. Handle
encoded pointers. Collect encoding, mixed_encoding, and pc_begin
for the object.
(add_fdes): Handle encoded pointers.
(init_object): Rename from frame_init. Update for new struct object.
(linear_search_fdes): Rename from search_fdes. Handle encoded
pointers.
(binary_search_unencoded_fdes): Broken out from _Unwind_Find_FDE.
(binary_search_single_encoding_fdes): New.
(binary_search_mixed_encoding_fdes): New.
(search_object): New.
(_Unwind_Find_FDE): Update for new struct object. Fill in
the dwarf_eh_bases.
* unwind-dw2.c: Include unwind-pe.h. Constify all pointers
iterating over EH data.
(_Unwind_FrameState): Remove saw_lsda, addr_encoding. Add
fde_encoding, lsda_encoding.
(read_uleb128, read_sleb128): Remove.
(read_encoded_pointer): Remove. All callers use read_encoded_value.
(extract_cie_info): Set lsda_encoding from 'L' augmentation.
(uw_frame_state_for): Don't set bases.func. Handle encoded fde
pointers.
* unwind-pe.h: Add "struct" to _Unwind_Context references.
From-SVN: r42176
2001-05-17 00:42:36 +02:00
|
|
|
|
#include "unwind-pe.h"
|
2001-03-28 13:04:51 +02:00
|
|
|
|
#include "unwind-dw2-fde.h"
|
|
|
|
|
#include "gthr.h"
|
2004-07-01 06:09:07 +02:00
|
|
|
|
#include "unwind-dw2.h"
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
2011-03-14 20:47:58 +01:00
|
|
|
|
#ifdef HAVE_SYS_SDT_H
|
|
|
|
|
#include <sys/sdt.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
2002-01-08 20:03:20 +01:00
|
|
|
|
#ifndef __USING_SJLJ_EXCEPTIONS__
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
|
|
|
|
#ifndef STACK_GROWS_DOWNWARD
|
|
|
|
|
#define STACK_GROWS_DOWNWARD 0
|
|
|
|
|
#else
|
|
|
|
|
#undef STACK_GROWS_DOWNWARD
|
|
|
|
|
#define STACK_GROWS_DOWNWARD 1
|
|
|
|
|
#endif
|
|
|
|
|
|
2001-12-06 22:38:03 +01:00
|
|
|
|
/* Dwarf frame registers used for pre gcc 3.0 compiled glibc. */
|
|
|
|
|
#ifndef PRE_GCC3_DWARF_FRAME_REGISTERS
|
|
|
|
|
#define PRE_GCC3_DWARF_FRAME_REGISTERS DWARF_FRAME_REGISTERS
|
|
|
|
|
#endif
|
|
|
|
|
|
2003-03-11 21:40:54 +01:00
|
|
|
|
#ifndef DWARF_REG_TO_UNWIND_COLUMN
|
|
|
|
|
#define DWARF_REG_TO_UNWIND_COLUMN(REGNO) (REGNO)
|
|
|
|
|
#endif
|
|
|
|
|
|
2011-08-08 15:26:06 +02:00
|
|
|
|
#ifdef REG_VALUE_IN_UNWIND_CONTEXT
|
|
|
|
|
typedef _Unwind_Word _Unwind_Context_Reg_Val;
|
|
|
|
|
|
|
|
|
|
#ifndef ASSUME_EXTENDED_UNWIND_CONTEXT
|
|
|
|
|
#define ASSUME_EXTENDED_UNWIND_CONTEXT 1
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
static inline _Unwind_Word
|
|
|
|
|
_Unwind_Get_Unwind_Word (_Unwind_Context_Reg_Val val)
|
|
|
|
|
{
|
|
|
|
|
return val;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline _Unwind_Context_Reg_Val
|
|
|
|
|
_Unwind_Get_Unwind_Context_Reg_Val (_Unwind_Word val)
|
|
|
|
|
{
|
|
|
|
|
return val;
|
|
|
|
|
}
|
|
|
|
|
#else
|
|
|
|
|
typedef void *_Unwind_Context_Reg_Val;
|
|
|
|
|
|
|
|
|
|
static inline _Unwind_Word
|
|
|
|
|
_Unwind_Get_Unwind_Word (_Unwind_Context_Reg_Val val)
|
|
|
|
|
{
|
|
|
|
|
return (_Unwind_Word) (_Unwind_Internal_Ptr) val;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline _Unwind_Context_Reg_Val
|
|
|
|
|
_Unwind_Get_Unwind_Context_Reg_Val (_Unwind_Word val)
|
|
|
|
|
{
|
|
|
|
|
return (_Unwind_Context_Reg_Val) (_Unwind_Internal_Ptr) val;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef ASSUME_EXTENDED_UNWIND_CONTEXT
|
|
|
|
|
#define ASSUME_EXTENDED_UNWIND_CONTEXT 0
|
|
|
|
|
#endif
|
|
|
|
|
|
2002-03-15 11:18:21 +01:00
|
|
|
|
/* This is the register and unwind state for a particular frame. This
|
|
|
|
|
provides the information necessary to unwind up past a frame and return
|
|
|
|
|
to its caller. */
|
2001-03-28 13:04:51 +02:00
|
|
|
|
struct _Unwind_Context
|
|
|
|
|
{
|
2011-08-08 15:26:06 +02:00
|
|
|
|
_Unwind_Context_Reg_Val reg[DWARF_FRAME_REGISTERS+1];
|
2001-03-28 13:04:51 +02:00
|
|
|
|
void *cfa;
|
|
|
|
|
void *ra;
|
|
|
|
|
void *lsda;
|
|
|
|
|
struct dwarf_eh_bases bases;
|
unwind-dw2.c (SIGNAL_FRAME_BIT, [...]): Define.
* unwind-dw2.c (SIGNAL_FRAME_BIT, EXTENDED_CONTEXT_BIT): Define.
(struct _Unwind_Context): Rename args_size to flags, remove
signal_frame field, add a new args_size field and version field.
(_Unwind_IsSignalFrame, _Unwind_SetSignalFrame,
_Unwind_IsExtendedContext): New inline functions.
(_Unwind_GetGR, _Unwind_SetGR, _Unwind_GetGRPtr, _Unwind_SetGRPtr):
Assume by_value array is only present if _Unwind_IsExtendedContext.
(_Unwind_GetIPInfo, execute_cfa_program, uw_frame_state_for): Use
_Unwind_IsSignalFrame.
(__frame_state_for): Initialize context.flags to EXTENDED_CONTEXT_BIT.
(uw_update_context_1): Use _Unwind_SetSignalFrame.
(uw_init_context_1): Initialize context->flags to
EXTENDED_CONTEXT_BIT.
* config/rs6000/linux-unwind.h (frob_update_context): Use
_Unwind_SetSignalFrame.
From-SVN: r120406
2007-01-04 00:45:47 +01:00
|
|
|
|
/* Signal frame context. */
|
|
|
|
|
#define SIGNAL_FRAME_BIT ((~(_Unwind_Word) 0 >> 1) + 1)
|
|
|
|
|
/* Context which has version/args_size/by_value fields. */
|
|
|
|
|
#define EXTENDED_CONTEXT_BIT ((~(_Unwind_Word) 0 >> 2) + 1)
|
|
|
|
|
_Unwind_Word flags;
|
|
|
|
|
/* 0 for now, can be increased when further fields are added to
|
|
|
|
|
struct _Unwind_Context. */
|
|
|
|
|
_Unwind_Word version;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
_Unwind_Word args_size;
|
2006-03-04 08:07:12 +01:00
|
|
|
|
char by_value[DWARF_FRAME_REGISTERS+1];
|
2001-03-28 13:04:51 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* Byte size of every register managed by these routines. */
|
2003-10-01 08:01:47 +02:00
|
|
|
|
static unsigned char dwarf_reg_size_table[DWARF_FRAME_REGISTERS+1];
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Read unaligned data from the instruction buffer. */
|
|
|
|
|
|
|
|
|
|
union unaligned
|
|
|
|
|
{
|
|
|
|
|
void *p;
|
|
|
|
|
unsigned u2 __attribute__ ((mode (HI)));
|
|
|
|
|
unsigned u4 __attribute__ ((mode (SI)));
|
|
|
|
|
unsigned u8 __attribute__ ((mode (DI)));
|
|
|
|
|
signed s2 __attribute__ ((mode (HI)));
|
|
|
|
|
signed s4 __attribute__ ((mode (SI)));
|
|
|
|
|
signed s8 __attribute__ ((mode (DI)));
|
|
|
|
|
} __attribute__ ((packed));
|
|
|
|
|
|
2006-05-17 17:35:36 +02:00
|
|
|
|
static void uw_update_context (struct _Unwind_Context *, _Unwind_FrameState *);
|
|
|
|
|
static _Unwind_Reason_Code uw_frame_state_for (struct _Unwind_Context *,
|
|
|
|
|
_Unwind_FrameState *);
|
|
|
|
|
|
2001-03-28 13:04:51 +02:00
|
|
|
|
static inline void *
|
except.c (eh_data_format_name): Move to ...
* except.c (eh_data_format_name): Move to ...
* dwarf2asm.c: ... here. Use designated initializers if available.
(dw2_asm_output_encoded_addr_rtx): Accept varargs commentary.
* dwarf2asm.h: Update declarations.
* dwarf2out.c (output_cfi) [DW_CFA_set_loc]: If for_eh, mind
ASM_PREFERRED_EH_DATA_FORMAT.
(output_call_frame_info): Likewise. Use 'L' augmentation for
the LSDA encoding.
* unwind-dw2-fde.h (struct fde_vector): New.
(struct old_object): Rename from struct object.
(struct object): New.
(__register_frame_info_bases): Declare.
(__register_frame_info_table_bases): Declare.
(struct dwarf_fde): Remove explicit pc_begin/pc_range members.
* unwind-dw2-fde.c (objects): Remove.
(unseen_objects, seen_objects): New.
(__register_frame_info_bases): New.
(__register_frame_info): Use it.
(__register_frame_info_table_bases): New.
(__register_frame_info_table): Use it.
(__deregister_frame_info): Rewrite for changed object struct.
(base_from_object, get_cie_encoding, get_fde_encoding): New.
(fde_unencoded_compare): Rename from fde_compare; uninline.
(fde_single_encoding_compare, fde_mixed_encoding_compare): New.
(start_fde_sort): Adjust for new definition of fde_vector.
(fde_insert): Likewise.
(end_fde_sort): Likewise. Select comparison function based
on properties of the object.
(fde_split): Take object and fde_compare_t arguments.
(frame_heapsort, fde_merge): Likewise.
(classify_object_over_fdes): Rename from count_fdes. Handle
encoded pointers. Collect encoding, mixed_encoding, and pc_begin
for the object.
(add_fdes): Handle encoded pointers.
(init_object): Rename from frame_init. Update for new struct object.
(linear_search_fdes): Rename from search_fdes. Handle encoded
pointers.
(binary_search_unencoded_fdes): Broken out from _Unwind_Find_FDE.
(binary_search_single_encoding_fdes): New.
(binary_search_mixed_encoding_fdes): New.
(search_object): New.
(_Unwind_Find_FDE): Update for new struct object. Fill in
the dwarf_eh_bases.
* unwind-dw2.c: Include unwind-pe.h. Constify all pointers
iterating over EH data.
(_Unwind_FrameState): Remove saw_lsda, addr_encoding. Add
fde_encoding, lsda_encoding.
(read_uleb128, read_sleb128): Remove.
(read_encoded_pointer): Remove. All callers use read_encoded_value.
(extract_cie_info): Set lsda_encoding from 'L' augmentation.
(uw_frame_state_for): Don't set bases.func. Handle encoded fde
pointers.
* unwind-pe.h: Add "struct" to _Unwind_Context references.
From-SVN: r42176
2001-05-17 00:42:36 +02:00
|
|
|
|
read_pointer (const void *p) { const union unaligned *up = p; return up->p; }
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
|
|
|
|
static inline int
|
2002-01-21 14:08:33 +01:00
|
|
|
|
read_1u (const void *p) { return *(const unsigned char *) p; }
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
|
|
|
|
static inline int
|
2002-01-21 14:08:33 +01:00
|
|
|
|
read_1s (const void *p) { return *(const signed char *) p; }
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
|
|
|
|
static inline int
|
except.c (eh_data_format_name): Move to ...
* except.c (eh_data_format_name): Move to ...
* dwarf2asm.c: ... here. Use designated initializers if available.
(dw2_asm_output_encoded_addr_rtx): Accept varargs commentary.
* dwarf2asm.h: Update declarations.
* dwarf2out.c (output_cfi) [DW_CFA_set_loc]: If for_eh, mind
ASM_PREFERRED_EH_DATA_FORMAT.
(output_call_frame_info): Likewise. Use 'L' augmentation for
the LSDA encoding.
* unwind-dw2-fde.h (struct fde_vector): New.
(struct old_object): Rename from struct object.
(struct object): New.
(__register_frame_info_bases): Declare.
(__register_frame_info_table_bases): Declare.
(struct dwarf_fde): Remove explicit pc_begin/pc_range members.
* unwind-dw2-fde.c (objects): Remove.
(unseen_objects, seen_objects): New.
(__register_frame_info_bases): New.
(__register_frame_info): Use it.
(__register_frame_info_table_bases): New.
(__register_frame_info_table): Use it.
(__deregister_frame_info): Rewrite for changed object struct.
(base_from_object, get_cie_encoding, get_fde_encoding): New.
(fde_unencoded_compare): Rename from fde_compare; uninline.
(fde_single_encoding_compare, fde_mixed_encoding_compare): New.
(start_fde_sort): Adjust for new definition of fde_vector.
(fde_insert): Likewise.
(end_fde_sort): Likewise. Select comparison function based
on properties of the object.
(fde_split): Take object and fde_compare_t arguments.
(frame_heapsort, fde_merge): Likewise.
(classify_object_over_fdes): Rename from count_fdes. Handle
encoded pointers. Collect encoding, mixed_encoding, and pc_begin
for the object.
(add_fdes): Handle encoded pointers.
(init_object): Rename from frame_init. Update for new struct object.
(linear_search_fdes): Rename from search_fdes. Handle encoded
pointers.
(binary_search_unencoded_fdes): Broken out from _Unwind_Find_FDE.
(binary_search_single_encoding_fdes): New.
(binary_search_mixed_encoding_fdes): New.
(search_object): New.
(_Unwind_Find_FDE): Update for new struct object. Fill in
the dwarf_eh_bases.
* unwind-dw2.c: Include unwind-pe.h. Constify all pointers
iterating over EH data.
(_Unwind_FrameState): Remove saw_lsda, addr_encoding. Add
fde_encoding, lsda_encoding.
(read_uleb128, read_sleb128): Remove.
(read_encoded_pointer): Remove. All callers use read_encoded_value.
(extract_cie_info): Set lsda_encoding from 'L' augmentation.
(uw_frame_state_for): Don't set bases.func. Handle encoded fde
pointers.
* unwind-pe.h: Add "struct" to _Unwind_Context references.
From-SVN: r42176
2001-05-17 00:42:36 +02:00
|
|
|
|
read_2u (const void *p) { const union unaligned *up = p; return up->u2; }
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
|
|
|
|
static inline int
|
except.c (eh_data_format_name): Move to ...
* except.c (eh_data_format_name): Move to ...
* dwarf2asm.c: ... here. Use designated initializers if available.
(dw2_asm_output_encoded_addr_rtx): Accept varargs commentary.
* dwarf2asm.h: Update declarations.
* dwarf2out.c (output_cfi) [DW_CFA_set_loc]: If for_eh, mind
ASM_PREFERRED_EH_DATA_FORMAT.
(output_call_frame_info): Likewise. Use 'L' augmentation for
the LSDA encoding.
* unwind-dw2-fde.h (struct fde_vector): New.
(struct old_object): Rename from struct object.
(struct object): New.
(__register_frame_info_bases): Declare.
(__register_frame_info_table_bases): Declare.
(struct dwarf_fde): Remove explicit pc_begin/pc_range members.
* unwind-dw2-fde.c (objects): Remove.
(unseen_objects, seen_objects): New.
(__register_frame_info_bases): New.
(__register_frame_info): Use it.
(__register_frame_info_table_bases): New.
(__register_frame_info_table): Use it.
(__deregister_frame_info): Rewrite for changed object struct.
(base_from_object, get_cie_encoding, get_fde_encoding): New.
(fde_unencoded_compare): Rename from fde_compare; uninline.
(fde_single_encoding_compare, fde_mixed_encoding_compare): New.
(start_fde_sort): Adjust for new definition of fde_vector.
(fde_insert): Likewise.
(end_fde_sort): Likewise. Select comparison function based
on properties of the object.
(fde_split): Take object and fde_compare_t arguments.
(frame_heapsort, fde_merge): Likewise.
(classify_object_over_fdes): Rename from count_fdes. Handle
encoded pointers. Collect encoding, mixed_encoding, and pc_begin
for the object.
(add_fdes): Handle encoded pointers.
(init_object): Rename from frame_init. Update for new struct object.
(linear_search_fdes): Rename from search_fdes. Handle encoded
pointers.
(binary_search_unencoded_fdes): Broken out from _Unwind_Find_FDE.
(binary_search_single_encoding_fdes): New.
(binary_search_mixed_encoding_fdes): New.
(search_object): New.
(_Unwind_Find_FDE): Update for new struct object. Fill in
the dwarf_eh_bases.
* unwind-dw2.c: Include unwind-pe.h. Constify all pointers
iterating over EH data.
(_Unwind_FrameState): Remove saw_lsda, addr_encoding. Add
fde_encoding, lsda_encoding.
(read_uleb128, read_sleb128): Remove.
(read_encoded_pointer): Remove. All callers use read_encoded_value.
(extract_cie_info): Set lsda_encoding from 'L' augmentation.
(uw_frame_state_for): Don't set bases.func. Handle encoded fde
pointers.
* unwind-pe.h: Add "struct" to _Unwind_Context references.
From-SVN: r42176
2001-05-17 00:42:36 +02:00
|
|
|
|
read_2s (const void *p) { const union unaligned *up = p; return up->s2; }
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
|
|
|
|
static inline unsigned int
|
except.c (eh_data_format_name): Move to ...
* except.c (eh_data_format_name): Move to ...
* dwarf2asm.c: ... here. Use designated initializers if available.
(dw2_asm_output_encoded_addr_rtx): Accept varargs commentary.
* dwarf2asm.h: Update declarations.
* dwarf2out.c (output_cfi) [DW_CFA_set_loc]: If for_eh, mind
ASM_PREFERRED_EH_DATA_FORMAT.
(output_call_frame_info): Likewise. Use 'L' augmentation for
the LSDA encoding.
* unwind-dw2-fde.h (struct fde_vector): New.
(struct old_object): Rename from struct object.
(struct object): New.
(__register_frame_info_bases): Declare.
(__register_frame_info_table_bases): Declare.
(struct dwarf_fde): Remove explicit pc_begin/pc_range members.
* unwind-dw2-fde.c (objects): Remove.
(unseen_objects, seen_objects): New.
(__register_frame_info_bases): New.
(__register_frame_info): Use it.
(__register_frame_info_table_bases): New.
(__register_frame_info_table): Use it.
(__deregister_frame_info): Rewrite for changed object struct.
(base_from_object, get_cie_encoding, get_fde_encoding): New.
(fde_unencoded_compare): Rename from fde_compare; uninline.
(fde_single_encoding_compare, fde_mixed_encoding_compare): New.
(start_fde_sort): Adjust for new definition of fde_vector.
(fde_insert): Likewise.
(end_fde_sort): Likewise. Select comparison function based
on properties of the object.
(fde_split): Take object and fde_compare_t arguments.
(frame_heapsort, fde_merge): Likewise.
(classify_object_over_fdes): Rename from count_fdes. Handle
encoded pointers. Collect encoding, mixed_encoding, and pc_begin
for the object.
(add_fdes): Handle encoded pointers.
(init_object): Rename from frame_init. Update for new struct object.
(linear_search_fdes): Rename from search_fdes. Handle encoded
pointers.
(binary_search_unencoded_fdes): Broken out from _Unwind_Find_FDE.
(binary_search_single_encoding_fdes): New.
(binary_search_mixed_encoding_fdes): New.
(search_object): New.
(_Unwind_Find_FDE): Update for new struct object. Fill in
the dwarf_eh_bases.
* unwind-dw2.c: Include unwind-pe.h. Constify all pointers
iterating over EH data.
(_Unwind_FrameState): Remove saw_lsda, addr_encoding. Add
fde_encoding, lsda_encoding.
(read_uleb128, read_sleb128): Remove.
(read_encoded_pointer): Remove. All callers use read_encoded_value.
(extract_cie_info): Set lsda_encoding from 'L' augmentation.
(uw_frame_state_for): Don't set bases.func. Handle encoded fde
pointers.
* unwind-pe.h: Add "struct" to _Unwind_Context references.
From-SVN: r42176
2001-05-17 00:42:36 +02:00
|
|
|
|
read_4u (const void *p) { const union unaligned *up = p; return up->u4; }
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
|
|
|
|
static inline int
|
except.c (eh_data_format_name): Move to ...
* except.c (eh_data_format_name): Move to ...
* dwarf2asm.c: ... here. Use designated initializers if available.
(dw2_asm_output_encoded_addr_rtx): Accept varargs commentary.
* dwarf2asm.h: Update declarations.
* dwarf2out.c (output_cfi) [DW_CFA_set_loc]: If for_eh, mind
ASM_PREFERRED_EH_DATA_FORMAT.
(output_call_frame_info): Likewise. Use 'L' augmentation for
the LSDA encoding.
* unwind-dw2-fde.h (struct fde_vector): New.
(struct old_object): Rename from struct object.
(struct object): New.
(__register_frame_info_bases): Declare.
(__register_frame_info_table_bases): Declare.
(struct dwarf_fde): Remove explicit pc_begin/pc_range members.
* unwind-dw2-fde.c (objects): Remove.
(unseen_objects, seen_objects): New.
(__register_frame_info_bases): New.
(__register_frame_info): Use it.
(__register_frame_info_table_bases): New.
(__register_frame_info_table): Use it.
(__deregister_frame_info): Rewrite for changed object struct.
(base_from_object, get_cie_encoding, get_fde_encoding): New.
(fde_unencoded_compare): Rename from fde_compare; uninline.
(fde_single_encoding_compare, fde_mixed_encoding_compare): New.
(start_fde_sort): Adjust for new definition of fde_vector.
(fde_insert): Likewise.
(end_fde_sort): Likewise. Select comparison function based
on properties of the object.
(fde_split): Take object and fde_compare_t arguments.
(frame_heapsort, fde_merge): Likewise.
(classify_object_over_fdes): Rename from count_fdes. Handle
encoded pointers. Collect encoding, mixed_encoding, and pc_begin
for the object.
(add_fdes): Handle encoded pointers.
(init_object): Rename from frame_init. Update for new struct object.
(linear_search_fdes): Rename from search_fdes. Handle encoded
pointers.
(binary_search_unencoded_fdes): Broken out from _Unwind_Find_FDE.
(binary_search_single_encoding_fdes): New.
(binary_search_mixed_encoding_fdes): New.
(search_object): New.
(_Unwind_Find_FDE): Update for new struct object. Fill in
the dwarf_eh_bases.
* unwind-dw2.c: Include unwind-pe.h. Constify all pointers
iterating over EH data.
(_Unwind_FrameState): Remove saw_lsda, addr_encoding. Add
fde_encoding, lsda_encoding.
(read_uleb128, read_sleb128): Remove.
(read_encoded_pointer): Remove. All callers use read_encoded_value.
(extract_cie_info): Set lsda_encoding from 'L' augmentation.
(uw_frame_state_for): Don't set bases.func. Handle encoded fde
pointers.
* unwind-pe.h: Add "struct" to _Unwind_Context references.
From-SVN: r42176
2001-05-17 00:42:36 +02:00
|
|
|
|
read_4s (const void *p) { const union unaligned *up = p; return up->s4; }
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
|
|
|
|
static inline unsigned long
|
except.c (eh_data_format_name): Move to ...
* except.c (eh_data_format_name): Move to ...
* dwarf2asm.c: ... here. Use designated initializers if available.
(dw2_asm_output_encoded_addr_rtx): Accept varargs commentary.
* dwarf2asm.h: Update declarations.
* dwarf2out.c (output_cfi) [DW_CFA_set_loc]: If for_eh, mind
ASM_PREFERRED_EH_DATA_FORMAT.
(output_call_frame_info): Likewise. Use 'L' augmentation for
the LSDA encoding.
* unwind-dw2-fde.h (struct fde_vector): New.
(struct old_object): Rename from struct object.
(struct object): New.
(__register_frame_info_bases): Declare.
(__register_frame_info_table_bases): Declare.
(struct dwarf_fde): Remove explicit pc_begin/pc_range members.
* unwind-dw2-fde.c (objects): Remove.
(unseen_objects, seen_objects): New.
(__register_frame_info_bases): New.
(__register_frame_info): Use it.
(__register_frame_info_table_bases): New.
(__register_frame_info_table): Use it.
(__deregister_frame_info): Rewrite for changed object struct.
(base_from_object, get_cie_encoding, get_fde_encoding): New.
(fde_unencoded_compare): Rename from fde_compare; uninline.
(fde_single_encoding_compare, fde_mixed_encoding_compare): New.
(start_fde_sort): Adjust for new definition of fde_vector.
(fde_insert): Likewise.
(end_fde_sort): Likewise. Select comparison function based
on properties of the object.
(fde_split): Take object and fde_compare_t arguments.
(frame_heapsort, fde_merge): Likewise.
(classify_object_over_fdes): Rename from count_fdes. Handle
encoded pointers. Collect encoding, mixed_encoding, and pc_begin
for the object.
(add_fdes): Handle encoded pointers.
(init_object): Rename from frame_init. Update for new struct object.
(linear_search_fdes): Rename from search_fdes. Handle encoded
pointers.
(binary_search_unencoded_fdes): Broken out from _Unwind_Find_FDE.
(binary_search_single_encoding_fdes): New.
(binary_search_mixed_encoding_fdes): New.
(search_object): New.
(_Unwind_Find_FDE): Update for new struct object. Fill in
the dwarf_eh_bases.
* unwind-dw2.c: Include unwind-pe.h. Constify all pointers
iterating over EH data.
(_Unwind_FrameState): Remove saw_lsda, addr_encoding. Add
fde_encoding, lsda_encoding.
(read_uleb128, read_sleb128): Remove.
(read_encoded_pointer): Remove. All callers use read_encoded_value.
(extract_cie_info): Set lsda_encoding from 'L' augmentation.
(uw_frame_state_for): Don't set bases.func. Handle encoded fde
pointers.
* unwind-pe.h: Add "struct" to _Unwind_Context references.
From-SVN: r42176
2001-05-17 00:42:36 +02:00
|
|
|
|
read_8u (const void *p) { const union unaligned *up = p; return up->u8; }
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
|
|
|
|
static inline unsigned long
|
except.c (eh_data_format_name): Move to ...
* except.c (eh_data_format_name): Move to ...
* dwarf2asm.c: ... here. Use designated initializers if available.
(dw2_asm_output_encoded_addr_rtx): Accept varargs commentary.
* dwarf2asm.h: Update declarations.
* dwarf2out.c (output_cfi) [DW_CFA_set_loc]: If for_eh, mind
ASM_PREFERRED_EH_DATA_FORMAT.
(output_call_frame_info): Likewise. Use 'L' augmentation for
the LSDA encoding.
* unwind-dw2-fde.h (struct fde_vector): New.
(struct old_object): Rename from struct object.
(struct object): New.
(__register_frame_info_bases): Declare.
(__register_frame_info_table_bases): Declare.
(struct dwarf_fde): Remove explicit pc_begin/pc_range members.
* unwind-dw2-fde.c (objects): Remove.
(unseen_objects, seen_objects): New.
(__register_frame_info_bases): New.
(__register_frame_info): Use it.
(__register_frame_info_table_bases): New.
(__register_frame_info_table): Use it.
(__deregister_frame_info): Rewrite for changed object struct.
(base_from_object, get_cie_encoding, get_fde_encoding): New.
(fde_unencoded_compare): Rename from fde_compare; uninline.
(fde_single_encoding_compare, fde_mixed_encoding_compare): New.
(start_fde_sort): Adjust for new definition of fde_vector.
(fde_insert): Likewise.
(end_fde_sort): Likewise. Select comparison function based
on properties of the object.
(fde_split): Take object and fde_compare_t arguments.
(frame_heapsort, fde_merge): Likewise.
(classify_object_over_fdes): Rename from count_fdes. Handle
encoded pointers. Collect encoding, mixed_encoding, and pc_begin
for the object.
(add_fdes): Handle encoded pointers.
(init_object): Rename from frame_init. Update for new struct object.
(linear_search_fdes): Rename from search_fdes. Handle encoded
pointers.
(binary_search_unencoded_fdes): Broken out from _Unwind_Find_FDE.
(binary_search_single_encoding_fdes): New.
(binary_search_mixed_encoding_fdes): New.
(search_object): New.
(_Unwind_Find_FDE): Update for new struct object. Fill in
the dwarf_eh_bases.
* unwind-dw2.c: Include unwind-pe.h. Constify all pointers
iterating over EH data.
(_Unwind_FrameState): Remove saw_lsda, addr_encoding. Add
fde_encoding, lsda_encoding.
(read_uleb128, read_sleb128): Remove.
(read_encoded_pointer): Remove. All callers use read_encoded_value.
(extract_cie_info): Set lsda_encoding from 'L' augmentation.
(uw_frame_state_for): Don't set bases.func. Handle encoded fde
pointers.
* unwind-pe.h: Add "struct" to _Unwind_Context references.
From-SVN: r42176
2001-05-17 00:42:36 +02:00
|
|
|
|
read_8s (const void *p) { const union unaligned *up = p; return up->s8; }
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
unwind-dw2.c (SIGNAL_FRAME_BIT, [...]): Define.
* unwind-dw2.c (SIGNAL_FRAME_BIT, EXTENDED_CONTEXT_BIT): Define.
(struct _Unwind_Context): Rename args_size to flags, remove
signal_frame field, add a new args_size field and version field.
(_Unwind_IsSignalFrame, _Unwind_SetSignalFrame,
_Unwind_IsExtendedContext): New inline functions.
(_Unwind_GetGR, _Unwind_SetGR, _Unwind_GetGRPtr, _Unwind_SetGRPtr):
Assume by_value array is only present if _Unwind_IsExtendedContext.
(_Unwind_GetIPInfo, execute_cfa_program, uw_frame_state_for): Use
_Unwind_IsSignalFrame.
(__frame_state_for): Initialize context.flags to EXTENDED_CONTEXT_BIT.
(uw_update_context_1): Use _Unwind_SetSignalFrame.
(uw_init_context_1): Initialize context->flags to
EXTENDED_CONTEXT_BIT.
* config/rs6000/linux-unwind.h (frob_update_context): Use
_Unwind_SetSignalFrame.
From-SVN: r120406
2007-01-04 00:45:47 +01:00
|
|
|
|
static inline _Unwind_Word
|
|
|
|
|
_Unwind_IsSignalFrame (struct _Unwind_Context *context)
|
|
|
|
|
{
|
|
|
|
|
return (context->flags & SIGNAL_FRAME_BIT) ? 1 : 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline void
|
|
|
|
|
_Unwind_SetSignalFrame (struct _Unwind_Context *context, int val)
|
|
|
|
|
{
|
|
|
|
|
if (val)
|
|
|
|
|
context->flags |= SIGNAL_FRAME_BIT;
|
|
|
|
|
else
|
|
|
|
|
context->flags &= ~SIGNAL_FRAME_BIT;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline _Unwind_Word
|
|
|
|
|
_Unwind_IsExtendedContext (struct _Unwind_Context *context)
|
|
|
|
|
{
|
2011-08-08 15:26:06 +02:00
|
|
|
|
return (ASSUME_EXTENDED_UNWIND_CONTEXT
|
|
|
|
|
|| (context->flags & EXTENDED_CONTEXT_BIT));
|
unwind-dw2.c (SIGNAL_FRAME_BIT, [...]): Define.
* unwind-dw2.c (SIGNAL_FRAME_BIT, EXTENDED_CONTEXT_BIT): Define.
(struct _Unwind_Context): Rename args_size to flags, remove
signal_frame field, add a new args_size field and version field.
(_Unwind_IsSignalFrame, _Unwind_SetSignalFrame,
_Unwind_IsExtendedContext): New inline functions.
(_Unwind_GetGR, _Unwind_SetGR, _Unwind_GetGRPtr, _Unwind_SetGRPtr):
Assume by_value array is only present if _Unwind_IsExtendedContext.
(_Unwind_GetIPInfo, execute_cfa_program, uw_frame_state_for): Use
_Unwind_IsSignalFrame.
(__frame_state_for): Initialize context.flags to EXTENDED_CONTEXT_BIT.
(uw_update_context_1): Use _Unwind_SetSignalFrame.
(uw_init_context_1): Initialize context->flags to
EXTENDED_CONTEXT_BIT.
* config/rs6000/linux-unwind.h (frob_update_context): Use
_Unwind_SetSignalFrame.
From-SVN: r120406
2007-01-04 00:45:47 +01:00
|
|
|
|
}
|
|
|
|
|
|
2006-03-04 08:07:12 +01:00
|
|
|
|
/* Get the value of register INDEX as saved in CONTEXT. */
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
|
|
|
|
inline _Unwind_Word
|
|
|
|
|
_Unwind_GetGR (struct _Unwind_Context *context, int index)
|
|
|
|
|
{
|
2003-07-16 00:49:07 +02:00
|
|
|
|
int size;
|
2011-08-08 15:26:06 +02:00
|
|
|
|
_Unwind_Context_Reg_Val val;
|
2003-07-16 00:49:07 +02:00
|
|
|
|
|
2004-09-30 10:21:27 +02:00
|
|
|
|
#ifdef DWARF_ZERO_REG
|
|
|
|
|
if (index == DWARF_ZERO_REG)
|
|
|
|
|
return 0;
|
|
|
|
|
#endif
|
|
|
|
|
|
2003-03-11 21:40:54 +01:00
|
|
|
|
index = DWARF_REG_TO_UNWIND_COLUMN (index);
|
unwind-dw2-fde-glibc.c (base_from_cb_data, [...]): Use gcc_assert and gcc_unreachable as appropriate.
* unwind-dw2-fde-glibc.c (base_from_cb_data,
_Unwind_IteratePhdrCallback): Use gcc_assert and gcc_unreachable as
appropriate.
* unwind-dw2-fde.c (__deregister_frame_info_bases,
base_from_object, fde_split, end_fde_sort): Likewise.
* unwind-dw2.c (_Unwind_GetGR, _Unwind_SetGR, execute_stack_op,
execute_cfa_program, _Unwind_SetSpColumn, uw_update_context_1,
uw_init_context_1): Likewise.
* unwind.inc (_Unwind_RaiseException_Phase2, _Unwind_Resume,
_Unwind_Resume_or_Rethrow): Likewise.
* unwind-pe.h (__gxx_abort): Do not define.
(size_of_encoded_value, base_of_encoded_value,
read_encoded_value_with_base): Use gcc_unreachable.
* unwind.h (_Unwind_GetTextRelBase): Likewise.
From-SVN: r99835
2005-05-17 17:37:47 +02:00
|
|
|
|
gcc_assert (index < (int) sizeof(dwarf_reg_size_table));
|
2003-07-16 00:49:07 +02:00
|
|
|
|
size = dwarf_reg_size_table[index];
|
2011-08-08 15:26:06 +02:00
|
|
|
|
val = context->reg[index];
|
2003-07-16 00:49:07 +02:00
|
|
|
|
|
unwind-dw2.c (SIGNAL_FRAME_BIT, [...]): Define.
* unwind-dw2.c (SIGNAL_FRAME_BIT, EXTENDED_CONTEXT_BIT): Define.
(struct _Unwind_Context): Rename args_size to flags, remove
signal_frame field, add a new args_size field and version field.
(_Unwind_IsSignalFrame, _Unwind_SetSignalFrame,
_Unwind_IsExtendedContext): New inline functions.
(_Unwind_GetGR, _Unwind_SetGR, _Unwind_GetGRPtr, _Unwind_SetGRPtr):
Assume by_value array is only present if _Unwind_IsExtendedContext.
(_Unwind_GetIPInfo, execute_cfa_program, uw_frame_state_for): Use
_Unwind_IsSignalFrame.
(__frame_state_for): Initialize context.flags to EXTENDED_CONTEXT_BIT.
(uw_update_context_1): Use _Unwind_SetSignalFrame.
(uw_init_context_1): Initialize context->flags to
EXTENDED_CONTEXT_BIT.
* config/rs6000/linux-unwind.h (frob_update_context): Use
_Unwind_SetSignalFrame.
From-SVN: r120406
2007-01-04 00:45:47 +01:00
|
|
|
|
if (_Unwind_IsExtendedContext (context) && context->by_value[index])
|
2011-08-08 15:26:06 +02:00
|
|
|
|
return _Unwind_Get_Unwind_Word (val);
|
2006-03-04 08:07:12 +01:00
|
|
|
|
|
2001-03-28 13:04:51 +02:00
|
|
|
|
/* This will segfault if the register hasn't been saved. */
|
2003-07-16 00:49:07 +02:00
|
|
|
|
if (size == sizeof(_Unwind_Ptr))
|
2011-08-08 15:26:06 +02:00
|
|
|
|
return * (_Unwind_Ptr *) (_Unwind_Internal_Ptr) val;
|
unwind-dw2-fde-glibc.c (base_from_cb_data, [...]): Use gcc_assert and gcc_unreachable as appropriate.
* unwind-dw2-fde-glibc.c (base_from_cb_data,
_Unwind_IteratePhdrCallback): Use gcc_assert and gcc_unreachable as
appropriate.
* unwind-dw2-fde.c (__deregister_frame_info_bases,
base_from_object, fde_split, end_fde_sort): Likewise.
* unwind-dw2.c (_Unwind_GetGR, _Unwind_SetGR, execute_stack_op,
execute_cfa_program, _Unwind_SetSpColumn, uw_update_context_1,
uw_init_context_1): Likewise.
* unwind.inc (_Unwind_RaiseException_Phase2, _Unwind_Resume,
_Unwind_Resume_or_Rethrow): Likewise.
* unwind-pe.h (__gxx_abort): Do not define.
(size_of_encoded_value, base_of_encoded_value,
read_encoded_value_with_base): Use gcc_unreachable.
* unwind.h (_Unwind_GetTextRelBase): Likewise.
From-SVN: r99835
2005-05-17 17:37:47 +02:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
gcc_assert (size == sizeof(_Unwind_Word));
|
2011-08-08 15:26:06 +02:00
|
|
|
|
return * (_Unwind_Word *) (_Unwind_Internal_Ptr) val;
|
unwind-dw2-fde-glibc.c (base_from_cb_data, [...]): Use gcc_assert and gcc_unreachable as appropriate.
* unwind-dw2-fde-glibc.c (base_from_cb_data,
_Unwind_IteratePhdrCallback): Use gcc_assert and gcc_unreachable as
appropriate.
* unwind-dw2-fde.c (__deregister_frame_info_bases,
base_from_object, fde_split, end_fde_sort): Likewise.
* unwind-dw2.c (_Unwind_GetGR, _Unwind_SetGR, execute_stack_op,
execute_cfa_program, _Unwind_SetSpColumn, uw_update_context_1,
uw_init_context_1): Likewise.
* unwind.inc (_Unwind_RaiseException_Phase2, _Unwind_Resume,
_Unwind_Resume_or_Rethrow): Likewise.
* unwind-pe.h (__gxx_abort): Do not define.
(size_of_encoded_value, base_of_encoded_value,
read_encoded_value_with_base): Use gcc_unreachable.
* unwind.h (_Unwind_GetTextRelBase): Likewise.
From-SVN: r99835
2005-05-17 17:37:47 +02:00
|
|
|
|
}
|
2003-07-16 00:49:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline void *
|
|
|
|
|
_Unwind_GetPtr (struct _Unwind_Context *context, int index)
|
|
|
|
|
{
|
|
|
|
|
return (void *)(_Unwind_Ptr) _Unwind_GetGR (context, index);
|
2001-03-28 13:04:51 +02:00
|
|
|
|
}
|
|
|
|
|
|
2003-04-03 04:06:55 +02:00
|
|
|
|
/* Get the value of the CFA as saved in CONTEXT. */
|
|
|
|
|
|
|
|
|
|
_Unwind_Word
|
|
|
|
|
_Unwind_GetCFA (struct _Unwind_Context *context)
|
|
|
|
|
{
|
2003-05-08 00:01:37 +02:00
|
|
|
|
return (_Unwind_Ptr) context->cfa;
|
2003-04-03 04:06:55 +02:00
|
|
|
|
}
|
|
|
|
|
|
2006-03-04 08:07:12 +01:00
|
|
|
|
/* Overwrite the saved value for register INDEX in CONTEXT with VAL. */
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
|
|
|
|
inline void
|
|
|
|
|
_Unwind_SetGR (struct _Unwind_Context *context, int index, _Unwind_Word val)
|
|
|
|
|
{
|
2003-07-16 00:49:07 +02:00
|
|
|
|
int size;
|
|
|
|
|
void *ptr;
|
|
|
|
|
|
2003-03-11 21:40:54 +01:00
|
|
|
|
index = DWARF_REG_TO_UNWIND_COLUMN (index);
|
unwind-dw2-fde-glibc.c (base_from_cb_data, [...]): Use gcc_assert and gcc_unreachable as appropriate.
* unwind-dw2-fde-glibc.c (base_from_cb_data,
_Unwind_IteratePhdrCallback): Use gcc_assert and gcc_unreachable as
appropriate.
* unwind-dw2-fde.c (__deregister_frame_info_bases,
base_from_object, fde_split, end_fde_sort): Likewise.
* unwind-dw2.c (_Unwind_GetGR, _Unwind_SetGR, execute_stack_op,
execute_cfa_program, _Unwind_SetSpColumn, uw_update_context_1,
uw_init_context_1): Likewise.
* unwind.inc (_Unwind_RaiseException_Phase2, _Unwind_Resume,
_Unwind_Resume_or_Rethrow): Likewise.
* unwind-pe.h (__gxx_abort): Do not define.
(size_of_encoded_value, base_of_encoded_value,
read_encoded_value_with_base): Use gcc_unreachable.
* unwind.h (_Unwind_GetTextRelBase): Likewise.
From-SVN: r99835
2005-05-17 17:37:47 +02:00
|
|
|
|
gcc_assert (index < (int) sizeof(dwarf_reg_size_table));
|
2003-07-16 00:49:07 +02:00
|
|
|
|
size = dwarf_reg_size_table[index];
|
2006-03-04 08:07:12 +01:00
|
|
|
|
|
unwind-dw2.c (SIGNAL_FRAME_BIT, [...]): Define.
* unwind-dw2.c (SIGNAL_FRAME_BIT, EXTENDED_CONTEXT_BIT): Define.
(struct _Unwind_Context): Rename args_size to flags, remove
signal_frame field, add a new args_size field and version field.
(_Unwind_IsSignalFrame, _Unwind_SetSignalFrame,
_Unwind_IsExtendedContext): New inline functions.
(_Unwind_GetGR, _Unwind_SetGR, _Unwind_GetGRPtr, _Unwind_SetGRPtr):
Assume by_value array is only present if _Unwind_IsExtendedContext.
(_Unwind_GetIPInfo, execute_cfa_program, uw_frame_state_for): Use
_Unwind_IsSignalFrame.
(__frame_state_for): Initialize context.flags to EXTENDED_CONTEXT_BIT.
(uw_update_context_1): Use _Unwind_SetSignalFrame.
(uw_init_context_1): Initialize context->flags to
EXTENDED_CONTEXT_BIT.
* config/rs6000/linux-unwind.h (frob_update_context): Use
_Unwind_SetSignalFrame.
From-SVN: r120406
2007-01-04 00:45:47 +01:00
|
|
|
|
if (_Unwind_IsExtendedContext (context) && context->by_value[index])
|
2006-03-04 08:07:12 +01:00
|
|
|
|
{
|
2011-08-08 15:26:06 +02:00
|
|
|
|
context->reg[index] = _Unwind_Get_Unwind_Context_Reg_Val (val);
|
2006-03-04 08:07:12 +01:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2011-08-08 15:26:06 +02:00
|
|
|
|
ptr = (void *) (_Unwind_Internal_Ptr) context->reg[index];
|
2003-07-16 00:49:07 +02:00
|
|
|
|
|
|
|
|
|
if (size == sizeof(_Unwind_Ptr))
|
|
|
|
|
* (_Unwind_Ptr *) ptr = val;
|
|
|
|
|
else
|
unwind-dw2-fde-glibc.c (base_from_cb_data, [...]): Use gcc_assert and gcc_unreachable as appropriate.
* unwind-dw2-fde-glibc.c (base_from_cb_data,
_Unwind_IteratePhdrCallback): Use gcc_assert and gcc_unreachable as
appropriate.
* unwind-dw2-fde.c (__deregister_frame_info_bases,
base_from_object, fde_split, end_fde_sort): Likewise.
* unwind-dw2.c (_Unwind_GetGR, _Unwind_SetGR, execute_stack_op,
execute_cfa_program, _Unwind_SetSpColumn, uw_update_context_1,
uw_init_context_1): Likewise.
* unwind.inc (_Unwind_RaiseException_Phase2, _Unwind_Resume,
_Unwind_Resume_or_Rethrow): Likewise.
* unwind-pe.h (__gxx_abort): Do not define.
(size_of_encoded_value, base_of_encoded_value,
read_encoded_value_with_base): Use gcc_unreachable.
* unwind.h (_Unwind_GetTextRelBase): Likewise.
From-SVN: r99835
2005-05-17 17:37:47 +02:00
|
|
|
|
{
|
|
|
|
|
gcc_assert (size == sizeof(_Unwind_Word));
|
|
|
|
|
* (_Unwind_Word *) ptr = val;
|
|
|
|
|
}
|
2001-03-28 13:04:51 +02:00
|
|
|
|
}
|
|
|
|
|
|
2003-03-11 21:40:54 +01:00
|
|
|
|
/* Get the pointer to a register INDEX as saved in CONTEXT. */
|
|
|
|
|
|
|
|
|
|
static inline void *
|
|
|
|
|
_Unwind_GetGRPtr (struct _Unwind_Context *context, int index)
|
|
|
|
|
{
|
|
|
|
|
index = DWARF_REG_TO_UNWIND_COLUMN (index);
|
unwind-dw2.c (SIGNAL_FRAME_BIT, [...]): Define.
* unwind-dw2.c (SIGNAL_FRAME_BIT, EXTENDED_CONTEXT_BIT): Define.
(struct _Unwind_Context): Rename args_size to flags, remove
signal_frame field, add a new args_size field and version field.
(_Unwind_IsSignalFrame, _Unwind_SetSignalFrame,
_Unwind_IsExtendedContext): New inline functions.
(_Unwind_GetGR, _Unwind_SetGR, _Unwind_GetGRPtr, _Unwind_SetGRPtr):
Assume by_value array is only present if _Unwind_IsExtendedContext.
(_Unwind_GetIPInfo, execute_cfa_program, uw_frame_state_for): Use
_Unwind_IsSignalFrame.
(__frame_state_for): Initialize context.flags to EXTENDED_CONTEXT_BIT.
(uw_update_context_1): Use _Unwind_SetSignalFrame.
(uw_init_context_1): Initialize context->flags to
EXTENDED_CONTEXT_BIT.
* config/rs6000/linux-unwind.h (frob_update_context): Use
_Unwind_SetSignalFrame.
From-SVN: r120406
2007-01-04 00:45:47 +01:00
|
|
|
|
if (_Unwind_IsExtendedContext (context) && context->by_value[index])
|
2006-03-04 08:07:12 +01:00
|
|
|
|
return &context->reg[index];
|
2011-08-08 15:26:06 +02:00
|
|
|
|
return (void *) (_Unwind_Internal_Ptr) context->reg[index];
|
2003-03-11 21:40:54 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Set the pointer to a register INDEX as saved in CONTEXT. */
|
|
|
|
|
|
|
|
|
|
static inline void
|
|
|
|
|
_Unwind_SetGRPtr (struct _Unwind_Context *context, int index, void *p)
|
|
|
|
|
{
|
|
|
|
|
index = DWARF_REG_TO_UNWIND_COLUMN (index);
|
unwind-dw2.c (SIGNAL_FRAME_BIT, [...]): Define.
* unwind-dw2.c (SIGNAL_FRAME_BIT, EXTENDED_CONTEXT_BIT): Define.
(struct _Unwind_Context): Rename args_size to flags, remove
signal_frame field, add a new args_size field and version field.
(_Unwind_IsSignalFrame, _Unwind_SetSignalFrame,
_Unwind_IsExtendedContext): New inline functions.
(_Unwind_GetGR, _Unwind_SetGR, _Unwind_GetGRPtr, _Unwind_SetGRPtr):
Assume by_value array is only present if _Unwind_IsExtendedContext.
(_Unwind_GetIPInfo, execute_cfa_program, uw_frame_state_for): Use
_Unwind_IsSignalFrame.
(__frame_state_for): Initialize context.flags to EXTENDED_CONTEXT_BIT.
(uw_update_context_1): Use _Unwind_SetSignalFrame.
(uw_init_context_1): Initialize context->flags to
EXTENDED_CONTEXT_BIT.
* config/rs6000/linux-unwind.h (frob_update_context): Use
_Unwind_SetSignalFrame.
From-SVN: r120406
2007-01-04 00:45:47 +01:00
|
|
|
|
if (_Unwind_IsExtendedContext (context))
|
|
|
|
|
context->by_value[index] = 0;
|
2011-08-08 15:26:06 +02:00
|
|
|
|
context->reg[index] = (_Unwind_Context_Reg_Val) (_Unwind_Internal_Ptr) p;
|
2003-03-11 21:40:54 +01:00
|
|
|
|
}
|
|
|
|
|
|
2006-03-04 08:07:12 +01:00
|
|
|
|
/* Overwrite the saved value for register INDEX in CONTEXT with VAL. */
|
|
|
|
|
|
|
|
|
|
static inline void
|
|
|
|
|
_Unwind_SetGRValue (struct _Unwind_Context *context, int index,
|
|
|
|
|
_Unwind_Word val)
|
|
|
|
|
{
|
|
|
|
|
index = DWARF_REG_TO_UNWIND_COLUMN (index);
|
|
|
|
|
gcc_assert (index < (int) sizeof(dwarf_reg_size_table));
|
2012-03-13 18:07:50 +01:00
|
|
|
|
/* Return column size may be smaller than _Unwind_Context_Reg_Val. */
|
|
|
|
|
gcc_assert (dwarf_reg_size_table[index] <= sizeof (_Unwind_Context_Reg_Val));
|
2006-03-04 08:07:12 +01:00
|
|
|
|
|
|
|
|
|
context->by_value[index] = 1;
|
2011-08-08 15:26:06 +02:00
|
|
|
|
context->reg[index] = _Unwind_Get_Unwind_Context_Reg_Val (val);
|
2006-03-04 08:07:12 +01:00
|
|
|
|
}
|
|
|
|
|
|
builtins.c, [...]: Fix comment typos.
* builtins.c, c-pragma.h, c-typeck.c, cgraph.c, cgraphunit.c,
combine.c, common.opt, config/dfp-bit.c, config/i386/i386.c,
config/m68k/m68k.c, config/m68k/m68k.md, config/mt/mt.c,
config/mt/mt.h, config/s390/s390.md, df-core.c, df-problems.c,
df-scan.c, df.h, diagnostic.c, expr.c, function.h, gimplify.c,
loop-invariant.c, omp-low.c, opts.c, passes.c,
rtl-factoring.c, rtlanal.c, struct-equiv.c, tree-cfgcleanup.c,
tree-ssa-loop-niter.c, tree-ssa-loop-prefetch.c,
tree-ssa-structalias.c, tree-ssa-threadedge.c,
tree-ssa-threadupdate.c, tree-vect-patterns.c,
tree-vect-transform.c, tree-vectorizer.h, tree-vrp.c,
unwind-dw2.c: Fix comment typos. Follow spelling conventions.
From-SVN: r111721
2006-03-05 00:05:24 +01:00
|
|
|
|
/* Return nonzero if register INDEX is stored by value rather than
|
2006-03-04 08:07:12 +01:00
|
|
|
|
by reference. */
|
|
|
|
|
|
|
|
|
|
static inline int
|
|
|
|
|
_Unwind_GRByValue (struct _Unwind_Context *context, int index)
|
|
|
|
|
{
|
|
|
|
|
index = DWARF_REG_TO_UNWIND_COLUMN (index);
|
|
|
|
|
return context->by_value[index];
|
|
|
|
|
}
|
|
|
|
|
|
2001-03-28 13:04:51 +02:00
|
|
|
|
/* Retrieve the return address for CONTEXT. */
|
|
|
|
|
|
|
|
|
|
inline _Unwind_Ptr
|
|
|
|
|
_Unwind_GetIP (struct _Unwind_Context *context)
|
|
|
|
|
{
|
|
|
|
|
return (_Unwind_Ptr) context->ra;
|
|
|
|
|
}
|
|
|
|
|
|
2006-02-27 18:26:26 +01:00
|
|
|
|
/* Retrieve the return address and flag whether that IP is before
|
|
|
|
|
or after first not yet fully executed instruction. */
|
|
|
|
|
|
|
|
|
|
inline _Unwind_Ptr
|
|
|
|
|
_Unwind_GetIPInfo (struct _Unwind_Context *context, int *ip_before_insn)
|
|
|
|
|
{
|
unwind-dw2.c (SIGNAL_FRAME_BIT, [...]): Define.
* unwind-dw2.c (SIGNAL_FRAME_BIT, EXTENDED_CONTEXT_BIT): Define.
(struct _Unwind_Context): Rename args_size to flags, remove
signal_frame field, add a new args_size field and version field.
(_Unwind_IsSignalFrame, _Unwind_SetSignalFrame,
_Unwind_IsExtendedContext): New inline functions.
(_Unwind_GetGR, _Unwind_SetGR, _Unwind_GetGRPtr, _Unwind_SetGRPtr):
Assume by_value array is only present if _Unwind_IsExtendedContext.
(_Unwind_GetIPInfo, execute_cfa_program, uw_frame_state_for): Use
_Unwind_IsSignalFrame.
(__frame_state_for): Initialize context.flags to EXTENDED_CONTEXT_BIT.
(uw_update_context_1): Use _Unwind_SetSignalFrame.
(uw_init_context_1): Initialize context->flags to
EXTENDED_CONTEXT_BIT.
* config/rs6000/linux-unwind.h (frob_update_context): Use
_Unwind_SetSignalFrame.
From-SVN: r120406
2007-01-04 00:45:47 +01:00
|
|
|
|
*ip_before_insn = _Unwind_IsSignalFrame (context);
|
2006-02-27 18:26:26 +01:00
|
|
|
|
return (_Unwind_Ptr) context->ra;
|
|
|
|
|
}
|
|
|
|
|
|
2001-03-28 13:04:51 +02:00
|
|
|
|
/* Overwrite the return address for CONTEXT with VAL. */
|
|
|
|
|
|
|
|
|
|
inline void
|
|
|
|
|
_Unwind_SetIP (struct _Unwind_Context *context, _Unwind_Ptr val)
|
|
|
|
|
{
|
|
|
|
|
context->ra = (void *) val;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void *
|
|
|
|
|
_Unwind_GetLanguageSpecificData (struct _Unwind_Context *context)
|
|
|
|
|
{
|
|
|
|
|
return context->lsda;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_Unwind_Ptr
|
|
|
|
|
_Unwind_GetRegionStart (struct _Unwind_Context *context)
|
|
|
|
|
{
|
|
|
|
|
return (_Unwind_Ptr) context->bases.func;
|
|
|
|
|
}
|
|
|
|
|
|
2002-11-25 18:20:10 +01:00
|
|
|
|
void *
|
2002-11-27 11:33:56 +01:00
|
|
|
|
_Unwind_FindEnclosingFunction (void *pc)
|
2002-11-25 18:20:10 +01:00
|
|
|
|
{
|
|
|
|
|
struct dwarf_eh_bases bases;
|
2003-11-01 10:59:50 +01:00
|
|
|
|
const struct dwarf_fde *fde = _Unwind_Find_FDE (pc-1, &bases);
|
2002-11-25 18:20:10 +01:00
|
|
|
|
if (fde)
|
|
|
|
|
return bases.func;
|
|
|
|
|
else
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2001-05-12 08:03:20 +02:00
|
|
|
|
#ifndef __ia64__
|
|
|
|
|
_Unwind_Ptr
|
|
|
|
|
_Unwind_GetDataRelBase (struct _Unwind_Context *context)
|
|
|
|
|
{
|
|
|
|
|
return (_Unwind_Ptr) context->bases.dbase;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_Unwind_Ptr
|
|
|
|
|
_Unwind_GetTextRelBase (struct _Unwind_Context *context)
|
|
|
|
|
{
|
|
|
|
|
return (_Unwind_Ptr) context->bases.tbase;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
tm.texi (MD_UNWIND_SUPPORT): Document.
* doc/tm.texi (MD_UNWIND_SUPPORT): Document.
(MD_FALLBACK_FRAME_STATE_FOR): Update.
* unwind-dw2.c (MD_UNWIND_SUPPORT): #include if defined.
(uw_frame_state_for): Adjust MD_FALLBACK_FRAME_STATE_FOR invocation.
(MD_FROB_UPDATE_CONTEXT): Remove default.
(uw_update_context_1): Instead #ifdef invocation.
* config/ia64/unwind-ia64.c (MD_UNWIND_SUPPORT): #include if defined.
(uw_frame_state_for): Adjust MD_FALLBACK_FRAME_STATE_FOR invocation.
* config/alpha/gnu.h (MD_FALLBACK_FRAME_STATE_FOR): Don't undef.
(MD_UNWIND_SUPPORT): Undefine this instead.
* config/i386/gnu.h: Likewise.
* config/alpha/linux-unwind.h: New file, macro converted to
function, extracted from..
* config/alpha/linux.h (MD_FALLBACK_FRAME_STATE_FOR): ..this.
(MD_UNWIND_SUPPORT): Define.
* config/alpha/vms-unwind.h, config/alpha/vms.h: Likewise.
* config/i386/linux-unwind.h, config/i386/linux.h,
config/i386/linux64.h: Likewise.
* config/ia64/linux-unwind.h, config/ia64/linux.h: Likewise.
MD_HANDLE_UNWABI too.
* config/mips/linux-unwind.h, config/mips/linux.h: Likewise.
* config/pa/linux-unwind.h, config/pa/pa32-linux.h: Likewise.
* config/rs6000/darwin-unwind.h, config/rs6000/darwin.h: Likewise.
* config/s390/linux-unwind.h, config/s390/linux.h: Likewise.
* config/sparc/linux-unwind.h, config/sparc/linux.h,
config/sparc/linux64.h: Likewise.
* config/sh/linux-unwind.h, config/sh/linux.h: Likewise, but merge
SH_FALLBACK_FRAME_FLOAT_STATE into sh_fallback_frame_state.
* config/rs6000/linux-unwind.h, config/rs6000/linux.h,
config/rs6000/linux64.h: Likewise. Split out get_sigcontext
function. Use ARG_POINTER_REGNUM for 32-bit temp reg too.
From-SVN: r87167
2004-09-08 02:17:19 +02:00
|
|
|
|
|
linux.h (MD_UNWIND_SUPPORT): Remove.
gcc:
* config/alpha/linux.h (MD_UNWIND_SUPPORT): Remove.
* config/alpha/osf5.h (MD_UNWIND_SUPPORT): Remove.
* config/alpha/vms.h (MD_UNWIND_SUPPORT): Remove.
* config/bfin/linux.h (MD_UNWIND_SUPPORT): Remove.
* config/bfin/uclinux.h (MD_UNWIND_SUPPORT): Remove.
* config/i386/linux.h (MD_UNWIND_SUPPORT): Remove.
* config/i386/linux64.h (MD_UNWIND_SUPPORT): Remove.
* config/i386/sol2.h (MD_UNWIND_SUPPORT): Remove.
* config/i386/mingw32.h (MD_UNWIND_SUPPORT): Remove.
* config/ia64/linux.h (MD_UNWIND_SUPPORT): Remove.
* config/ia64/vms.h (MD_UNWIND_SUPPORT): Remove.
* config/m68k/linux.h (MD_UNWIND_SUPPORT): Remove.
* config/mips/linux.h (MD_UNWIND_SUPPORT): Remove.
* config/pa/pa-hpux.h (MD_UNWIND_SUPPORT): Remove.
* config/pa/pa32-linux.h (MD_UNWIND_SUPPORT): Remove.
* config/rs6000/darwin.h (MD_UNWIND_SUPPORT): Remove.
* config/rs6000/linux.h (MD_UNWIND_SUPPORT): Remove.
* config/rs6000/linux64.h (MD_UNWIND_SUPPORT): Remove.
* config/s390/linux.h (MD_UNWIND_SUPPORT): Remove.
* config/s390/tpf.h (MD_UNWIND_SUPPORT): Remove.
* config/sh/linux.h (MD_UNWIND_SUPPORT): Remove.
* config/sparc/linux.h (MD_UNWIND_SUPPORT): Remove.
* config/sparc/linux64.h (MD_UNWIND_SUPPORT): Remove.
* config/sparc/sol2.h (MD_UNWIND_SUPPORT): Remove.
* config/xtensa/linux.h (MD_UNWIND_SUPPORT): Remove.
* config/alpha/linux-unwind.h: Move to ../libgcc/config/alpha.
* config/alpha/osf5-unwind.h: Move to ../libgcc/config/alpha.
* config/alpha/vms-unwind.h: Move to ../libgcc/config/alpha.
* config/bfin/linux-unwind.h: Move to ../libgcc/config/bfin.
* config/i386/linux-unwind.h: Move to ../libgcc/config/i386.
* config/i386/sol2-unwind.h: Move to ../libgcc/config/i386.
* config/i386/w32-unwind.h: Move to ../libgcc/config/i386.
* config/ia64/linux-unwind.h: Move to ../libgcc/config/ia64.
* config/ia64/vms-unwind.h: Move to ../libgcc/config/ia64.
* config/m68k/linux-unwind.h: Move to ../libgcc/config/m68k.
* config/mips/linux-unwind.h: Move to ../libgcc/config/mips.
* config/pa/hpux-unwind.h: Move to ../libgcc/config/pa.
* config/pa/linux-unwind.h: Move to ../libgcc/config/pa.
* config/rs6000/darwin-unwind.h: Move to ../libgcc/config/rs6000.
* config/rs6000/linux-unwind.h: Move to ../libgcc/config/rs6000.
* config/s390/linux-unwind.h: Move to ../libgcc/config/s390.
* config/s390/tpf-unwind.h: Move to ../libgcc/config/s390.
* config/sh/linux-unwind.h: Move to ../libgcc/config/sh.
* config/sparc/linux-unwind.h: Move to ../libgcc/config/sparc.
* config/sparc/sol2-unwind.h: Move to ../libgcc/config/sparc.
* config/xtensa/linux-unwind.h: Move to ../libgcc/config/xtensa.
* config/darwin9.h (DARWIN_LIBSYSTEM_HAS_UNWIND): Remove.
* system.h (MD_UNWIND_SUPPORT): Poison.
* doc/tm.texi.in (Exception Handling, MD_UNWIND_SUPPORT): Remove.
* doc/tm.texi: Regenerate.
* unwind-dw2.c: Include md-unwind-support.h instead of
MD_UNWIND_SUPPORT.
* config/ia64/unwind-ia64.c: Likewise.
* config/xtensa/unwind-dw2-xtensa.c: Likewise.
libgcc:
* config/alpha/linux-unwind.h: Move from ../gcc/config/alpha.
* config/alpha/osf5-unwind.h: Move from ../gcc/config/alpha.
* config/alpha/vms-unwind.h: Move from ../gcc/config/alpha.
* config/bfin/linux-unwind.h: Move from ../gcc/config/bfin.
* config/i386/linux-unwind.h: Move from ../gcc/config/i386.
* config/i386/sol2-unwind.h: Move from ../gcc/config/i386.
* config/i386/w32-unwind.h: Move from ../gcc/config/i386.
Wrap in !__MINGW64__.
* config/ia64/linux-unwind.h: Move from ../gcc/config/ia64.
* config/ia64/vms-unwind.h: Move from ../gcc/config/ia64.
* config/m68k/linux-unwind.h: Move from ../gcc/config/m68k.
* config/mips/linux-unwind.h: Move from ../gcc/config/mips.
* config/pa/hpux-unwind.h: Move from ../gcc/config/pa.
* config/pa/linux-unwind.h: Move from ../gcc/config/pa.
* config/rs6000/darwin-unwind.h: Move from ../gcc/config/rs6000.
Wrap in !__LP64__.
* config/rs6000/linux-unwind.h: Move from ../gcc/config/rs6000.
* config/s390/linux-unwind.h: Move from ../gcc/config/s390.
* config/s390/tpf-unwind.h: Move from ../gcc/config/s390.
* config/sh/linux-unwind.h: Move from ../gcc/config/sh.
* config/sparc/linux-unwind.h: Move from ../gcc/config/sparc.
* config/sparc/sol2-unwind.h: Move from ../gcc/config/sparc.
* config/xtensa/linux-unwind.h: Move from ../gcc/config/xtensa.
* config/no-unwind.h: New file.
* config.host (md_unwind_header): Document.
Define.
(alpha*-*-linux*, alpha*-dec-osf5.1*, alpha64-dec-*vms*,
alpha*-dec-*vms*, bfin*-uclinux*, bfin*-linux-uclibc*,
hppa*-*-linux*, hppa[12]*-*-hpux10*, hppa*64*-*-hpux11*,
hppa[12]*-*-hpux11*): Set md_unwind_header.
(i[34567]86-*-linux*): Handle i[34567]86-*-kopensolaris*-gnu.
Set md_unwind_header.
(x86_64-*-linux*, i[34567]86-*-solaris2*): Set md_unwind_header.
(i[34567]86-*-cygwin*): Split from i[34567]86-*-mingw*.
(i[34567]86-*-mingw*, ia64*-*-linux*, ia64-hp-*vms*,
m68k-*-uclinux*, m68k-*-linux*, mips64*-*-linux*, mips*-*-linux*,
powerpc-*-darwin*, powerpc-*-linux*, s390-*-linux*,
s390x-*-linux*, s390x-ibm-tpf*, sh*-*-linux*, sparc-*-linux*,
sparc*-*-solaris2*, sparc64-*-linux*, xtensa*-*-linux*): Set
md_unwind_header.
* configure.ac: Link md-unwind-support.h to $md_unwind_header.
* configure: Regenerate.
From-SVN: r174613
2011-06-03 20:30:39 +02:00
|
|
|
|
#include "md-unwind-support.h"
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
|
|
|
|
/* Extract any interesting information from the CIE for the translation
|
|
|
|
|
unit F belongs to. Return a pointer to the byte after the augmentation,
|
|
|
|
|
or NULL if we encountered an undecipherable augmentation. */
|
|
|
|
|
|
except.c (eh_data_format_name): Move to ...
* except.c (eh_data_format_name): Move to ...
* dwarf2asm.c: ... here. Use designated initializers if available.
(dw2_asm_output_encoded_addr_rtx): Accept varargs commentary.
* dwarf2asm.h: Update declarations.
* dwarf2out.c (output_cfi) [DW_CFA_set_loc]: If for_eh, mind
ASM_PREFERRED_EH_DATA_FORMAT.
(output_call_frame_info): Likewise. Use 'L' augmentation for
the LSDA encoding.
* unwind-dw2-fde.h (struct fde_vector): New.
(struct old_object): Rename from struct object.
(struct object): New.
(__register_frame_info_bases): Declare.
(__register_frame_info_table_bases): Declare.
(struct dwarf_fde): Remove explicit pc_begin/pc_range members.
* unwind-dw2-fde.c (objects): Remove.
(unseen_objects, seen_objects): New.
(__register_frame_info_bases): New.
(__register_frame_info): Use it.
(__register_frame_info_table_bases): New.
(__register_frame_info_table): Use it.
(__deregister_frame_info): Rewrite for changed object struct.
(base_from_object, get_cie_encoding, get_fde_encoding): New.
(fde_unencoded_compare): Rename from fde_compare; uninline.
(fde_single_encoding_compare, fde_mixed_encoding_compare): New.
(start_fde_sort): Adjust for new definition of fde_vector.
(fde_insert): Likewise.
(end_fde_sort): Likewise. Select comparison function based
on properties of the object.
(fde_split): Take object and fde_compare_t arguments.
(frame_heapsort, fde_merge): Likewise.
(classify_object_over_fdes): Rename from count_fdes. Handle
encoded pointers. Collect encoding, mixed_encoding, and pc_begin
for the object.
(add_fdes): Handle encoded pointers.
(init_object): Rename from frame_init. Update for new struct object.
(linear_search_fdes): Rename from search_fdes. Handle encoded
pointers.
(binary_search_unencoded_fdes): Broken out from _Unwind_Find_FDE.
(binary_search_single_encoding_fdes): New.
(binary_search_mixed_encoding_fdes): New.
(search_object): New.
(_Unwind_Find_FDE): Update for new struct object. Fill in
the dwarf_eh_bases.
* unwind-dw2.c: Include unwind-pe.h. Constify all pointers
iterating over EH data.
(_Unwind_FrameState): Remove saw_lsda, addr_encoding. Add
fde_encoding, lsda_encoding.
(read_uleb128, read_sleb128): Remove.
(read_encoded_pointer): Remove. All callers use read_encoded_value.
(extract_cie_info): Set lsda_encoding from 'L' augmentation.
(uw_frame_state_for): Don't set bases.func. Handle encoded fde
pointers.
* unwind-pe.h: Add "struct" to _Unwind_Context references.
From-SVN: r42176
2001-05-17 00:42:36 +02:00
|
|
|
|
static const unsigned char *
|
2003-11-01 10:59:50 +01:00
|
|
|
|
extract_cie_info (const struct dwarf_cie *cie, struct _Unwind_Context *context,
|
2001-03-28 13:04:51 +02:00
|
|
|
|
_Unwind_FrameState *fs)
|
|
|
|
|
{
|
except.c (eh_data_format_name): Move to ...
* except.c (eh_data_format_name): Move to ...
* dwarf2asm.c: ... here. Use designated initializers if available.
(dw2_asm_output_encoded_addr_rtx): Accept varargs commentary.
* dwarf2asm.h: Update declarations.
* dwarf2out.c (output_cfi) [DW_CFA_set_loc]: If for_eh, mind
ASM_PREFERRED_EH_DATA_FORMAT.
(output_call_frame_info): Likewise. Use 'L' augmentation for
the LSDA encoding.
* unwind-dw2-fde.h (struct fde_vector): New.
(struct old_object): Rename from struct object.
(struct object): New.
(__register_frame_info_bases): Declare.
(__register_frame_info_table_bases): Declare.
(struct dwarf_fde): Remove explicit pc_begin/pc_range members.
* unwind-dw2-fde.c (objects): Remove.
(unseen_objects, seen_objects): New.
(__register_frame_info_bases): New.
(__register_frame_info): Use it.
(__register_frame_info_table_bases): New.
(__register_frame_info_table): Use it.
(__deregister_frame_info): Rewrite for changed object struct.
(base_from_object, get_cie_encoding, get_fde_encoding): New.
(fde_unencoded_compare): Rename from fde_compare; uninline.
(fde_single_encoding_compare, fde_mixed_encoding_compare): New.
(start_fde_sort): Adjust for new definition of fde_vector.
(fde_insert): Likewise.
(end_fde_sort): Likewise. Select comparison function based
on properties of the object.
(fde_split): Take object and fde_compare_t arguments.
(frame_heapsort, fde_merge): Likewise.
(classify_object_over_fdes): Rename from count_fdes. Handle
encoded pointers. Collect encoding, mixed_encoding, and pc_begin
for the object.
(add_fdes): Handle encoded pointers.
(init_object): Rename from frame_init. Update for new struct object.
(linear_search_fdes): Rename from search_fdes. Handle encoded
pointers.
(binary_search_unencoded_fdes): Broken out from _Unwind_Find_FDE.
(binary_search_single_encoding_fdes): New.
(binary_search_mixed_encoding_fdes): New.
(search_object): New.
(_Unwind_Find_FDE): Update for new struct object. Fill in
the dwarf_eh_bases.
* unwind-dw2.c: Include unwind-pe.h. Constify all pointers
iterating over EH data.
(_Unwind_FrameState): Remove saw_lsda, addr_encoding. Add
fde_encoding, lsda_encoding.
(read_uleb128, read_sleb128): Remove.
(read_encoded_pointer): Remove. All callers use read_encoded_value.
(extract_cie_info): Set lsda_encoding from 'L' augmentation.
(uw_frame_state_for): Don't set bases.func. Handle encoded fde
pointers.
* unwind-pe.h: Add "struct" to _Unwind_Context references.
From-SVN: r42176
2001-05-17 00:42:36 +02:00
|
|
|
|
const unsigned char *aug = cie->augmentation;
|
2004-08-19 23:41:32 +02:00
|
|
|
|
const unsigned char *p = aug + strlen ((const char *)aug) + 1;
|
except.c (eh_data_format_name): Move to ...
* except.c (eh_data_format_name): Move to ...
* dwarf2asm.c: ... here. Use designated initializers if available.
(dw2_asm_output_encoded_addr_rtx): Accept varargs commentary.
* dwarf2asm.h: Update declarations.
* dwarf2out.c (output_cfi) [DW_CFA_set_loc]: If for_eh, mind
ASM_PREFERRED_EH_DATA_FORMAT.
(output_call_frame_info): Likewise. Use 'L' augmentation for
the LSDA encoding.
* unwind-dw2-fde.h (struct fde_vector): New.
(struct old_object): Rename from struct object.
(struct object): New.
(__register_frame_info_bases): Declare.
(__register_frame_info_table_bases): Declare.
(struct dwarf_fde): Remove explicit pc_begin/pc_range members.
* unwind-dw2-fde.c (objects): Remove.
(unseen_objects, seen_objects): New.
(__register_frame_info_bases): New.
(__register_frame_info): Use it.
(__register_frame_info_table_bases): New.
(__register_frame_info_table): Use it.
(__deregister_frame_info): Rewrite for changed object struct.
(base_from_object, get_cie_encoding, get_fde_encoding): New.
(fde_unencoded_compare): Rename from fde_compare; uninline.
(fde_single_encoding_compare, fde_mixed_encoding_compare): New.
(start_fde_sort): Adjust for new definition of fde_vector.
(fde_insert): Likewise.
(end_fde_sort): Likewise. Select comparison function based
on properties of the object.
(fde_split): Take object and fde_compare_t arguments.
(frame_heapsort, fde_merge): Likewise.
(classify_object_over_fdes): Rename from count_fdes. Handle
encoded pointers. Collect encoding, mixed_encoding, and pc_begin
for the object.
(add_fdes): Handle encoded pointers.
(init_object): Rename from frame_init. Update for new struct object.
(linear_search_fdes): Rename from search_fdes. Handle encoded
pointers.
(binary_search_unencoded_fdes): Broken out from _Unwind_Find_FDE.
(binary_search_single_encoding_fdes): New.
(binary_search_mixed_encoding_fdes): New.
(search_object): New.
(_Unwind_Find_FDE): Update for new struct object. Fill in
the dwarf_eh_bases.
* unwind-dw2.c: Include unwind-pe.h. Constify all pointers
iterating over EH data.
(_Unwind_FrameState): Remove saw_lsda, addr_encoding. Add
fde_encoding, lsda_encoding.
(read_uleb128, read_sleb128): Remove.
(read_encoded_pointer): Remove. All callers use read_encoded_value.
(extract_cie_info): Set lsda_encoding from 'L' augmentation.
(uw_frame_state_for): Don't set bases.func. Handle encoded fde
pointers.
* unwind-pe.h: Add "struct" to _Unwind_Context references.
From-SVN: r42176
2001-05-17 00:42:36 +02:00
|
|
|
|
const unsigned char *ret = NULL;
|
unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with
_uleb128_t and _Unwind_SWord with _sleb128_t.
* unwind-dw2.c (extract_cie_info, execute_stack_op, execute_cfa_program,
uw_frame_state_for, uw_update_context_1): Likewise.
* unwind-c.c (parse_lsda_header, PERSONALITY_FUNCTION): Likewise.
* unwind-pe.h (read_uleb128, read_sleb128,
read_encoded_value_with_base): Likewise.
* unwind-generic.h: Define _sleb128_t and _uleb128_t types.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* libsupc++/eh_personality.cc (parse_lsda_header, check_exception_spec,
get_ttype_entry, empty_exception_spec, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* exception.cc (parse_lsda_header, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
From-SVN: r121116
2007-01-24 15:46:47 +01:00
|
|
|
|
_uleb128_t utmp;
|
|
|
|
|
_sleb128_t stmp;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
2001-07-19 20:20:49 +02:00
|
|
|
|
/* g++ v2 "eh" has pointer immediately following augmentation string,
|
|
|
|
|
so it must be handled first. */
|
|
|
|
|
if (aug[0] == 'e' && aug[1] == 'h')
|
|
|
|
|
{
|
|
|
|
|
fs->eh_ptr = read_pointer (p);
|
|
|
|
|
p += sizeof (void *);
|
|
|
|
|
aug += 2;
|
|
|
|
|
}
|
|
|
|
|
|
2010-04-21 08:57:37 +02:00
|
|
|
|
/* After the augmentation resp. pointer for "eh" augmentation
|
|
|
|
|
follows for CIE version >= 4 address size byte and
|
|
|
|
|
segment size byte. */
|
|
|
|
|
if (__builtin_expect (cie->version >= 4, 0))
|
|
|
|
|
{
|
|
|
|
|
if (p[0] != sizeof (void *) || p[1] != 0)
|
|
|
|
|
return NULL;
|
|
|
|
|
p += 2;
|
|
|
|
|
}
|
|
|
|
|
/* Immediately following this are the code and
|
2001-03-28 13:04:51 +02:00
|
|
|
|
data alignment and return address column. */
|
unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with
_uleb128_t and _Unwind_SWord with _sleb128_t.
* unwind-dw2.c (extract_cie_info, execute_stack_op, execute_cfa_program,
uw_frame_state_for, uw_update_context_1): Likewise.
* unwind-c.c (parse_lsda_header, PERSONALITY_FUNCTION): Likewise.
* unwind-pe.h (read_uleb128, read_sleb128,
read_encoded_value_with_base): Likewise.
* unwind-generic.h: Define _sleb128_t and _uleb128_t types.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* libsupc++/eh_personality.cc (parse_lsda_header, check_exception_spec,
get_ttype_entry, empty_exception_spec, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* exception.cc (parse_lsda_header, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
From-SVN: r121116
2007-01-24 15:46:47 +01:00
|
|
|
|
p = read_uleb128 (p, &utmp);
|
|
|
|
|
fs->code_align = (_Unwind_Word)utmp;
|
|
|
|
|
p = read_sleb128 (p, &stmp);
|
|
|
|
|
fs->data_align = (_Unwind_Sword)stmp;
|
2004-05-21 00:34:58 +02:00
|
|
|
|
if (cie->version == 1)
|
|
|
|
|
fs->retaddr_column = *p++;
|
|
|
|
|
else
|
unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with
_uleb128_t and _Unwind_SWord with _sleb128_t.
* unwind-dw2.c (extract_cie_info, execute_stack_op, execute_cfa_program,
uw_frame_state_for, uw_update_context_1): Likewise.
* unwind-c.c (parse_lsda_header, PERSONALITY_FUNCTION): Likewise.
* unwind-pe.h (read_uleb128, read_sleb128,
read_encoded_value_with_base): Likewise.
* unwind-generic.h: Define _sleb128_t and _uleb128_t types.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* libsupc++/eh_personality.cc (parse_lsda_header, check_exception_spec,
get_ttype_entry, empty_exception_spec, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* exception.cc (parse_lsda_header, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
From-SVN: r121116
2007-01-24 15:46:47 +01:00
|
|
|
|
{
|
|
|
|
|
p = read_uleb128 (p, &utmp);
|
|
|
|
|
fs->retaddr_column = (_Unwind_Word)utmp;
|
|
|
|
|
}
|
except.c (eh_data_format_name): Move to ...
* except.c (eh_data_format_name): Move to ...
* dwarf2asm.c: ... here. Use designated initializers if available.
(dw2_asm_output_encoded_addr_rtx): Accept varargs commentary.
* dwarf2asm.h: Update declarations.
* dwarf2out.c (output_cfi) [DW_CFA_set_loc]: If for_eh, mind
ASM_PREFERRED_EH_DATA_FORMAT.
(output_call_frame_info): Likewise. Use 'L' augmentation for
the LSDA encoding.
* unwind-dw2-fde.h (struct fde_vector): New.
(struct old_object): Rename from struct object.
(struct object): New.
(__register_frame_info_bases): Declare.
(__register_frame_info_table_bases): Declare.
(struct dwarf_fde): Remove explicit pc_begin/pc_range members.
* unwind-dw2-fde.c (objects): Remove.
(unseen_objects, seen_objects): New.
(__register_frame_info_bases): New.
(__register_frame_info): Use it.
(__register_frame_info_table_bases): New.
(__register_frame_info_table): Use it.
(__deregister_frame_info): Rewrite for changed object struct.
(base_from_object, get_cie_encoding, get_fde_encoding): New.
(fde_unencoded_compare): Rename from fde_compare; uninline.
(fde_single_encoding_compare, fde_mixed_encoding_compare): New.
(start_fde_sort): Adjust for new definition of fde_vector.
(fde_insert): Likewise.
(end_fde_sort): Likewise. Select comparison function based
on properties of the object.
(fde_split): Take object and fde_compare_t arguments.
(frame_heapsort, fde_merge): Likewise.
(classify_object_over_fdes): Rename from count_fdes. Handle
encoded pointers. Collect encoding, mixed_encoding, and pc_begin
for the object.
(add_fdes): Handle encoded pointers.
(init_object): Rename from frame_init. Update for new struct object.
(linear_search_fdes): Rename from search_fdes. Handle encoded
pointers.
(binary_search_unencoded_fdes): Broken out from _Unwind_Find_FDE.
(binary_search_single_encoding_fdes): New.
(binary_search_mixed_encoding_fdes): New.
(search_object): New.
(_Unwind_Find_FDE): Update for new struct object. Fill in
the dwarf_eh_bases.
* unwind-dw2.c: Include unwind-pe.h. Constify all pointers
iterating over EH data.
(_Unwind_FrameState): Remove saw_lsda, addr_encoding. Add
fde_encoding, lsda_encoding.
(read_uleb128, read_sleb128): Remove.
(read_encoded_pointer): Remove. All callers use read_encoded_value.
(extract_cie_info): Set lsda_encoding from 'L' augmentation.
(uw_frame_state_for): Don't set bases.func. Handle encoded fde
pointers.
* unwind-pe.h: Add "struct" to _Unwind_Context references.
From-SVN: r42176
2001-05-17 00:42:36 +02:00
|
|
|
|
fs->lsda_encoding = DW_EH_PE_omit;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
|
|
|
|
/* If the augmentation starts with 'z', then a uleb128 immediately
|
|
|
|
|
follows containing the length of the augmentation field following
|
|
|
|
|
the size. */
|
|
|
|
|
if (*aug == 'z')
|
|
|
|
|
{
|
2001-08-31 11:49:13 +02:00
|
|
|
|
p = read_uleb128 (p, &utmp);
|
|
|
|
|
ret = p + utmp;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
|
|
|
|
fs->saw_z = 1;
|
|
|
|
|
++aug;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Iterate over recognized augmentation subsequences. */
|
|
|
|
|
while (*aug != '\0')
|
|
|
|
|
{
|
except.c (eh_data_format_name): Move to ...
* except.c (eh_data_format_name): Move to ...
* dwarf2asm.c: ... here. Use designated initializers if available.
(dw2_asm_output_encoded_addr_rtx): Accept varargs commentary.
* dwarf2asm.h: Update declarations.
* dwarf2out.c (output_cfi) [DW_CFA_set_loc]: If for_eh, mind
ASM_PREFERRED_EH_DATA_FORMAT.
(output_call_frame_info): Likewise. Use 'L' augmentation for
the LSDA encoding.
* unwind-dw2-fde.h (struct fde_vector): New.
(struct old_object): Rename from struct object.
(struct object): New.
(__register_frame_info_bases): Declare.
(__register_frame_info_table_bases): Declare.
(struct dwarf_fde): Remove explicit pc_begin/pc_range members.
* unwind-dw2-fde.c (objects): Remove.
(unseen_objects, seen_objects): New.
(__register_frame_info_bases): New.
(__register_frame_info): Use it.
(__register_frame_info_table_bases): New.
(__register_frame_info_table): Use it.
(__deregister_frame_info): Rewrite for changed object struct.
(base_from_object, get_cie_encoding, get_fde_encoding): New.
(fde_unencoded_compare): Rename from fde_compare; uninline.
(fde_single_encoding_compare, fde_mixed_encoding_compare): New.
(start_fde_sort): Adjust for new definition of fde_vector.
(fde_insert): Likewise.
(end_fde_sort): Likewise. Select comparison function based
on properties of the object.
(fde_split): Take object and fde_compare_t arguments.
(frame_heapsort, fde_merge): Likewise.
(classify_object_over_fdes): Rename from count_fdes. Handle
encoded pointers. Collect encoding, mixed_encoding, and pc_begin
for the object.
(add_fdes): Handle encoded pointers.
(init_object): Rename from frame_init. Update for new struct object.
(linear_search_fdes): Rename from search_fdes. Handle encoded
pointers.
(binary_search_unencoded_fdes): Broken out from _Unwind_Find_FDE.
(binary_search_single_encoding_fdes): New.
(binary_search_mixed_encoding_fdes): New.
(search_object): New.
(_Unwind_Find_FDE): Update for new struct object. Fill in
the dwarf_eh_bases.
* unwind-dw2.c: Include unwind-pe.h. Constify all pointers
iterating over EH data.
(_Unwind_FrameState): Remove saw_lsda, addr_encoding. Add
fde_encoding, lsda_encoding.
(read_uleb128, read_sleb128): Remove.
(read_encoded_pointer): Remove. All callers use read_encoded_value.
(extract_cie_info): Set lsda_encoding from 'L' augmentation.
(uw_frame_state_for): Don't set bases.func. Handle encoded fde
pointers.
* unwind-pe.h: Add "struct" to _Unwind_Context references.
From-SVN: r42176
2001-05-17 00:42:36 +02:00
|
|
|
|
/* "L" indicates a byte showing how the LSDA pointer is encoded. */
|
2001-07-19 20:20:49 +02:00
|
|
|
|
if (aug[0] == 'L')
|
except.c (eh_data_format_name): Move to ...
* except.c (eh_data_format_name): Move to ...
* dwarf2asm.c: ... here. Use designated initializers if available.
(dw2_asm_output_encoded_addr_rtx): Accept varargs commentary.
* dwarf2asm.h: Update declarations.
* dwarf2out.c (output_cfi) [DW_CFA_set_loc]: If for_eh, mind
ASM_PREFERRED_EH_DATA_FORMAT.
(output_call_frame_info): Likewise. Use 'L' augmentation for
the LSDA encoding.
* unwind-dw2-fde.h (struct fde_vector): New.
(struct old_object): Rename from struct object.
(struct object): New.
(__register_frame_info_bases): Declare.
(__register_frame_info_table_bases): Declare.
(struct dwarf_fde): Remove explicit pc_begin/pc_range members.
* unwind-dw2-fde.c (objects): Remove.
(unseen_objects, seen_objects): New.
(__register_frame_info_bases): New.
(__register_frame_info): Use it.
(__register_frame_info_table_bases): New.
(__register_frame_info_table): Use it.
(__deregister_frame_info): Rewrite for changed object struct.
(base_from_object, get_cie_encoding, get_fde_encoding): New.
(fde_unencoded_compare): Rename from fde_compare; uninline.
(fde_single_encoding_compare, fde_mixed_encoding_compare): New.
(start_fde_sort): Adjust for new definition of fde_vector.
(fde_insert): Likewise.
(end_fde_sort): Likewise. Select comparison function based
on properties of the object.
(fde_split): Take object and fde_compare_t arguments.
(frame_heapsort, fde_merge): Likewise.
(classify_object_over_fdes): Rename from count_fdes. Handle
encoded pointers. Collect encoding, mixed_encoding, and pc_begin
for the object.
(add_fdes): Handle encoded pointers.
(init_object): Rename from frame_init. Update for new struct object.
(linear_search_fdes): Rename from search_fdes. Handle encoded
pointers.
(binary_search_unencoded_fdes): Broken out from _Unwind_Find_FDE.
(binary_search_single_encoding_fdes): New.
(binary_search_mixed_encoding_fdes): New.
(search_object): New.
(_Unwind_Find_FDE): Update for new struct object. Fill in
the dwarf_eh_bases.
* unwind-dw2.c: Include unwind-pe.h. Constify all pointers
iterating over EH data.
(_Unwind_FrameState): Remove saw_lsda, addr_encoding. Add
fde_encoding, lsda_encoding.
(read_uleb128, read_sleb128): Remove.
(read_encoded_pointer): Remove. All callers use read_encoded_value.
(extract_cie_info): Set lsda_encoding from 'L' augmentation.
(uw_frame_state_for): Don't set bases.func. Handle encoded fde
pointers.
* unwind-pe.h: Add "struct" to _Unwind_Context references.
From-SVN: r42176
2001-05-17 00:42:36 +02:00
|
|
|
|
{
|
|
|
|
|
fs->lsda_encoding = *p++;
|
|
|
|
|
aug += 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* "R" indicates a byte indicating how FDE addresses are encoded. */
|
2001-03-28 13:04:51 +02:00
|
|
|
|
else if (aug[0] == 'R')
|
|
|
|
|
{
|
except.c (eh_data_format_name): Move to ...
* except.c (eh_data_format_name): Move to ...
* dwarf2asm.c: ... here. Use designated initializers if available.
(dw2_asm_output_encoded_addr_rtx): Accept varargs commentary.
* dwarf2asm.h: Update declarations.
* dwarf2out.c (output_cfi) [DW_CFA_set_loc]: If for_eh, mind
ASM_PREFERRED_EH_DATA_FORMAT.
(output_call_frame_info): Likewise. Use 'L' augmentation for
the LSDA encoding.
* unwind-dw2-fde.h (struct fde_vector): New.
(struct old_object): Rename from struct object.
(struct object): New.
(__register_frame_info_bases): Declare.
(__register_frame_info_table_bases): Declare.
(struct dwarf_fde): Remove explicit pc_begin/pc_range members.
* unwind-dw2-fde.c (objects): Remove.
(unseen_objects, seen_objects): New.
(__register_frame_info_bases): New.
(__register_frame_info): Use it.
(__register_frame_info_table_bases): New.
(__register_frame_info_table): Use it.
(__deregister_frame_info): Rewrite for changed object struct.
(base_from_object, get_cie_encoding, get_fde_encoding): New.
(fde_unencoded_compare): Rename from fde_compare; uninline.
(fde_single_encoding_compare, fde_mixed_encoding_compare): New.
(start_fde_sort): Adjust for new definition of fde_vector.
(fde_insert): Likewise.
(end_fde_sort): Likewise. Select comparison function based
on properties of the object.
(fde_split): Take object and fde_compare_t arguments.
(frame_heapsort, fde_merge): Likewise.
(classify_object_over_fdes): Rename from count_fdes. Handle
encoded pointers. Collect encoding, mixed_encoding, and pc_begin
for the object.
(add_fdes): Handle encoded pointers.
(init_object): Rename from frame_init. Update for new struct object.
(linear_search_fdes): Rename from search_fdes. Handle encoded
pointers.
(binary_search_unencoded_fdes): Broken out from _Unwind_Find_FDE.
(binary_search_single_encoding_fdes): New.
(binary_search_mixed_encoding_fdes): New.
(search_object): New.
(_Unwind_Find_FDE): Update for new struct object. Fill in
the dwarf_eh_bases.
* unwind-dw2.c: Include unwind-pe.h. Constify all pointers
iterating over EH data.
(_Unwind_FrameState): Remove saw_lsda, addr_encoding. Add
fde_encoding, lsda_encoding.
(read_uleb128, read_sleb128): Remove.
(read_encoded_pointer): Remove. All callers use read_encoded_value.
(extract_cie_info): Set lsda_encoding from 'L' augmentation.
(uw_frame_state_for): Don't set bases.func. Handle encoded fde
pointers.
* unwind-pe.h: Add "struct" to _Unwind_Context references.
From-SVN: r42176
2001-05-17 00:42:36 +02:00
|
|
|
|
fs->fde_encoding = *p++;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
aug += 1;
|
|
|
|
|
}
|
|
|
|
|
|
except.c (eh_data_format_name): Move to ...
* except.c (eh_data_format_name): Move to ...
* dwarf2asm.c: ... here. Use designated initializers if available.
(dw2_asm_output_encoded_addr_rtx): Accept varargs commentary.
* dwarf2asm.h: Update declarations.
* dwarf2out.c (output_cfi) [DW_CFA_set_loc]: If for_eh, mind
ASM_PREFERRED_EH_DATA_FORMAT.
(output_call_frame_info): Likewise. Use 'L' augmentation for
the LSDA encoding.
* unwind-dw2-fde.h (struct fde_vector): New.
(struct old_object): Rename from struct object.
(struct object): New.
(__register_frame_info_bases): Declare.
(__register_frame_info_table_bases): Declare.
(struct dwarf_fde): Remove explicit pc_begin/pc_range members.
* unwind-dw2-fde.c (objects): Remove.
(unseen_objects, seen_objects): New.
(__register_frame_info_bases): New.
(__register_frame_info): Use it.
(__register_frame_info_table_bases): New.
(__register_frame_info_table): Use it.
(__deregister_frame_info): Rewrite for changed object struct.
(base_from_object, get_cie_encoding, get_fde_encoding): New.
(fde_unencoded_compare): Rename from fde_compare; uninline.
(fde_single_encoding_compare, fde_mixed_encoding_compare): New.
(start_fde_sort): Adjust for new definition of fde_vector.
(fde_insert): Likewise.
(end_fde_sort): Likewise. Select comparison function based
on properties of the object.
(fde_split): Take object and fde_compare_t arguments.
(frame_heapsort, fde_merge): Likewise.
(classify_object_over_fdes): Rename from count_fdes. Handle
encoded pointers. Collect encoding, mixed_encoding, and pc_begin
for the object.
(add_fdes): Handle encoded pointers.
(init_object): Rename from frame_init. Update for new struct object.
(linear_search_fdes): Rename from search_fdes. Handle encoded
pointers.
(binary_search_unencoded_fdes): Broken out from _Unwind_Find_FDE.
(binary_search_single_encoding_fdes): New.
(binary_search_mixed_encoding_fdes): New.
(search_object): New.
(_Unwind_Find_FDE): Update for new struct object. Fill in
the dwarf_eh_bases.
* unwind-dw2.c: Include unwind-pe.h. Constify all pointers
iterating over EH data.
(_Unwind_FrameState): Remove saw_lsda, addr_encoding. Add
fde_encoding, lsda_encoding.
(read_uleb128, read_sleb128): Remove.
(read_encoded_pointer): Remove. All callers use read_encoded_value.
(extract_cie_info): Set lsda_encoding from 'L' augmentation.
(uw_frame_state_for): Don't set bases.func. Handle encoded fde
pointers.
* unwind-pe.h: Add "struct" to _Unwind_Context references.
From-SVN: r42176
2001-05-17 00:42:36 +02:00
|
|
|
|
/* "P" indicates a personality routine in the CIE augmentation. */
|
2001-03-28 13:04:51 +02:00
|
|
|
|
else if (aug[0] == 'P')
|
|
|
|
|
{
|
2005-06-14 10:25:18 +02:00
|
|
|
|
_Unwind_Ptr personality;
|
2009-11-25 11:55:54 +01:00
|
|
|
|
|
2005-06-14 10:25:18 +02:00
|
|
|
|
p = read_encoded_value (context, *p, p + 1, &personality);
|
|
|
|
|
fs->personality = (_Unwind_Personality_Fn) personality;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
aug += 1;
|
|
|
|
|
}
|
|
|
|
|
|
2006-02-27 18:26:26 +01:00
|
|
|
|
/* "S" indicates a signal frame. */
|
|
|
|
|
else if (aug[0] == 'S')
|
|
|
|
|
{
|
|
|
|
|
fs->signal_frame = 1;
|
|
|
|
|
aug += 1;
|
|
|
|
|
}
|
|
|
|
|
|
2001-03-28 13:04:51 +02:00
|
|
|
|
/* Otherwise we have an unknown augmentation string.
|
|
|
|
|
Bail unless we saw a 'z' prefix. */
|
|
|
|
|
else
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ret ? ret : p;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Decode a DW_OP stack program. Return the top of stack. Push INITIAL
|
|
|
|
|
onto the stack to start. */
|
|
|
|
|
|
|
|
|
|
static _Unwind_Word
|
except.c (eh_data_format_name): Move to ...
* except.c (eh_data_format_name): Move to ...
* dwarf2asm.c: ... here. Use designated initializers if available.
(dw2_asm_output_encoded_addr_rtx): Accept varargs commentary.
* dwarf2asm.h: Update declarations.
* dwarf2out.c (output_cfi) [DW_CFA_set_loc]: If for_eh, mind
ASM_PREFERRED_EH_DATA_FORMAT.
(output_call_frame_info): Likewise. Use 'L' augmentation for
the LSDA encoding.
* unwind-dw2-fde.h (struct fde_vector): New.
(struct old_object): Rename from struct object.
(struct object): New.
(__register_frame_info_bases): Declare.
(__register_frame_info_table_bases): Declare.
(struct dwarf_fde): Remove explicit pc_begin/pc_range members.
* unwind-dw2-fde.c (objects): Remove.
(unseen_objects, seen_objects): New.
(__register_frame_info_bases): New.
(__register_frame_info): Use it.
(__register_frame_info_table_bases): New.
(__register_frame_info_table): Use it.
(__deregister_frame_info): Rewrite for changed object struct.
(base_from_object, get_cie_encoding, get_fde_encoding): New.
(fde_unencoded_compare): Rename from fde_compare; uninline.
(fde_single_encoding_compare, fde_mixed_encoding_compare): New.
(start_fde_sort): Adjust for new definition of fde_vector.
(fde_insert): Likewise.
(end_fde_sort): Likewise. Select comparison function based
on properties of the object.
(fde_split): Take object and fde_compare_t arguments.
(frame_heapsort, fde_merge): Likewise.
(classify_object_over_fdes): Rename from count_fdes. Handle
encoded pointers. Collect encoding, mixed_encoding, and pc_begin
for the object.
(add_fdes): Handle encoded pointers.
(init_object): Rename from frame_init. Update for new struct object.
(linear_search_fdes): Rename from search_fdes. Handle encoded
pointers.
(binary_search_unencoded_fdes): Broken out from _Unwind_Find_FDE.
(binary_search_single_encoding_fdes): New.
(binary_search_mixed_encoding_fdes): New.
(search_object): New.
(_Unwind_Find_FDE): Update for new struct object. Fill in
the dwarf_eh_bases.
* unwind-dw2.c: Include unwind-pe.h. Constify all pointers
iterating over EH data.
(_Unwind_FrameState): Remove saw_lsda, addr_encoding. Add
fde_encoding, lsda_encoding.
(read_uleb128, read_sleb128): Remove.
(read_encoded_pointer): Remove. All callers use read_encoded_value.
(extract_cie_info): Set lsda_encoding from 'L' augmentation.
(uw_frame_state_for): Don't set bases.func. Handle encoded fde
pointers.
* unwind-pe.h: Add "struct" to _Unwind_Context references.
From-SVN: r42176
2001-05-17 00:42:36 +02:00
|
|
|
|
execute_stack_op (const unsigned char *op_ptr, const unsigned char *op_end,
|
2001-03-28 13:04:51 +02:00
|
|
|
|
struct _Unwind_Context *context, _Unwind_Word initial)
|
|
|
|
|
{
|
2001-08-17 23:23:12 +02:00
|
|
|
|
_Unwind_Word stack[64]; /* ??? Assume this is enough. */
|
2001-03-28 13:04:51 +02:00
|
|
|
|
int stack_elt;
|
|
|
|
|
|
|
|
|
|
stack[0] = initial;
|
|
|
|
|
stack_elt = 1;
|
|
|
|
|
|
|
|
|
|
while (op_ptr < op_end)
|
|
|
|
|
{
|
|
|
|
|
enum dwarf_location_atom op = *op_ptr++;
|
unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with
_uleb128_t and _Unwind_SWord with _sleb128_t.
* unwind-dw2.c (extract_cie_info, execute_stack_op, execute_cfa_program,
uw_frame_state_for, uw_update_context_1): Likewise.
* unwind-c.c (parse_lsda_header, PERSONALITY_FUNCTION): Likewise.
* unwind-pe.h (read_uleb128, read_sleb128,
read_encoded_value_with_base): Likewise.
* unwind-generic.h: Define _sleb128_t and _uleb128_t types.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* libsupc++/eh_personality.cc (parse_lsda_header, check_exception_spec,
get_ttype_entry, empty_exception_spec, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* exception.cc (parse_lsda_header, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
From-SVN: r121116
2007-01-24 15:46:47 +01:00
|
|
|
|
_Unwind_Word result;
|
|
|
|
|
_uleb128_t reg, utmp;
|
|
|
|
|
_sleb128_t offset, stmp;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
|
|
|
|
switch (op)
|
|
|
|
|
{
|
|
|
|
|
case DW_OP_lit0:
|
|
|
|
|
case DW_OP_lit1:
|
|
|
|
|
case DW_OP_lit2:
|
|
|
|
|
case DW_OP_lit3:
|
|
|
|
|
case DW_OP_lit4:
|
|
|
|
|
case DW_OP_lit5:
|
|
|
|
|
case DW_OP_lit6:
|
|
|
|
|
case DW_OP_lit7:
|
|
|
|
|
case DW_OP_lit8:
|
|
|
|
|
case DW_OP_lit9:
|
|
|
|
|
case DW_OP_lit10:
|
|
|
|
|
case DW_OP_lit11:
|
|
|
|
|
case DW_OP_lit12:
|
|
|
|
|
case DW_OP_lit13:
|
|
|
|
|
case DW_OP_lit14:
|
|
|
|
|
case DW_OP_lit15:
|
|
|
|
|
case DW_OP_lit16:
|
|
|
|
|
case DW_OP_lit17:
|
|
|
|
|
case DW_OP_lit18:
|
|
|
|
|
case DW_OP_lit19:
|
|
|
|
|
case DW_OP_lit20:
|
|
|
|
|
case DW_OP_lit21:
|
|
|
|
|
case DW_OP_lit22:
|
|
|
|
|
case DW_OP_lit23:
|
|
|
|
|
case DW_OP_lit24:
|
|
|
|
|
case DW_OP_lit25:
|
|
|
|
|
case DW_OP_lit26:
|
|
|
|
|
case DW_OP_lit27:
|
|
|
|
|
case DW_OP_lit28:
|
|
|
|
|
case DW_OP_lit29:
|
|
|
|
|
case DW_OP_lit30:
|
|
|
|
|
case DW_OP_lit31:
|
|
|
|
|
result = op - DW_OP_lit0;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DW_OP_addr:
|
|
|
|
|
result = (_Unwind_Word) (_Unwind_Ptr) read_pointer (op_ptr);
|
|
|
|
|
op_ptr += sizeof (void *);
|
|
|
|
|
break;
|
|
|
|
|
|
2008-09-25 00:38:03 +02:00
|
|
|
|
case DW_OP_GNU_encoded_addr:
|
|
|
|
|
{
|
|
|
|
|
_Unwind_Ptr presult;
|
|
|
|
|
op_ptr = read_encoded_value (context, *op_ptr, op_ptr+1, &presult);
|
|
|
|
|
result = presult;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
2001-03-28 13:04:51 +02:00
|
|
|
|
case DW_OP_const1u:
|
|
|
|
|
result = read_1u (op_ptr);
|
|
|
|
|
op_ptr += 1;
|
|
|
|
|
break;
|
|
|
|
|
case DW_OP_const1s:
|
|
|
|
|
result = read_1s (op_ptr);
|
|
|
|
|
op_ptr += 1;
|
|
|
|
|
break;
|
|
|
|
|
case DW_OP_const2u:
|
|
|
|
|
result = read_2u (op_ptr);
|
|
|
|
|
op_ptr += 2;
|
|
|
|
|
break;
|
|
|
|
|
case DW_OP_const2s:
|
|
|
|
|
result = read_2s (op_ptr);
|
|
|
|
|
op_ptr += 2;
|
|
|
|
|
break;
|
|
|
|
|
case DW_OP_const4u:
|
|
|
|
|
result = read_4u (op_ptr);
|
|
|
|
|
op_ptr += 4;
|
|
|
|
|
break;
|
|
|
|
|
case DW_OP_const4s:
|
|
|
|
|
result = read_4s (op_ptr);
|
|
|
|
|
op_ptr += 4;
|
|
|
|
|
break;
|
|
|
|
|
case DW_OP_const8u:
|
|
|
|
|
result = read_8u (op_ptr);
|
|
|
|
|
op_ptr += 8;
|
|
|
|
|
break;
|
|
|
|
|
case DW_OP_const8s:
|
|
|
|
|
result = read_8s (op_ptr);
|
|
|
|
|
op_ptr += 8;
|
|
|
|
|
break;
|
|
|
|
|
case DW_OP_constu:
|
unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with
_uleb128_t and _Unwind_SWord with _sleb128_t.
* unwind-dw2.c (extract_cie_info, execute_stack_op, execute_cfa_program,
uw_frame_state_for, uw_update_context_1): Likewise.
* unwind-c.c (parse_lsda_header, PERSONALITY_FUNCTION): Likewise.
* unwind-pe.h (read_uleb128, read_sleb128,
read_encoded_value_with_base): Likewise.
* unwind-generic.h: Define _sleb128_t and _uleb128_t types.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* libsupc++/eh_personality.cc (parse_lsda_header, check_exception_spec,
get_ttype_entry, empty_exception_spec, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* exception.cc (parse_lsda_header, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
From-SVN: r121116
2007-01-24 15:46:47 +01:00
|
|
|
|
op_ptr = read_uleb128 (op_ptr, &utmp);
|
|
|
|
|
result = (_Unwind_Word)utmp;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
break;
|
|
|
|
|
case DW_OP_consts:
|
2001-08-31 11:49:13 +02:00
|
|
|
|
op_ptr = read_sleb128 (op_ptr, &stmp);
|
unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with
_uleb128_t and _Unwind_SWord with _sleb128_t.
* unwind-dw2.c (extract_cie_info, execute_stack_op, execute_cfa_program,
uw_frame_state_for, uw_update_context_1): Likewise.
* unwind-c.c (parse_lsda_header, PERSONALITY_FUNCTION): Likewise.
* unwind-pe.h (read_uleb128, read_sleb128,
read_encoded_value_with_base): Likewise.
* unwind-generic.h: Define _sleb128_t and _uleb128_t types.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* libsupc++/eh_personality.cc (parse_lsda_header, check_exception_spec,
get_ttype_entry, empty_exception_spec, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* exception.cc (parse_lsda_header, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
From-SVN: r121116
2007-01-24 15:46:47 +01:00
|
|
|
|
result = (_Unwind_Sword)stmp;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DW_OP_reg0:
|
|
|
|
|
case DW_OP_reg1:
|
|
|
|
|
case DW_OP_reg2:
|
|
|
|
|
case DW_OP_reg3:
|
|
|
|
|
case DW_OP_reg4:
|
|
|
|
|
case DW_OP_reg5:
|
|
|
|
|
case DW_OP_reg6:
|
|
|
|
|
case DW_OP_reg7:
|
|
|
|
|
case DW_OP_reg8:
|
|
|
|
|
case DW_OP_reg9:
|
|
|
|
|
case DW_OP_reg10:
|
|
|
|
|
case DW_OP_reg11:
|
|
|
|
|
case DW_OP_reg12:
|
|
|
|
|
case DW_OP_reg13:
|
|
|
|
|
case DW_OP_reg14:
|
|
|
|
|
case DW_OP_reg15:
|
|
|
|
|
case DW_OP_reg16:
|
|
|
|
|
case DW_OP_reg17:
|
|
|
|
|
case DW_OP_reg18:
|
|
|
|
|
case DW_OP_reg19:
|
|
|
|
|
case DW_OP_reg20:
|
|
|
|
|
case DW_OP_reg21:
|
|
|
|
|
case DW_OP_reg22:
|
|
|
|
|
case DW_OP_reg23:
|
|
|
|
|
case DW_OP_reg24:
|
|
|
|
|
case DW_OP_reg25:
|
|
|
|
|
case DW_OP_reg26:
|
|
|
|
|
case DW_OP_reg27:
|
|
|
|
|
case DW_OP_reg28:
|
|
|
|
|
case DW_OP_reg29:
|
|
|
|
|
case DW_OP_reg30:
|
|
|
|
|
case DW_OP_reg31:
|
|
|
|
|
result = _Unwind_GetGR (context, op - DW_OP_reg0);
|
|
|
|
|
break;
|
|
|
|
|
case DW_OP_regx:
|
2001-08-31 11:49:13 +02:00
|
|
|
|
op_ptr = read_uleb128 (op_ptr, ®);
|
2001-03-28 13:04:51 +02:00
|
|
|
|
result = _Unwind_GetGR (context, reg);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DW_OP_breg0:
|
|
|
|
|
case DW_OP_breg1:
|
|
|
|
|
case DW_OP_breg2:
|
|
|
|
|
case DW_OP_breg3:
|
|
|
|
|
case DW_OP_breg4:
|
|
|
|
|
case DW_OP_breg5:
|
|
|
|
|
case DW_OP_breg6:
|
|
|
|
|
case DW_OP_breg7:
|
|
|
|
|
case DW_OP_breg8:
|
|
|
|
|
case DW_OP_breg9:
|
|
|
|
|
case DW_OP_breg10:
|
|
|
|
|
case DW_OP_breg11:
|
|
|
|
|
case DW_OP_breg12:
|
|
|
|
|
case DW_OP_breg13:
|
|
|
|
|
case DW_OP_breg14:
|
|
|
|
|
case DW_OP_breg15:
|
|
|
|
|
case DW_OP_breg16:
|
|
|
|
|
case DW_OP_breg17:
|
|
|
|
|
case DW_OP_breg18:
|
|
|
|
|
case DW_OP_breg19:
|
|
|
|
|
case DW_OP_breg20:
|
|
|
|
|
case DW_OP_breg21:
|
|
|
|
|
case DW_OP_breg22:
|
|
|
|
|
case DW_OP_breg23:
|
|
|
|
|
case DW_OP_breg24:
|
|
|
|
|
case DW_OP_breg25:
|
|
|
|
|
case DW_OP_breg26:
|
|
|
|
|
case DW_OP_breg27:
|
|
|
|
|
case DW_OP_breg28:
|
|
|
|
|
case DW_OP_breg29:
|
|
|
|
|
case DW_OP_breg30:
|
|
|
|
|
case DW_OP_breg31:
|
2001-08-31 11:49:13 +02:00
|
|
|
|
op_ptr = read_sleb128 (op_ptr, &offset);
|
2001-03-28 13:04:51 +02:00
|
|
|
|
result = _Unwind_GetGR (context, op - DW_OP_breg0) + offset;
|
|
|
|
|
break;
|
|
|
|
|
case DW_OP_bregx:
|
2001-08-31 11:49:13 +02:00
|
|
|
|
op_ptr = read_uleb128 (op_ptr, ®);
|
|
|
|
|
op_ptr = read_sleb128 (op_ptr, &offset);
|
unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with
_uleb128_t and _Unwind_SWord with _sleb128_t.
* unwind-dw2.c (extract_cie_info, execute_stack_op, execute_cfa_program,
uw_frame_state_for, uw_update_context_1): Likewise.
* unwind-c.c (parse_lsda_header, PERSONALITY_FUNCTION): Likewise.
* unwind-pe.h (read_uleb128, read_sleb128,
read_encoded_value_with_base): Likewise.
* unwind-generic.h: Define _sleb128_t and _uleb128_t types.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* libsupc++/eh_personality.cc (parse_lsda_header, check_exception_spec,
get_ttype_entry, empty_exception_spec, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* exception.cc (parse_lsda_header, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
From-SVN: r121116
2007-01-24 15:46:47 +01:00
|
|
|
|
result = _Unwind_GetGR (context, reg) + (_Unwind_Word)offset;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DW_OP_dup:
|
unwind-dw2-fde-glibc.c (base_from_cb_data, [...]): Use gcc_assert and gcc_unreachable as appropriate.
* unwind-dw2-fde-glibc.c (base_from_cb_data,
_Unwind_IteratePhdrCallback): Use gcc_assert and gcc_unreachable as
appropriate.
* unwind-dw2-fde.c (__deregister_frame_info_bases,
base_from_object, fde_split, end_fde_sort): Likewise.
* unwind-dw2.c (_Unwind_GetGR, _Unwind_SetGR, execute_stack_op,
execute_cfa_program, _Unwind_SetSpColumn, uw_update_context_1,
uw_init_context_1): Likewise.
* unwind.inc (_Unwind_RaiseException_Phase2, _Unwind_Resume,
_Unwind_Resume_or_Rethrow): Likewise.
* unwind-pe.h (__gxx_abort): Do not define.
(size_of_encoded_value, base_of_encoded_value,
read_encoded_value_with_base): Use gcc_unreachable.
* unwind.h (_Unwind_GetTextRelBase): Likewise.
From-SVN: r99835
2005-05-17 17:37:47 +02:00
|
|
|
|
gcc_assert (stack_elt);
|
2001-03-28 13:04:51 +02:00
|
|
|
|
result = stack[stack_elt - 1];
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DW_OP_drop:
|
unwind-dw2-fde-glibc.c (base_from_cb_data, [...]): Use gcc_assert and gcc_unreachable as appropriate.
* unwind-dw2-fde-glibc.c (base_from_cb_data,
_Unwind_IteratePhdrCallback): Use gcc_assert and gcc_unreachable as
appropriate.
* unwind-dw2-fde.c (__deregister_frame_info_bases,
base_from_object, fde_split, end_fde_sort): Likewise.
* unwind-dw2.c (_Unwind_GetGR, _Unwind_SetGR, execute_stack_op,
execute_cfa_program, _Unwind_SetSpColumn, uw_update_context_1,
uw_init_context_1): Likewise.
* unwind.inc (_Unwind_RaiseException_Phase2, _Unwind_Resume,
_Unwind_Resume_or_Rethrow): Likewise.
* unwind-pe.h (__gxx_abort): Do not define.
(size_of_encoded_value, base_of_encoded_value,
read_encoded_value_with_base): Use gcc_unreachable.
* unwind.h (_Unwind_GetTextRelBase): Likewise.
From-SVN: r99835
2005-05-17 17:37:47 +02:00
|
|
|
|
gcc_assert (stack_elt);
|
|
|
|
|
stack_elt -= 1;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
goto no_push;
|
|
|
|
|
|
|
|
|
|
case DW_OP_pick:
|
|
|
|
|
offset = *op_ptr++;
|
unwind-dw2-fde-glibc.c (base_from_cb_data, [...]): Use gcc_assert and gcc_unreachable as appropriate.
* unwind-dw2-fde-glibc.c (base_from_cb_data,
_Unwind_IteratePhdrCallback): Use gcc_assert and gcc_unreachable as
appropriate.
* unwind-dw2-fde.c (__deregister_frame_info_bases,
base_from_object, fde_split, end_fde_sort): Likewise.
* unwind-dw2.c (_Unwind_GetGR, _Unwind_SetGR, execute_stack_op,
execute_cfa_program, _Unwind_SetSpColumn, uw_update_context_1,
uw_init_context_1): Likewise.
* unwind.inc (_Unwind_RaiseException_Phase2, _Unwind_Resume,
_Unwind_Resume_or_Rethrow): Likewise.
* unwind-pe.h (__gxx_abort): Do not define.
(size_of_encoded_value, base_of_encoded_value,
read_encoded_value_with_base): Use gcc_unreachable.
* unwind.h (_Unwind_GetTextRelBase): Likewise.
From-SVN: r99835
2005-05-17 17:37:47 +02:00
|
|
|
|
gcc_assert (offset < stack_elt - 1);
|
2001-03-28 13:04:51 +02:00
|
|
|
|
result = stack[stack_elt - 1 - offset];
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DW_OP_over:
|
unwind-dw2-fde-glibc.c (base_from_cb_data, [...]): Use gcc_assert and gcc_unreachable as appropriate.
* unwind-dw2-fde-glibc.c (base_from_cb_data,
_Unwind_IteratePhdrCallback): Use gcc_assert and gcc_unreachable as
appropriate.
* unwind-dw2-fde.c (__deregister_frame_info_bases,
base_from_object, fde_split, end_fde_sort): Likewise.
* unwind-dw2.c (_Unwind_GetGR, _Unwind_SetGR, execute_stack_op,
execute_cfa_program, _Unwind_SetSpColumn, uw_update_context_1,
uw_init_context_1): Likewise.
* unwind.inc (_Unwind_RaiseException_Phase2, _Unwind_Resume,
_Unwind_Resume_or_Rethrow): Likewise.
* unwind-pe.h (__gxx_abort): Do not define.
(size_of_encoded_value, base_of_encoded_value,
read_encoded_value_with_base): Use gcc_unreachable.
* unwind.h (_Unwind_GetTextRelBase): Likewise.
From-SVN: r99835
2005-05-17 17:37:47 +02:00
|
|
|
|
gcc_assert (stack_elt >= 2);
|
2001-03-28 13:04:51 +02:00
|
|
|
|
result = stack[stack_elt - 2];
|
|
|
|
|
break;
|
|
|
|
|
|
2007-01-25 08:08:33 +01:00
|
|
|
|
case DW_OP_swap:
|
|
|
|
|
{
|
|
|
|
|
_Unwind_Word t;
|
|
|
|
|
gcc_assert (stack_elt >= 2);
|
|
|
|
|
t = stack[stack_elt - 1];
|
|
|
|
|
stack[stack_elt - 1] = stack[stack_elt - 2];
|
|
|
|
|
stack[stack_elt - 2] = t;
|
|
|
|
|
goto no_push;
|
|
|
|
|
}
|
|
|
|
|
|
2001-03-28 13:04:51 +02:00
|
|
|
|
case DW_OP_rot:
|
|
|
|
|
{
|
|
|
|
|
_Unwind_Word t1, t2, t3;
|
|
|
|
|
|
unwind-dw2-fde-glibc.c (base_from_cb_data, [...]): Use gcc_assert and gcc_unreachable as appropriate.
* unwind-dw2-fde-glibc.c (base_from_cb_data,
_Unwind_IteratePhdrCallback): Use gcc_assert and gcc_unreachable as
appropriate.
* unwind-dw2-fde.c (__deregister_frame_info_bases,
base_from_object, fde_split, end_fde_sort): Likewise.
* unwind-dw2.c (_Unwind_GetGR, _Unwind_SetGR, execute_stack_op,
execute_cfa_program, _Unwind_SetSpColumn, uw_update_context_1,
uw_init_context_1): Likewise.
* unwind.inc (_Unwind_RaiseException_Phase2, _Unwind_Resume,
_Unwind_Resume_or_Rethrow): Likewise.
* unwind-pe.h (__gxx_abort): Do not define.
(size_of_encoded_value, base_of_encoded_value,
read_encoded_value_with_base): Use gcc_unreachable.
* unwind.h (_Unwind_GetTextRelBase): Likewise.
From-SVN: r99835
2005-05-17 17:37:47 +02:00
|
|
|
|
gcc_assert (stack_elt >= 3);
|
2001-03-28 13:04:51 +02:00
|
|
|
|
t1 = stack[stack_elt - 1];
|
|
|
|
|
t2 = stack[stack_elt - 2];
|
|
|
|
|
t3 = stack[stack_elt - 3];
|
|
|
|
|
stack[stack_elt - 1] = t2;
|
|
|
|
|
stack[stack_elt - 2] = t3;
|
|
|
|
|
stack[stack_elt - 3] = t1;
|
|
|
|
|
goto no_push;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case DW_OP_deref:
|
|
|
|
|
case DW_OP_deref_size:
|
|
|
|
|
case DW_OP_abs:
|
|
|
|
|
case DW_OP_neg:
|
|
|
|
|
case DW_OP_not:
|
|
|
|
|
case DW_OP_plus_uconst:
|
|
|
|
|
/* Unary operations. */
|
unwind-dw2-fde-glibc.c (base_from_cb_data, [...]): Use gcc_assert and gcc_unreachable as appropriate.
* unwind-dw2-fde-glibc.c (base_from_cb_data,
_Unwind_IteratePhdrCallback): Use gcc_assert and gcc_unreachable as
appropriate.
* unwind-dw2-fde.c (__deregister_frame_info_bases,
base_from_object, fde_split, end_fde_sort): Likewise.
* unwind-dw2.c (_Unwind_GetGR, _Unwind_SetGR, execute_stack_op,
execute_cfa_program, _Unwind_SetSpColumn, uw_update_context_1,
uw_init_context_1): Likewise.
* unwind.inc (_Unwind_RaiseException_Phase2, _Unwind_Resume,
_Unwind_Resume_or_Rethrow): Likewise.
* unwind-pe.h (__gxx_abort): Do not define.
(size_of_encoded_value, base_of_encoded_value,
read_encoded_value_with_base): Use gcc_unreachable.
* unwind.h (_Unwind_GetTextRelBase): Likewise.
From-SVN: r99835
2005-05-17 17:37:47 +02:00
|
|
|
|
gcc_assert (stack_elt);
|
|
|
|
|
stack_elt -= 1;
|
2009-11-25 11:55:54 +01:00
|
|
|
|
|
2001-03-28 13:04:51 +02:00
|
|
|
|
result = stack[stack_elt];
|
|
|
|
|
|
|
|
|
|
switch (op)
|
|
|
|
|
{
|
|
|
|
|
case DW_OP_deref:
|
|
|
|
|
{
|
2002-01-10 21:12:57 +01:00
|
|
|
|
void *ptr = (void *) (_Unwind_Ptr) result;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
result = (_Unwind_Ptr) read_pointer (ptr);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DW_OP_deref_size:
|
|
|
|
|
{
|
2002-01-10 21:12:57 +01:00
|
|
|
|
void *ptr = (void *) (_Unwind_Ptr) result;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
switch (*op_ptr++)
|
|
|
|
|
{
|
|
|
|
|
case 1:
|
|
|
|
|
result = read_1u (ptr);
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
result = read_2u (ptr);
|
|
|
|
|
break;
|
|
|
|
|
case 4:
|
|
|
|
|
result = read_4u (ptr);
|
|
|
|
|
break;
|
|
|
|
|
case 8:
|
|
|
|
|
result = read_8u (ptr);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
unwind-dw2-fde-glibc.c (base_from_cb_data, [...]): Use gcc_assert and gcc_unreachable as appropriate.
* unwind-dw2-fde-glibc.c (base_from_cb_data,
_Unwind_IteratePhdrCallback): Use gcc_assert and gcc_unreachable as
appropriate.
* unwind-dw2-fde.c (__deregister_frame_info_bases,
base_from_object, fde_split, end_fde_sort): Likewise.
* unwind-dw2.c (_Unwind_GetGR, _Unwind_SetGR, execute_stack_op,
execute_cfa_program, _Unwind_SetSpColumn, uw_update_context_1,
uw_init_context_1): Likewise.
* unwind.inc (_Unwind_RaiseException_Phase2, _Unwind_Resume,
_Unwind_Resume_or_Rethrow): Likewise.
* unwind-pe.h (__gxx_abort): Do not define.
(size_of_encoded_value, base_of_encoded_value,
read_encoded_value_with_base): Use gcc_unreachable.
* unwind.h (_Unwind_GetTextRelBase): Likewise.
From-SVN: r99835
2005-05-17 17:37:47 +02:00
|
|
|
|
gcc_unreachable ();
|
2001-03-28 13:04:51 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DW_OP_abs:
|
|
|
|
|
if ((_Unwind_Sword) result < 0)
|
|
|
|
|
result = -result;
|
|
|
|
|
break;
|
|
|
|
|
case DW_OP_neg:
|
|
|
|
|
result = -result;
|
|
|
|
|
break;
|
|
|
|
|
case DW_OP_not:
|
|
|
|
|
result = ~result;
|
|
|
|
|
break;
|
|
|
|
|
case DW_OP_plus_uconst:
|
2001-08-31 11:49:13 +02:00
|
|
|
|
op_ptr = read_uleb128 (op_ptr, &utmp);
|
unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with
_uleb128_t and _Unwind_SWord with _sleb128_t.
* unwind-dw2.c (extract_cie_info, execute_stack_op, execute_cfa_program,
uw_frame_state_for, uw_update_context_1): Likewise.
* unwind-c.c (parse_lsda_header, PERSONALITY_FUNCTION): Likewise.
* unwind-pe.h (read_uleb128, read_sleb128,
read_encoded_value_with_base): Likewise.
* unwind-generic.h: Define _sleb128_t and _uleb128_t types.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* libsupc++/eh_personality.cc (parse_lsda_header, check_exception_spec,
get_ttype_entry, empty_exception_spec, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* exception.cc (parse_lsda_header, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
From-SVN: r121116
2007-01-24 15:46:47 +01:00
|
|
|
|
result += (_Unwind_Word)utmp;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
break;
|
2001-08-19 02:09:46 +02:00
|
|
|
|
|
|
|
|
|
default:
|
unwind-dw2-fde-glibc.c (base_from_cb_data, [...]): Use gcc_assert and gcc_unreachable as appropriate.
* unwind-dw2-fde-glibc.c (base_from_cb_data,
_Unwind_IteratePhdrCallback): Use gcc_assert and gcc_unreachable as
appropriate.
* unwind-dw2-fde.c (__deregister_frame_info_bases,
base_from_object, fde_split, end_fde_sort): Likewise.
* unwind-dw2.c (_Unwind_GetGR, _Unwind_SetGR, execute_stack_op,
execute_cfa_program, _Unwind_SetSpColumn, uw_update_context_1,
uw_init_context_1): Likewise.
* unwind.inc (_Unwind_RaiseException_Phase2, _Unwind_Resume,
_Unwind_Resume_or_Rethrow): Likewise.
* unwind-pe.h (__gxx_abort): Do not define.
(size_of_encoded_value, base_of_encoded_value,
read_encoded_value_with_base): Use gcc_unreachable.
* unwind.h (_Unwind_GetTextRelBase): Likewise.
From-SVN: r99835
2005-05-17 17:37:47 +02:00
|
|
|
|
gcc_unreachable ();
|
2001-03-28 13:04:51 +02:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DW_OP_and:
|
|
|
|
|
case DW_OP_div:
|
|
|
|
|
case DW_OP_minus:
|
|
|
|
|
case DW_OP_mod:
|
|
|
|
|
case DW_OP_mul:
|
|
|
|
|
case DW_OP_or:
|
|
|
|
|
case DW_OP_plus:
|
2005-01-27 08:26:49 +01:00
|
|
|
|
case DW_OP_shl:
|
|
|
|
|
case DW_OP_shr:
|
|
|
|
|
case DW_OP_shra:
|
|
|
|
|
case DW_OP_xor:
|
2001-03-28 13:04:51 +02:00
|
|
|
|
case DW_OP_le:
|
|
|
|
|
case DW_OP_ge:
|
|
|
|
|
case DW_OP_eq:
|
|
|
|
|
case DW_OP_lt:
|
|
|
|
|
case DW_OP_gt:
|
|
|
|
|
case DW_OP_ne:
|
|
|
|
|
{
|
|
|
|
|
/* Binary operations. */
|
|
|
|
|
_Unwind_Word first, second;
|
unwind-dw2-fde-glibc.c (base_from_cb_data, [...]): Use gcc_assert and gcc_unreachable as appropriate.
* unwind-dw2-fde-glibc.c (base_from_cb_data,
_Unwind_IteratePhdrCallback): Use gcc_assert and gcc_unreachable as
appropriate.
* unwind-dw2-fde.c (__deregister_frame_info_bases,
base_from_object, fde_split, end_fde_sort): Likewise.
* unwind-dw2.c (_Unwind_GetGR, _Unwind_SetGR, execute_stack_op,
execute_cfa_program, _Unwind_SetSpColumn, uw_update_context_1,
uw_init_context_1): Likewise.
* unwind.inc (_Unwind_RaiseException_Phase2, _Unwind_Resume,
_Unwind_Resume_or_Rethrow): Likewise.
* unwind-pe.h (__gxx_abort): Do not define.
(size_of_encoded_value, base_of_encoded_value,
read_encoded_value_with_base): Use gcc_unreachable.
* unwind.h (_Unwind_GetTextRelBase): Likewise.
From-SVN: r99835
2005-05-17 17:37:47 +02:00
|
|
|
|
gcc_assert (stack_elt >= 2);
|
|
|
|
|
stack_elt -= 2;
|
2009-11-25 11:55:54 +01:00
|
|
|
|
|
2002-06-01 00:15:42 +02:00
|
|
|
|
second = stack[stack_elt];
|
|
|
|
|
first = stack[stack_elt + 1];
|
|
|
|
|
|
|
|
|
|
switch (op)
|
|
|
|
|
{
|
|
|
|
|
case DW_OP_and:
|
|
|
|
|
result = second & first;
|
|
|
|
|
break;
|
|
|
|
|
case DW_OP_div:
|
|
|
|
|
result = (_Unwind_Sword) second / (_Unwind_Sword) first;
|
|
|
|
|
break;
|
|
|
|
|
case DW_OP_minus:
|
|
|
|
|
result = second - first;
|
|
|
|
|
break;
|
|
|
|
|
case DW_OP_mod:
|
dwarf2out.c (mem_loc_descriptor): Use DW_OP_mod for UMOD instead of MOD...
* dwarf2out.c (mem_loc_descriptor): Use DW_OP_mod for UMOD instead
of MOD, handle MOD using DW_OP_{over,over,div,mul,minus}.
(loc_list_from_tree): Don't handle unsigned division. Handle
signed modulo using DW_OP_{over,over,div,mul,minus}.
* unwind-dw2.c (execute_stack_op): Handle DW_OP_mod using unsigned
modulo instead of signed.
* gcc.dg/cleanup-13.c: Expect DW_OP_mod to do unsigned modulo instead
of signed, add a few new tests.
From-SVN: r156063
2010-01-20 09:13:50 +01:00
|
|
|
|
result = second % first;
|
2002-06-01 00:15:42 +02:00
|
|
|
|
break;
|
|
|
|
|
case DW_OP_mul:
|
|
|
|
|
result = second * first;
|
|
|
|
|
break;
|
|
|
|
|
case DW_OP_or:
|
|
|
|
|
result = second | first;
|
|
|
|
|
break;
|
|
|
|
|
case DW_OP_plus:
|
|
|
|
|
result = second + first;
|
|
|
|
|
break;
|
|
|
|
|
case DW_OP_shl:
|
|
|
|
|
result = second << first;
|
|
|
|
|
break;
|
|
|
|
|
case DW_OP_shr:
|
|
|
|
|
result = second >> first;
|
|
|
|
|
break;
|
|
|
|
|
case DW_OP_shra:
|
|
|
|
|
result = (_Unwind_Sword) second >> first;
|
|
|
|
|
break;
|
|
|
|
|
case DW_OP_xor:
|
|
|
|
|
result = second ^ first;
|
|
|
|
|
break;
|
|
|
|
|
case DW_OP_le:
|
2009-10-19 21:54:11 +02:00
|
|
|
|
result = (_Unwind_Sword) second <= (_Unwind_Sword) first;
|
2002-06-01 00:15:42 +02:00
|
|
|
|
break;
|
|
|
|
|
case DW_OP_ge:
|
2009-10-19 21:54:11 +02:00
|
|
|
|
result = (_Unwind_Sword) second >= (_Unwind_Sword) first;
|
2002-06-01 00:15:42 +02:00
|
|
|
|
break;
|
|
|
|
|
case DW_OP_eq:
|
2009-10-19 21:54:11 +02:00
|
|
|
|
result = (_Unwind_Sword) second == (_Unwind_Sword) first;
|
2002-06-01 00:15:42 +02:00
|
|
|
|
break;
|
|
|
|
|
case DW_OP_lt:
|
2009-10-19 21:54:11 +02:00
|
|
|
|
result = (_Unwind_Sword) second < (_Unwind_Sword) first;
|
2002-06-01 00:15:42 +02:00
|
|
|
|
break;
|
|
|
|
|
case DW_OP_gt:
|
2009-10-19 21:54:11 +02:00
|
|
|
|
result = (_Unwind_Sword) second > (_Unwind_Sword) first;
|
2002-06-01 00:15:42 +02:00
|
|
|
|
break;
|
|
|
|
|
case DW_OP_ne:
|
2009-10-19 21:54:11 +02:00
|
|
|
|
result = (_Unwind_Sword) second != (_Unwind_Sword) first;
|
2002-06-01 00:15:42 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
unwind-dw2-fde-glibc.c (base_from_cb_data, [...]): Use gcc_assert and gcc_unreachable as appropriate.
* unwind-dw2-fde-glibc.c (base_from_cb_data,
_Unwind_IteratePhdrCallback): Use gcc_assert and gcc_unreachable as
appropriate.
* unwind-dw2-fde.c (__deregister_frame_info_bases,
base_from_object, fde_split, end_fde_sort): Likewise.
* unwind-dw2.c (_Unwind_GetGR, _Unwind_SetGR, execute_stack_op,
execute_cfa_program, _Unwind_SetSpColumn, uw_update_context_1,
uw_init_context_1): Likewise.
* unwind.inc (_Unwind_RaiseException_Phase2, _Unwind_Resume,
_Unwind_Resume_or_Rethrow): Likewise.
* unwind-pe.h (__gxx_abort): Do not define.
(size_of_encoded_value, base_of_encoded_value,
read_encoded_value_with_base): Use gcc_unreachable.
* unwind.h (_Unwind_GetTextRelBase): Likewise.
From-SVN: r99835
2005-05-17 17:37:47 +02:00
|
|
|
|
gcc_unreachable ();
|
2002-06-01 00:15:42 +02:00
|
|
|
|
}
|
2001-03-28 13:04:51 +02:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DW_OP_skip:
|
|
|
|
|
offset = read_2s (op_ptr);
|
|
|
|
|
op_ptr += 2;
|
|
|
|
|
op_ptr += offset;
|
|
|
|
|
goto no_push;
|
|
|
|
|
|
|
|
|
|
case DW_OP_bra:
|
unwind-dw2-fde-glibc.c (base_from_cb_data, [...]): Use gcc_assert and gcc_unreachable as appropriate.
* unwind-dw2-fde-glibc.c (base_from_cb_data,
_Unwind_IteratePhdrCallback): Use gcc_assert and gcc_unreachable as
appropriate.
* unwind-dw2-fde.c (__deregister_frame_info_bases,
base_from_object, fde_split, end_fde_sort): Likewise.
* unwind-dw2.c (_Unwind_GetGR, _Unwind_SetGR, execute_stack_op,
execute_cfa_program, _Unwind_SetSpColumn, uw_update_context_1,
uw_init_context_1): Likewise.
* unwind.inc (_Unwind_RaiseException_Phase2, _Unwind_Resume,
_Unwind_Resume_or_Rethrow): Likewise.
* unwind-pe.h (__gxx_abort): Do not define.
(size_of_encoded_value, base_of_encoded_value,
read_encoded_value_with_base): Use gcc_unreachable.
* unwind.h (_Unwind_GetTextRelBase): Likewise.
From-SVN: r99835
2005-05-17 17:37:47 +02:00
|
|
|
|
gcc_assert (stack_elt);
|
|
|
|
|
stack_elt -= 1;
|
2009-11-25 11:55:54 +01:00
|
|
|
|
|
2001-03-28 13:04:51 +02:00
|
|
|
|
offset = read_2s (op_ptr);
|
|
|
|
|
op_ptr += 2;
|
|
|
|
|
if (stack[stack_elt] != 0)
|
|
|
|
|
op_ptr += offset;
|
|
|
|
|
goto no_push;
|
|
|
|
|
|
|
|
|
|
case DW_OP_nop:
|
|
|
|
|
goto no_push;
|
|
|
|
|
|
|
|
|
|
default:
|
unwind-dw2-fde-glibc.c (base_from_cb_data, [...]): Use gcc_assert and gcc_unreachable as appropriate.
* unwind-dw2-fde-glibc.c (base_from_cb_data,
_Unwind_IteratePhdrCallback): Use gcc_assert and gcc_unreachable as
appropriate.
* unwind-dw2-fde.c (__deregister_frame_info_bases,
base_from_object, fde_split, end_fde_sort): Likewise.
* unwind-dw2.c (_Unwind_GetGR, _Unwind_SetGR, execute_stack_op,
execute_cfa_program, _Unwind_SetSpColumn, uw_update_context_1,
uw_init_context_1): Likewise.
* unwind.inc (_Unwind_RaiseException_Phase2, _Unwind_Resume,
_Unwind_Resume_or_Rethrow): Likewise.
* unwind-pe.h (__gxx_abort): Do not define.
(size_of_encoded_value, base_of_encoded_value,
read_encoded_value_with_base): Use gcc_unreachable.
* unwind.h (_Unwind_GetTextRelBase): Likewise.
From-SVN: r99835
2005-05-17 17:37:47 +02:00
|
|
|
|
gcc_unreachable ();
|
2001-03-28 13:04:51 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Most things push a result value. */
|
unwind-dw2-fde-glibc.c (base_from_cb_data, [...]): Use gcc_assert and gcc_unreachable as appropriate.
* unwind-dw2-fde-glibc.c (base_from_cb_data,
_Unwind_IteratePhdrCallback): Use gcc_assert and gcc_unreachable as
appropriate.
* unwind-dw2-fde.c (__deregister_frame_info_bases,
base_from_object, fde_split, end_fde_sort): Likewise.
* unwind-dw2.c (_Unwind_GetGR, _Unwind_SetGR, execute_stack_op,
execute_cfa_program, _Unwind_SetSpColumn, uw_update_context_1,
uw_init_context_1): Likewise.
* unwind.inc (_Unwind_RaiseException_Phase2, _Unwind_Resume,
_Unwind_Resume_or_Rethrow): Likewise.
* unwind-pe.h (__gxx_abort): Do not define.
(size_of_encoded_value, base_of_encoded_value,
read_encoded_value_with_base): Use gcc_unreachable.
* unwind.h (_Unwind_GetTextRelBase): Likewise.
From-SVN: r99835
2005-05-17 17:37:47 +02:00
|
|
|
|
gcc_assert ((size_t) stack_elt < sizeof(stack)/sizeof(*stack));
|
2003-05-04 07:22:51 +02:00
|
|
|
|
stack[stack_elt++] = result;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
no_push:;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* We were executing this program to get a value. It should be
|
|
|
|
|
at top of stack. */
|
unwind-dw2-fde-glibc.c (base_from_cb_data, [...]): Use gcc_assert and gcc_unreachable as appropriate.
* unwind-dw2-fde-glibc.c (base_from_cb_data,
_Unwind_IteratePhdrCallback): Use gcc_assert and gcc_unreachable as
appropriate.
* unwind-dw2-fde.c (__deregister_frame_info_bases,
base_from_object, fde_split, end_fde_sort): Likewise.
* unwind-dw2.c (_Unwind_GetGR, _Unwind_SetGR, execute_stack_op,
execute_cfa_program, _Unwind_SetSpColumn, uw_update_context_1,
uw_init_context_1): Likewise.
* unwind.inc (_Unwind_RaiseException_Phase2, _Unwind_Resume,
_Unwind_Resume_or_Rethrow): Likewise.
* unwind-pe.h (__gxx_abort): Do not define.
(size_of_encoded_value, base_of_encoded_value,
read_encoded_value_with_base): Use gcc_unreachable.
* unwind.h (_Unwind_GetTextRelBase): Likewise.
From-SVN: r99835
2005-05-17 17:37:47 +02:00
|
|
|
|
gcc_assert (stack_elt);
|
|
|
|
|
stack_elt -= 1;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
return stack[stack_elt];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Decode DWARF 2 call frame information. Takes pointers the
|
|
|
|
|
instruction sequence to decode, current register information and
|
|
|
|
|
CIE info, and the PC range to evaluate. */
|
|
|
|
|
|
|
|
|
|
static void
|
except.c (eh_data_format_name): Move to ...
* except.c (eh_data_format_name): Move to ...
* dwarf2asm.c: ... here. Use designated initializers if available.
(dw2_asm_output_encoded_addr_rtx): Accept varargs commentary.
* dwarf2asm.h: Update declarations.
* dwarf2out.c (output_cfi) [DW_CFA_set_loc]: If for_eh, mind
ASM_PREFERRED_EH_DATA_FORMAT.
(output_call_frame_info): Likewise. Use 'L' augmentation for
the LSDA encoding.
* unwind-dw2-fde.h (struct fde_vector): New.
(struct old_object): Rename from struct object.
(struct object): New.
(__register_frame_info_bases): Declare.
(__register_frame_info_table_bases): Declare.
(struct dwarf_fde): Remove explicit pc_begin/pc_range members.
* unwind-dw2-fde.c (objects): Remove.
(unseen_objects, seen_objects): New.
(__register_frame_info_bases): New.
(__register_frame_info): Use it.
(__register_frame_info_table_bases): New.
(__register_frame_info_table): Use it.
(__deregister_frame_info): Rewrite for changed object struct.
(base_from_object, get_cie_encoding, get_fde_encoding): New.
(fde_unencoded_compare): Rename from fde_compare; uninline.
(fde_single_encoding_compare, fde_mixed_encoding_compare): New.
(start_fde_sort): Adjust for new definition of fde_vector.
(fde_insert): Likewise.
(end_fde_sort): Likewise. Select comparison function based
on properties of the object.
(fde_split): Take object and fde_compare_t arguments.
(frame_heapsort, fde_merge): Likewise.
(classify_object_over_fdes): Rename from count_fdes. Handle
encoded pointers. Collect encoding, mixed_encoding, and pc_begin
for the object.
(add_fdes): Handle encoded pointers.
(init_object): Rename from frame_init. Update for new struct object.
(linear_search_fdes): Rename from search_fdes. Handle encoded
pointers.
(binary_search_unencoded_fdes): Broken out from _Unwind_Find_FDE.
(binary_search_single_encoding_fdes): New.
(binary_search_mixed_encoding_fdes): New.
(search_object): New.
(_Unwind_Find_FDE): Update for new struct object. Fill in
the dwarf_eh_bases.
* unwind-dw2.c: Include unwind-pe.h. Constify all pointers
iterating over EH data.
(_Unwind_FrameState): Remove saw_lsda, addr_encoding. Add
fde_encoding, lsda_encoding.
(read_uleb128, read_sleb128): Remove.
(read_encoded_pointer): Remove. All callers use read_encoded_value.
(extract_cie_info): Set lsda_encoding from 'L' augmentation.
(uw_frame_state_for): Don't set bases.func. Handle encoded fde
pointers.
* unwind-pe.h: Add "struct" to _Unwind_Context references.
From-SVN: r42176
2001-05-17 00:42:36 +02:00
|
|
|
|
execute_cfa_program (const unsigned char *insn_ptr,
|
|
|
|
|
const unsigned char *insn_end,
|
|
|
|
|
struct _Unwind_Context *context,
|
|
|
|
|
_Unwind_FrameState *fs)
|
2001-03-28 13:04:51 +02:00
|
|
|
|
{
|
|
|
|
|
struct frame_state_reg_info *unused_rs = NULL;
|
|
|
|
|
|
|
|
|
|
/* Don't allow remember/restore between CIE and FDE programs. */
|
|
|
|
|
fs->regs.prev = NULL;
|
|
|
|
|
|
2002-01-07 23:41:42 +01:00
|
|
|
|
/* The comparison with the return address uses < rather than <= because
|
|
|
|
|
we are only interested in the effects of code before the call; for a
|
|
|
|
|
noreturn function, the return address may point to unrelated code with
|
|
|
|
|
a different stack configuration that we are not interested in. We
|
|
|
|
|
assume that the call itself is unwind info-neutral; if not, or if
|
|
|
|
|
there are delay instructions that adjust the stack, these must be
|
2006-02-27 18:26:26 +01:00
|
|
|
|
reflected at the point immediately before the call insn.
|
|
|
|
|
In signal frames, return address is after last completed instruction,
|
|
|
|
|
so we add 1 to return address to make the comparison <=. */
|
unwind-dw2.c (SIGNAL_FRAME_BIT, [...]): Define.
* unwind-dw2.c (SIGNAL_FRAME_BIT, EXTENDED_CONTEXT_BIT): Define.
(struct _Unwind_Context): Rename args_size to flags, remove
signal_frame field, add a new args_size field and version field.
(_Unwind_IsSignalFrame, _Unwind_SetSignalFrame,
_Unwind_IsExtendedContext): New inline functions.
(_Unwind_GetGR, _Unwind_SetGR, _Unwind_GetGRPtr, _Unwind_SetGRPtr):
Assume by_value array is only present if _Unwind_IsExtendedContext.
(_Unwind_GetIPInfo, execute_cfa_program, uw_frame_state_for): Use
_Unwind_IsSignalFrame.
(__frame_state_for): Initialize context.flags to EXTENDED_CONTEXT_BIT.
(uw_update_context_1): Use _Unwind_SetSignalFrame.
(uw_init_context_1): Initialize context->flags to
EXTENDED_CONTEXT_BIT.
* config/rs6000/linux-unwind.h (frob_update_context): Use
_Unwind_SetSignalFrame.
From-SVN: r120406
2007-01-04 00:45:47 +01:00
|
|
|
|
while (insn_ptr < insn_end
|
|
|
|
|
&& fs->pc < context->ra + _Unwind_IsSignalFrame (context))
|
2001-03-28 13:04:51 +02:00
|
|
|
|
{
|
|
|
|
|
unsigned char insn = *insn_ptr++;
|
unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with
_uleb128_t and _Unwind_SWord with _sleb128_t.
* unwind-dw2.c (extract_cie_info, execute_stack_op, execute_cfa_program,
uw_frame_state_for, uw_update_context_1): Likewise.
* unwind-c.c (parse_lsda_header, PERSONALITY_FUNCTION): Likewise.
* unwind-pe.h (read_uleb128, read_sleb128,
read_encoded_value_with_base): Likewise.
* unwind-generic.h: Define _sleb128_t and _uleb128_t types.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* libsupc++/eh_personality.cc (parse_lsda_header, check_exception_spec,
get_ttype_entry, empty_exception_spec, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* exception.cc (parse_lsda_header, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
From-SVN: r121116
2007-01-24 15:46:47 +01:00
|
|
|
|
_uleb128_t reg, utmp;
|
|
|
|
|
_sleb128_t offset, stmp;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
2001-12-11 18:27:14 +01:00
|
|
|
|
if ((insn & 0xc0) == DW_CFA_advance_loc)
|
2001-03-28 13:04:51 +02:00
|
|
|
|
fs->pc += (insn & 0x3f) * fs->code_align;
|
2001-12-11 18:27:14 +01:00
|
|
|
|
else if ((insn & 0xc0) == DW_CFA_offset)
|
2001-03-28 13:04:51 +02:00
|
|
|
|
{
|
|
|
|
|
reg = insn & 0x3f;
|
2001-08-31 11:49:13 +02:00
|
|
|
|
insn_ptr = read_uleb128 (insn_ptr, &utmp);
|
2002-01-21 14:08:33 +01:00
|
|
|
|
offset = (_Unwind_Sword) utmp * fs->data_align;
|
2003-03-11 21:40:54 +01:00
|
|
|
|
fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].how
|
|
|
|
|
= REG_SAVED_OFFSET;
|
|
|
|
|
fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].loc.offset = offset;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
}
|
2001-12-11 18:27:14 +01:00
|
|
|
|
else if ((insn & 0xc0) == DW_CFA_restore)
|
2001-03-28 13:04:51 +02:00
|
|
|
|
{
|
|
|
|
|
reg = insn & 0x3f;
|
2003-03-11 21:40:54 +01:00
|
|
|
|
fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].how = REG_UNSAVED;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
}
|
|
|
|
|
else switch (insn)
|
|
|
|
|
{
|
|
|
|
|
case DW_CFA_set_loc:
|
2005-06-14 10:25:18 +02:00
|
|
|
|
{
|
|
|
|
|
_Unwind_Ptr pc;
|
2009-11-25 11:55:54 +01:00
|
|
|
|
|
2005-06-14 10:25:18 +02:00
|
|
|
|
insn_ptr = read_encoded_value (context, fs->fde_encoding,
|
|
|
|
|
insn_ptr, &pc);
|
|
|
|
|
fs->pc = (void *) pc;
|
|
|
|
|
}
|
2001-03-28 13:04:51 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DW_CFA_advance_loc1:
|
2001-05-20 02:35:24 +02:00
|
|
|
|
fs->pc += read_1u (insn_ptr) * fs->code_align;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
insn_ptr += 1;
|
|
|
|
|
break;
|
|
|
|
|
case DW_CFA_advance_loc2:
|
2001-05-20 02:35:24 +02:00
|
|
|
|
fs->pc += read_2u (insn_ptr) * fs->code_align;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
insn_ptr += 2;
|
|
|
|
|
break;
|
|
|
|
|
case DW_CFA_advance_loc4:
|
2001-05-20 02:35:24 +02:00
|
|
|
|
fs->pc += read_4u (insn_ptr) * fs->code_align;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
insn_ptr += 4;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DW_CFA_offset_extended:
|
2001-08-31 11:49:13 +02:00
|
|
|
|
insn_ptr = read_uleb128 (insn_ptr, ®);
|
|
|
|
|
insn_ptr = read_uleb128 (insn_ptr, &utmp);
|
2002-01-21 14:08:33 +01:00
|
|
|
|
offset = (_Unwind_Sword) utmp * fs->data_align;
|
2003-03-11 21:40:54 +01:00
|
|
|
|
fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].how
|
|
|
|
|
= REG_SAVED_OFFSET;
|
|
|
|
|
fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].loc.offset = offset;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DW_CFA_restore_extended:
|
2001-08-31 11:49:13 +02:00
|
|
|
|
insn_ptr = read_uleb128 (insn_ptr, ®);
|
2004-07-01 06:09:07 +02:00
|
|
|
|
/* FIXME, this is wrong; the CIE might have said that the
|
|
|
|
|
register was saved somewhere. */
|
2003-03-11 21:40:54 +01:00
|
|
|
|
fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN(reg)].how = REG_UNSAVED;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DW_CFA_same_value:
|
2003-01-07 21:20:53 +01:00
|
|
|
|
insn_ptr = read_uleb128 (insn_ptr, ®);
|
2004-07-01 06:09:07 +02:00
|
|
|
|
fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN(reg)].how = REG_UNSAVED;
|
2003-01-07 21:20:53 +01:00
|
|
|
|
break;
|
|
|
|
|
|
2009-04-04 13:41:16 +02:00
|
|
|
|
case DW_CFA_undefined:
|
|
|
|
|
insn_ptr = read_uleb128 (insn_ptr, ®);
|
|
|
|
|
fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN(reg)].how = REG_UNDEFINED;
|
|
|
|
|
break;
|
|
|
|
|
|
2001-03-28 13:04:51 +02:00
|
|
|
|
case DW_CFA_nop:
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DW_CFA_register:
|
|
|
|
|
{
|
unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with
_uleb128_t and _Unwind_SWord with _sleb128_t.
* unwind-dw2.c (extract_cie_info, execute_stack_op, execute_cfa_program,
uw_frame_state_for, uw_update_context_1): Likewise.
* unwind-c.c (parse_lsda_header, PERSONALITY_FUNCTION): Likewise.
* unwind-pe.h (read_uleb128, read_sleb128,
read_encoded_value_with_base): Likewise.
* unwind-generic.h: Define _sleb128_t and _uleb128_t types.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* libsupc++/eh_personality.cc (parse_lsda_header, check_exception_spec,
get_ttype_entry, empty_exception_spec, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* exception.cc (parse_lsda_header, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
From-SVN: r121116
2007-01-24 15:46:47 +01:00
|
|
|
|
_uleb128_t reg2;
|
2001-08-31 11:49:13 +02:00
|
|
|
|
insn_ptr = read_uleb128 (insn_ptr, ®);
|
|
|
|
|
insn_ptr = read_uleb128 (insn_ptr, ®2);
|
2003-03-11 21:40:54 +01:00
|
|
|
|
fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].how = REG_SAVED_REG;
|
unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with
_uleb128_t and _Unwind_SWord with _sleb128_t.
* unwind-dw2.c (extract_cie_info, execute_stack_op, execute_cfa_program,
uw_frame_state_for, uw_update_context_1): Likewise.
* unwind-c.c (parse_lsda_header, PERSONALITY_FUNCTION): Likewise.
* unwind-pe.h (read_uleb128, read_sleb128,
read_encoded_value_with_base): Likewise.
* unwind-generic.h: Define _sleb128_t and _uleb128_t types.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* libsupc++/eh_personality.cc (parse_lsda_header, check_exception_spec,
get_ttype_entry, empty_exception_spec, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* exception.cc (parse_lsda_header, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
From-SVN: r121116
2007-01-24 15:46:47 +01:00
|
|
|
|
fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].loc.reg =
|
|
|
|
|
(_Unwind_Word)reg2;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
}
|
|
|
|
|
break;
|
2002-06-01 00:15:42 +02:00
|
|
|
|
|
2001-03-28 13:04:51 +02:00
|
|
|
|
case DW_CFA_remember_state:
|
|
|
|
|
{
|
|
|
|
|
struct frame_state_reg_info *new_rs;
|
|
|
|
|
if (unused_rs)
|
|
|
|
|
{
|
|
|
|
|
new_rs = unused_rs;
|
|
|
|
|
unused_rs = unused_rs->prev;
|
|
|
|
|
}
|
|
|
|
|
else
|
2004-09-21 00:23:12 +02:00
|
|
|
|
new_rs = alloca (sizeof (struct frame_state_reg_info));
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
|
|
|
|
*new_rs = fs->regs;
|
|
|
|
|
fs->regs.prev = new_rs;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DW_CFA_restore_state:
|
|
|
|
|
{
|
|
|
|
|
struct frame_state_reg_info *old_rs = fs->regs.prev;
|
|
|
|
|
fs->regs = *old_rs;
|
|
|
|
|
old_rs->prev = unused_rs;
|
|
|
|
|
unused_rs = old_rs;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DW_CFA_def_cfa:
|
2001-08-31 11:49:13 +02:00
|
|
|
|
insn_ptr = read_uleb128 (insn_ptr, &utmp);
|
unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with
_uleb128_t and _Unwind_SWord with _sleb128_t.
* unwind-dw2.c (extract_cie_info, execute_stack_op, execute_cfa_program,
uw_frame_state_for, uw_update_context_1): Likewise.
* unwind-c.c (parse_lsda_header, PERSONALITY_FUNCTION): Likewise.
* unwind-pe.h (read_uleb128, read_sleb128,
read_encoded_value_with_base): Likewise.
* unwind-generic.h: Define _sleb128_t and _uleb128_t types.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* libsupc++/eh_personality.cc (parse_lsda_header, check_exception_spec,
get_ttype_entry, empty_exception_spec, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* exception.cc (parse_lsda_header, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
From-SVN: r121116
2007-01-24 15:46:47 +01:00
|
|
|
|
fs->regs.cfa_reg = (_Unwind_Word)utmp;
|
|
|
|
|
insn_ptr = read_uleb128 (insn_ptr, &utmp);
|
|
|
|
|
fs->regs.cfa_offset = (_Unwind_Word)utmp;
|
unwind-dw2.h: Move cfa-related variables into struct frame_state_reg_info to ensure that the...
* gcc/unwind-dw2.h: Move cfa-related variables into
struct frame_state_reg_info to ensure that the CFA is properly
handled when executing DW_CFA_{remember,restore}_state.
* gcc/unwind-dw2.c, gcc/config/alpha/linux-unwind.h,
gcc/config/alpha/vms-unwind.h, gcc/config/s390/tpf-unwind.h
gcc/config/s390/linux-unwind.h, gcc/config/sparc/linux-unwind.h
gcc/config/i386/linux-unwind.h, gcc/config/sh/linux-unwind.h
gcc/config/rs6000/linux-unwind.h,
gcc/config/rs6000/darwin-fallback.c, gcc/config/pa/linux-unwind.h,
gcc/config/pa/hpux-unwind.h, gcc/config/mips/linux-unwind.h:
Modify to use new cfa_* fields.
From-SVN: r118068
2006-10-26 21:31:09 +02:00
|
|
|
|
fs->regs.cfa_how = CFA_REG_OFFSET;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DW_CFA_def_cfa_register:
|
unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with
_uleb128_t and _Unwind_SWord with _sleb128_t.
* unwind-dw2.c (extract_cie_info, execute_stack_op, execute_cfa_program,
uw_frame_state_for, uw_update_context_1): Likewise.
* unwind-c.c (parse_lsda_header, PERSONALITY_FUNCTION): Likewise.
* unwind-pe.h (read_uleb128, read_sleb128,
read_encoded_value_with_base): Likewise.
* unwind-generic.h: Define _sleb128_t and _uleb128_t types.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* libsupc++/eh_personality.cc (parse_lsda_header, check_exception_spec,
get_ttype_entry, empty_exception_spec, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* exception.cc (parse_lsda_header, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
From-SVN: r121116
2007-01-24 15:46:47 +01:00
|
|
|
|
insn_ptr = read_uleb128 (insn_ptr, &utmp);
|
|
|
|
|
fs->regs.cfa_reg = (_Unwind_Word)utmp;
|
unwind-dw2.h: Move cfa-related variables into struct frame_state_reg_info to ensure that the...
* gcc/unwind-dw2.h: Move cfa-related variables into
struct frame_state_reg_info to ensure that the CFA is properly
handled when executing DW_CFA_{remember,restore}_state.
* gcc/unwind-dw2.c, gcc/config/alpha/linux-unwind.h,
gcc/config/alpha/vms-unwind.h, gcc/config/s390/tpf-unwind.h
gcc/config/s390/linux-unwind.h, gcc/config/sparc/linux-unwind.h
gcc/config/i386/linux-unwind.h, gcc/config/sh/linux-unwind.h
gcc/config/rs6000/linux-unwind.h,
gcc/config/rs6000/darwin-fallback.c, gcc/config/pa/linux-unwind.h,
gcc/config/pa/hpux-unwind.h, gcc/config/mips/linux-unwind.h:
Modify to use new cfa_* fields.
From-SVN: r118068
2006-10-26 21:31:09 +02:00
|
|
|
|
fs->regs.cfa_how = CFA_REG_OFFSET;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DW_CFA_def_cfa_offset:
|
2001-08-31 11:49:13 +02:00
|
|
|
|
insn_ptr = read_uleb128 (insn_ptr, &utmp);
|
unwind-dw2.h: Move cfa-related variables into struct frame_state_reg_info to ensure that the...
* gcc/unwind-dw2.h: Move cfa-related variables into
struct frame_state_reg_info to ensure that the CFA is properly
handled when executing DW_CFA_{remember,restore}_state.
* gcc/unwind-dw2.c, gcc/config/alpha/linux-unwind.h,
gcc/config/alpha/vms-unwind.h, gcc/config/s390/tpf-unwind.h
gcc/config/s390/linux-unwind.h, gcc/config/sparc/linux-unwind.h
gcc/config/i386/linux-unwind.h, gcc/config/sh/linux-unwind.h
gcc/config/rs6000/linux-unwind.h,
gcc/config/rs6000/darwin-fallback.c, gcc/config/pa/linux-unwind.h,
gcc/config/pa/hpux-unwind.h, gcc/config/mips/linux-unwind.h:
Modify to use new cfa_* fields.
From-SVN: r118068
2006-10-26 21:31:09 +02:00
|
|
|
|
fs->regs.cfa_offset = utmp;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
/* cfa_how deliberately not set. */
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DW_CFA_def_cfa_expression:
|
unwind-dw2.h: Move cfa-related variables into struct frame_state_reg_info to ensure that the...
* gcc/unwind-dw2.h: Move cfa-related variables into
struct frame_state_reg_info to ensure that the CFA is properly
handled when executing DW_CFA_{remember,restore}_state.
* gcc/unwind-dw2.c, gcc/config/alpha/linux-unwind.h,
gcc/config/alpha/vms-unwind.h, gcc/config/s390/tpf-unwind.h
gcc/config/s390/linux-unwind.h, gcc/config/sparc/linux-unwind.h
gcc/config/i386/linux-unwind.h, gcc/config/sh/linux-unwind.h
gcc/config/rs6000/linux-unwind.h,
gcc/config/rs6000/darwin-fallback.c, gcc/config/pa/linux-unwind.h,
gcc/config/pa/hpux-unwind.h, gcc/config/mips/linux-unwind.h:
Modify to use new cfa_* fields.
From-SVN: r118068
2006-10-26 21:31:09 +02:00
|
|
|
|
fs->regs.cfa_exp = insn_ptr;
|
|
|
|
|
fs->regs.cfa_how = CFA_EXP;
|
2003-05-04 07:22:51 +02:00
|
|
|
|
insn_ptr = read_uleb128 (insn_ptr, &utmp);
|
2001-08-31 11:49:13 +02:00
|
|
|
|
insn_ptr += utmp;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DW_CFA_expression:
|
2001-08-31 11:49:13 +02:00
|
|
|
|
insn_ptr = read_uleb128 (insn_ptr, ®);
|
2003-03-11 21:40:54 +01:00
|
|
|
|
fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].how = REG_SAVED_EXP;
|
|
|
|
|
fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].loc.exp = insn_ptr;
|
2003-05-04 07:22:51 +02:00
|
|
|
|
insn_ptr = read_uleb128 (insn_ptr, &utmp);
|
2001-08-31 11:49:13 +02:00
|
|
|
|
insn_ptr += utmp;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
break;
|
|
|
|
|
|
2006-03-04 08:07:12 +01:00
|
|
|
|
/* Dwarf3. */
|
2001-03-28 13:04:51 +02:00
|
|
|
|
case DW_CFA_offset_extended_sf:
|
2001-08-31 11:49:13 +02:00
|
|
|
|
insn_ptr = read_uleb128 (insn_ptr, ®);
|
|
|
|
|
insn_ptr = read_sleb128 (insn_ptr, &stmp);
|
|
|
|
|
offset = stmp * fs->data_align;
|
2003-03-11 21:40:54 +01:00
|
|
|
|
fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].how
|
|
|
|
|
= REG_SAVED_OFFSET;
|
|
|
|
|
fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].loc.offset = offset;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
break;
|
2002-06-01 00:15:42 +02:00
|
|
|
|
|
2001-03-28 13:04:51 +02:00
|
|
|
|
case DW_CFA_def_cfa_sf:
|
unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with
_uleb128_t and _Unwind_SWord with _sleb128_t.
* unwind-dw2.c (extract_cie_info, execute_stack_op, execute_cfa_program,
uw_frame_state_for, uw_update_context_1): Likewise.
* unwind-c.c (parse_lsda_header, PERSONALITY_FUNCTION): Likewise.
* unwind-pe.h (read_uleb128, read_sleb128,
read_encoded_value_with_base): Likewise.
* unwind-generic.h: Define _sleb128_t and _uleb128_t types.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* libsupc++/eh_personality.cc (parse_lsda_header, check_exception_spec,
get_ttype_entry, empty_exception_spec, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* exception.cc (parse_lsda_header, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
From-SVN: r121116
2007-01-24 15:46:47 +01:00
|
|
|
|
insn_ptr = read_uleb128 (insn_ptr, &utmp);
|
|
|
|
|
fs->regs.cfa_reg = (_Unwind_Word)utmp;
|
|
|
|
|
insn_ptr = read_sleb128 (insn_ptr, &stmp);
|
|
|
|
|
fs->regs.cfa_offset = (_Unwind_Sword)stmp;
|
unwind-dw2.h: Move cfa-related variables into struct frame_state_reg_info to ensure that the...
* gcc/unwind-dw2.h: Move cfa-related variables into
struct frame_state_reg_info to ensure that the CFA is properly
handled when executing DW_CFA_{remember,restore}_state.
* gcc/unwind-dw2.c, gcc/config/alpha/linux-unwind.h,
gcc/config/alpha/vms-unwind.h, gcc/config/s390/tpf-unwind.h
gcc/config/s390/linux-unwind.h, gcc/config/sparc/linux-unwind.h
gcc/config/i386/linux-unwind.h, gcc/config/sh/linux-unwind.h
gcc/config/rs6000/linux-unwind.h,
gcc/config/rs6000/darwin-fallback.c, gcc/config/pa/linux-unwind.h,
gcc/config/pa/hpux-unwind.h, gcc/config/mips/linux-unwind.h:
Modify to use new cfa_* fields.
From-SVN: r118068
2006-10-26 21:31:09 +02:00
|
|
|
|
fs->regs.cfa_how = CFA_REG_OFFSET;
|
|
|
|
|
fs->regs.cfa_offset *= fs->data_align;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DW_CFA_def_cfa_offset_sf:
|
unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with
_uleb128_t and _Unwind_SWord with _sleb128_t.
* unwind-dw2.c (extract_cie_info, execute_stack_op, execute_cfa_program,
uw_frame_state_for, uw_update_context_1): Likewise.
* unwind-c.c (parse_lsda_header, PERSONALITY_FUNCTION): Likewise.
* unwind-pe.h (read_uleb128, read_sleb128,
read_encoded_value_with_base): Likewise.
* unwind-generic.h: Define _sleb128_t and _uleb128_t types.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* libsupc++/eh_personality.cc (parse_lsda_header, check_exception_spec,
get_ttype_entry, empty_exception_spec, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* exception.cc (parse_lsda_header, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
From-SVN: r121116
2007-01-24 15:46:47 +01:00
|
|
|
|
insn_ptr = read_sleb128 (insn_ptr, &stmp);
|
|
|
|
|
fs->regs.cfa_offset = (_Unwind_Sword)stmp;
|
unwind-dw2.h: Move cfa-related variables into struct frame_state_reg_info to ensure that the...
* gcc/unwind-dw2.h: Move cfa-related variables into
struct frame_state_reg_info to ensure that the CFA is properly
handled when executing DW_CFA_{remember,restore}_state.
* gcc/unwind-dw2.c, gcc/config/alpha/linux-unwind.h,
gcc/config/alpha/vms-unwind.h, gcc/config/s390/tpf-unwind.h
gcc/config/s390/linux-unwind.h, gcc/config/sparc/linux-unwind.h
gcc/config/i386/linux-unwind.h, gcc/config/sh/linux-unwind.h
gcc/config/rs6000/linux-unwind.h,
gcc/config/rs6000/darwin-fallback.c, gcc/config/pa/linux-unwind.h,
gcc/config/pa/hpux-unwind.h, gcc/config/mips/linux-unwind.h:
Modify to use new cfa_* fields.
From-SVN: r118068
2006-10-26 21:31:09 +02:00
|
|
|
|
fs->regs.cfa_offset *= fs->data_align;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
/* cfa_how deliberately not set. */
|
|
|
|
|
break;
|
|
|
|
|
|
2006-03-04 08:07:12 +01:00
|
|
|
|
case DW_CFA_val_offset:
|
|
|
|
|
insn_ptr = read_uleb128 (insn_ptr, ®);
|
|
|
|
|
insn_ptr = read_uleb128 (insn_ptr, &utmp);
|
|
|
|
|
offset = (_Unwind_Sword) utmp * fs->data_align;
|
|
|
|
|
fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].how
|
|
|
|
|
= REG_SAVED_VAL_OFFSET;
|
|
|
|
|
fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].loc.offset = offset;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DW_CFA_val_offset_sf:
|
|
|
|
|
insn_ptr = read_uleb128 (insn_ptr, ®);
|
|
|
|
|
insn_ptr = read_sleb128 (insn_ptr, &stmp);
|
|
|
|
|
offset = stmp * fs->data_align;
|
|
|
|
|
fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].how
|
|
|
|
|
= REG_SAVED_VAL_OFFSET;
|
|
|
|
|
fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].loc.offset = offset;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DW_CFA_val_expression:
|
|
|
|
|
insn_ptr = read_uleb128 (insn_ptr, ®);
|
|
|
|
|
fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].how
|
|
|
|
|
= REG_SAVED_VAL_EXP;
|
|
|
|
|
fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].loc.exp = insn_ptr;
|
|
|
|
|
insn_ptr = read_uleb128 (insn_ptr, &utmp);
|
|
|
|
|
insn_ptr += utmp;
|
|
|
|
|
break;
|
|
|
|
|
|
2001-03-28 13:04:51 +02:00
|
|
|
|
case DW_CFA_GNU_window_save:
|
|
|
|
|
/* ??? Hardcoded for SPARC register window configuration. */
|
|
|
|
|
for (reg = 16; reg < 32; ++reg)
|
|
|
|
|
{
|
|
|
|
|
fs->regs.reg[reg].how = REG_SAVED_OFFSET;
|
|
|
|
|
fs->regs.reg[reg].loc.offset = (reg - 16) * sizeof (void *);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DW_CFA_GNU_args_size:
|
unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with
_uleb128_t and _Unwind_SWord with _sleb128_t.
* unwind-dw2.c (extract_cie_info, execute_stack_op, execute_cfa_program,
uw_frame_state_for, uw_update_context_1): Likewise.
* unwind-c.c (parse_lsda_header, PERSONALITY_FUNCTION): Likewise.
* unwind-pe.h (read_uleb128, read_sleb128,
read_encoded_value_with_base): Likewise.
* unwind-generic.h: Define _sleb128_t and _uleb128_t types.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* libsupc++/eh_personality.cc (parse_lsda_header, check_exception_spec,
get_ttype_entry, empty_exception_spec, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* exception.cc (parse_lsda_header, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
From-SVN: r121116
2007-01-24 15:46:47 +01:00
|
|
|
|
insn_ptr = read_uleb128 (insn_ptr, &utmp);
|
|
|
|
|
context->args_size = (_Unwind_Word)utmp;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DW_CFA_GNU_negative_offset_extended:
|
|
|
|
|
/* Obsoleted by DW_CFA_offset_extended_sf, but used by
|
|
|
|
|
older PowerPC code. */
|
2001-08-31 11:49:13 +02:00
|
|
|
|
insn_ptr = read_uleb128 (insn_ptr, ®);
|
|
|
|
|
insn_ptr = read_uleb128 (insn_ptr, &utmp);
|
2002-01-21 14:08:33 +01:00
|
|
|
|
offset = (_Unwind_Word) utmp * fs->data_align;
|
2003-03-11 21:40:54 +01:00
|
|
|
|
fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].how
|
|
|
|
|
= REG_SAVED_OFFSET;
|
|
|
|
|
fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].loc.offset = -offset;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
unwind-dw2-fde-glibc.c (base_from_cb_data, [...]): Use gcc_assert and gcc_unreachable as appropriate.
* unwind-dw2-fde-glibc.c (base_from_cb_data,
_Unwind_IteratePhdrCallback): Use gcc_assert and gcc_unreachable as
appropriate.
* unwind-dw2-fde.c (__deregister_frame_info_bases,
base_from_object, fde_split, end_fde_sort): Likewise.
* unwind-dw2.c (_Unwind_GetGR, _Unwind_SetGR, execute_stack_op,
execute_cfa_program, _Unwind_SetSpColumn, uw_update_context_1,
uw_init_context_1): Likewise.
* unwind.inc (_Unwind_RaiseException_Phase2, _Unwind_Resume,
_Unwind_Resume_or_Rethrow): Likewise.
* unwind-pe.h (__gxx_abort): Do not define.
(size_of_encoded_value, base_of_encoded_value,
read_encoded_value_with_base): Use gcc_unreachable.
* unwind.h (_Unwind_GetTextRelBase): Likewise.
From-SVN: r99835
2005-05-17 17:37:47 +02:00
|
|
|
|
gcc_unreachable ();
|
2001-03-28 13:04:51 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-15 11:18:21 +01:00
|
|
|
|
/* Given the _Unwind_Context CONTEXT for a stack frame, look up the FDE for
|
|
|
|
|
its caller and decode it into FS. This function also sets the
|
|
|
|
|
args_size and lsda members of CONTEXT, as they are really information
|
|
|
|
|
about the caller's frame. */
|
|
|
|
|
|
2001-03-28 13:04:51 +02:00
|
|
|
|
static _Unwind_Reason_Code
|
|
|
|
|
uw_frame_state_for (struct _Unwind_Context *context, _Unwind_FrameState *fs)
|
|
|
|
|
{
|
2003-11-01 10:59:50 +01:00
|
|
|
|
const struct dwarf_fde *fde;
|
|
|
|
|
const struct dwarf_cie *cie;
|
except.c (eh_data_format_name): Move to ...
* except.c (eh_data_format_name): Move to ...
* dwarf2asm.c: ... here. Use designated initializers if available.
(dw2_asm_output_encoded_addr_rtx): Accept varargs commentary.
* dwarf2asm.h: Update declarations.
* dwarf2out.c (output_cfi) [DW_CFA_set_loc]: If for_eh, mind
ASM_PREFERRED_EH_DATA_FORMAT.
(output_call_frame_info): Likewise. Use 'L' augmentation for
the LSDA encoding.
* unwind-dw2-fde.h (struct fde_vector): New.
(struct old_object): Rename from struct object.
(struct object): New.
(__register_frame_info_bases): Declare.
(__register_frame_info_table_bases): Declare.
(struct dwarf_fde): Remove explicit pc_begin/pc_range members.
* unwind-dw2-fde.c (objects): Remove.
(unseen_objects, seen_objects): New.
(__register_frame_info_bases): New.
(__register_frame_info): Use it.
(__register_frame_info_table_bases): New.
(__register_frame_info_table): Use it.
(__deregister_frame_info): Rewrite for changed object struct.
(base_from_object, get_cie_encoding, get_fde_encoding): New.
(fde_unencoded_compare): Rename from fde_compare; uninline.
(fde_single_encoding_compare, fde_mixed_encoding_compare): New.
(start_fde_sort): Adjust for new definition of fde_vector.
(fde_insert): Likewise.
(end_fde_sort): Likewise. Select comparison function based
on properties of the object.
(fde_split): Take object and fde_compare_t arguments.
(frame_heapsort, fde_merge): Likewise.
(classify_object_over_fdes): Rename from count_fdes. Handle
encoded pointers. Collect encoding, mixed_encoding, and pc_begin
for the object.
(add_fdes): Handle encoded pointers.
(init_object): Rename from frame_init. Update for new struct object.
(linear_search_fdes): Rename from search_fdes. Handle encoded
pointers.
(binary_search_unencoded_fdes): Broken out from _Unwind_Find_FDE.
(binary_search_single_encoding_fdes): New.
(binary_search_mixed_encoding_fdes): New.
(search_object): New.
(_Unwind_Find_FDE): Update for new struct object. Fill in
the dwarf_eh_bases.
* unwind-dw2.c: Include unwind-pe.h. Constify all pointers
iterating over EH data.
(_Unwind_FrameState): Remove saw_lsda, addr_encoding. Add
fde_encoding, lsda_encoding.
(read_uleb128, read_sleb128): Remove.
(read_encoded_pointer): Remove. All callers use read_encoded_value.
(extract_cie_info): Set lsda_encoding from 'L' augmentation.
(uw_frame_state_for): Don't set bases.func. Handle encoded fde
pointers.
* unwind-pe.h: Add "struct" to _Unwind_Context references.
From-SVN: r42176
2001-05-17 00:42:36 +02:00
|
|
|
|
const unsigned char *aug, *insn, *end;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
|
|
|
|
memset (fs, 0, sizeof (*fs));
|
|
|
|
|
context->args_size = 0;
|
|
|
|
|
context->lsda = 0;
|
|
|
|
|
|
2003-10-01 08:01:47 +02:00
|
|
|
|
if (context->ra == 0)
|
|
|
|
|
return _URC_END_OF_STACK;
|
|
|
|
|
|
unwind-dw2.c (SIGNAL_FRAME_BIT, [...]): Define.
* unwind-dw2.c (SIGNAL_FRAME_BIT, EXTENDED_CONTEXT_BIT): Define.
(struct _Unwind_Context): Rename args_size to flags, remove
signal_frame field, add a new args_size field and version field.
(_Unwind_IsSignalFrame, _Unwind_SetSignalFrame,
_Unwind_IsExtendedContext): New inline functions.
(_Unwind_GetGR, _Unwind_SetGR, _Unwind_GetGRPtr, _Unwind_SetGRPtr):
Assume by_value array is only present if _Unwind_IsExtendedContext.
(_Unwind_GetIPInfo, execute_cfa_program, uw_frame_state_for): Use
_Unwind_IsSignalFrame.
(__frame_state_for): Initialize context.flags to EXTENDED_CONTEXT_BIT.
(uw_update_context_1): Use _Unwind_SetSignalFrame.
(uw_init_context_1): Initialize context->flags to
EXTENDED_CONTEXT_BIT.
* config/rs6000/linux-unwind.h (frob_update_context): Use
_Unwind_SetSignalFrame.
From-SVN: r120406
2007-01-04 00:45:47 +01:00
|
|
|
|
fde = _Unwind_Find_FDE (context->ra + _Unwind_IsSignalFrame (context) - 1,
|
2006-02-27 18:26:26 +01:00
|
|
|
|
&context->bases);
|
2001-03-28 13:04:51 +02:00
|
|
|
|
if (fde == NULL)
|
|
|
|
|
{
|
tm.texi (MD_UNWIND_SUPPORT): Document.
* doc/tm.texi (MD_UNWIND_SUPPORT): Document.
(MD_FALLBACK_FRAME_STATE_FOR): Update.
* unwind-dw2.c (MD_UNWIND_SUPPORT): #include if defined.
(uw_frame_state_for): Adjust MD_FALLBACK_FRAME_STATE_FOR invocation.
(MD_FROB_UPDATE_CONTEXT): Remove default.
(uw_update_context_1): Instead #ifdef invocation.
* config/ia64/unwind-ia64.c (MD_UNWIND_SUPPORT): #include if defined.
(uw_frame_state_for): Adjust MD_FALLBACK_FRAME_STATE_FOR invocation.
* config/alpha/gnu.h (MD_FALLBACK_FRAME_STATE_FOR): Don't undef.
(MD_UNWIND_SUPPORT): Undefine this instead.
* config/i386/gnu.h: Likewise.
* config/alpha/linux-unwind.h: New file, macro converted to
function, extracted from..
* config/alpha/linux.h (MD_FALLBACK_FRAME_STATE_FOR): ..this.
(MD_UNWIND_SUPPORT): Define.
* config/alpha/vms-unwind.h, config/alpha/vms.h: Likewise.
* config/i386/linux-unwind.h, config/i386/linux.h,
config/i386/linux64.h: Likewise.
* config/ia64/linux-unwind.h, config/ia64/linux.h: Likewise.
MD_HANDLE_UNWABI too.
* config/mips/linux-unwind.h, config/mips/linux.h: Likewise.
* config/pa/linux-unwind.h, config/pa/pa32-linux.h: Likewise.
* config/rs6000/darwin-unwind.h, config/rs6000/darwin.h: Likewise.
* config/s390/linux-unwind.h, config/s390/linux.h: Likewise.
* config/sparc/linux-unwind.h, config/sparc/linux.h,
config/sparc/linux64.h: Likewise.
* config/sh/linux-unwind.h, config/sh/linux.h: Likewise, but merge
SH_FALLBACK_FRAME_FLOAT_STATE into sh_fallback_frame_state.
* config/rs6000/linux-unwind.h, config/rs6000/linux.h,
config/rs6000/linux64.h: Likewise. Split out get_sigcontext
function. Use ARG_POINTER_REGNUM for 32-bit temp reg too.
From-SVN: r87167
2004-09-08 02:17:19 +02:00
|
|
|
|
#ifdef MD_FALLBACK_FRAME_STATE_FOR
|
2001-03-28 13:04:51 +02:00
|
|
|
|
/* Couldn't find frame unwind info for this function. Try a
|
|
|
|
|
target-specific fallback mechanism. This will necessarily
|
2001-09-20 01:58:10 +02:00
|
|
|
|
not provide a personality routine or LSDA. */
|
tm.texi (MD_UNWIND_SUPPORT): Document.
* doc/tm.texi (MD_UNWIND_SUPPORT): Document.
(MD_FALLBACK_FRAME_STATE_FOR): Update.
* unwind-dw2.c (MD_UNWIND_SUPPORT): #include if defined.
(uw_frame_state_for): Adjust MD_FALLBACK_FRAME_STATE_FOR invocation.
(MD_FROB_UPDATE_CONTEXT): Remove default.
(uw_update_context_1): Instead #ifdef invocation.
* config/ia64/unwind-ia64.c (MD_UNWIND_SUPPORT): #include if defined.
(uw_frame_state_for): Adjust MD_FALLBACK_FRAME_STATE_FOR invocation.
* config/alpha/gnu.h (MD_FALLBACK_FRAME_STATE_FOR): Don't undef.
(MD_UNWIND_SUPPORT): Undefine this instead.
* config/i386/gnu.h: Likewise.
* config/alpha/linux-unwind.h: New file, macro converted to
function, extracted from..
* config/alpha/linux.h (MD_FALLBACK_FRAME_STATE_FOR): ..this.
(MD_UNWIND_SUPPORT): Define.
* config/alpha/vms-unwind.h, config/alpha/vms.h: Likewise.
* config/i386/linux-unwind.h, config/i386/linux.h,
config/i386/linux64.h: Likewise.
* config/ia64/linux-unwind.h, config/ia64/linux.h: Likewise.
MD_HANDLE_UNWABI too.
* config/mips/linux-unwind.h, config/mips/linux.h: Likewise.
* config/pa/linux-unwind.h, config/pa/pa32-linux.h: Likewise.
* config/rs6000/darwin-unwind.h, config/rs6000/darwin.h: Likewise.
* config/s390/linux-unwind.h, config/s390/linux.h: Likewise.
* config/sparc/linux-unwind.h, config/sparc/linux.h,
config/sparc/linux64.h: Likewise.
* config/sh/linux-unwind.h, config/sh/linux.h: Likewise, but merge
SH_FALLBACK_FRAME_FLOAT_STATE into sh_fallback_frame_state.
* config/rs6000/linux-unwind.h, config/rs6000/linux.h,
config/rs6000/linux64.h: Likewise. Split out get_sigcontext
function. Use ARG_POINTER_REGNUM for 32-bit temp reg too.
From-SVN: r87167
2004-09-08 02:17:19 +02:00
|
|
|
|
return MD_FALLBACK_FRAME_STATE_FOR (context, fs);
|
2001-03-28 13:04:51 +02:00
|
|
|
|
#else
|
|
|
|
|
return _URC_END_OF_STACK;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
except.c (eh_data_format_name): Move to ...
* except.c (eh_data_format_name): Move to ...
* dwarf2asm.c: ... here. Use designated initializers if available.
(dw2_asm_output_encoded_addr_rtx): Accept varargs commentary.
* dwarf2asm.h: Update declarations.
* dwarf2out.c (output_cfi) [DW_CFA_set_loc]: If for_eh, mind
ASM_PREFERRED_EH_DATA_FORMAT.
(output_call_frame_info): Likewise. Use 'L' augmentation for
the LSDA encoding.
* unwind-dw2-fde.h (struct fde_vector): New.
(struct old_object): Rename from struct object.
(struct object): New.
(__register_frame_info_bases): Declare.
(__register_frame_info_table_bases): Declare.
(struct dwarf_fde): Remove explicit pc_begin/pc_range members.
* unwind-dw2-fde.c (objects): Remove.
(unseen_objects, seen_objects): New.
(__register_frame_info_bases): New.
(__register_frame_info): Use it.
(__register_frame_info_table_bases): New.
(__register_frame_info_table): Use it.
(__deregister_frame_info): Rewrite for changed object struct.
(base_from_object, get_cie_encoding, get_fde_encoding): New.
(fde_unencoded_compare): Rename from fde_compare; uninline.
(fde_single_encoding_compare, fde_mixed_encoding_compare): New.
(start_fde_sort): Adjust for new definition of fde_vector.
(fde_insert): Likewise.
(end_fde_sort): Likewise. Select comparison function based
on properties of the object.
(fde_split): Take object and fde_compare_t arguments.
(frame_heapsort, fde_merge): Likewise.
(classify_object_over_fdes): Rename from count_fdes. Handle
encoded pointers. Collect encoding, mixed_encoding, and pc_begin
for the object.
(add_fdes): Handle encoded pointers.
(init_object): Rename from frame_init. Update for new struct object.
(linear_search_fdes): Rename from search_fdes. Handle encoded
pointers.
(binary_search_unencoded_fdes): Broken out from _Unwind_Find_FDE.
(binary_search_single_encoding_fdes): New.
(binary_search_mixed_encoding_fdes): New.
(search_object): New.
(_Unwind_Find_FDE): Update for new struct object. Fill in
the dwarf_eh_bases.
* unwind-dw2.c: Include unwind-pe.h. Constify all pointers
iterating over EH data.
(_Unwind_FrameState): Remove saw_lsda, addr_encoding. Add
fde_encoding, lsda_encoding.
(read_uleb128, read_sleb128): Remove.
(read_encoded_pointer): Remove. All callers use read_encoded_value.
(extract_cie_info): Set lsda_encoding from 'L' augmentation.
(uw_frame_state_for): Don't set bases.func. Handle encoded fde
pointers.
* unwind-pe.h: Add "struct" to _Unwind_Context references.
From-SVN: r42176
2001-05-17 00:42:36 +02:00
|
|
|
|
fs->pc = context->bases.func;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
|
|
|
|
cie = get_cie (fde);
|
|
|
|
|
insn = extract_cie_info (cie, context, fs);
|
|
|
|
|
if (insn == NULL)
|
|
|
|
|
/* CIE contained unknown augmentation. */
|
|
|
|
|
return _URC_FATAL_PHASE1_ERROR;
|
|
|
|
|
|
|
|
|
|
/* First decode all the insns in the CIE. */
|
c-lex.c (c_lex_with_flags, lex_string): Constify.
* c-lex.c (c_lex_with_flags, lex_string): Constify.
* c-ppoutput.c (print_line, pp_dir_change): Likewise.
* c-typeck.c (free_all_tagged_tu_seen_up_to): Likewise.
* cfg.c (bb_copy_original_hash, bb_copy_original_eq): Likewise.
* cfgloop.c (loop_exit_hash, loop_exit_eq): Likewise.
* ddg.c (compare_sccs): Likewise.
* df-scan.c (df_ref_compare, df_mw_compare): Likewise.
* dfp.c (decimal_real_from_string, decimal_to_decnumber,
decimal_to_binary, decimal_do_compare, decimal_real_to_decimal,
decimal_do_fix_trunc, decimal_real_to_integer,
decimal_real_to_integer2, decimal_real_maxval): Likewise.
* dse.c (const_group_info_t): New.
(invariant_group_base_eq, invariant_group_base_hash): Constify.
* dwarf2out.c (const_dw_die_ref): New.
(decl_die_table_hash, decl_die_table_eq, file_info_cmp): Constify.
* tree-browser.c (TB_parent_eq): Likewise.
* unwind-dw2-fde.c (__register_frame_info_bases,
__deregister_frame_info_bases, fde_unencoded_compare, fde_split,
add_fdes, linear_search_fdes, binary_search_unencoded_fdes):
Likewise.
* unwind-dw2-fde.h (get_cie, next_fde): Likewise.
* unwind-dw2.c (uw_frame_state_for): Likewise.
* value-prof.c (histogram_hash, histogram_eq): Likewise.
* value-prof.h (const_histogram_value): New.
From-SVN: r126920
2007-07-25 20:14:57 +02:00
|
|
|
|
end = (const unsigned char *) next_fde ((const struct dwarf_fde *) cie);
|
2001-03-28 13:04:51 +02:00
|
|
|
|
execute_cfa_program (insn, end, context, fs);
|
|
|
|
|
|
|
|
|
|
/* Locate augmentation for the fde. */
|
c-lex.c (c_lex_with_flags, lex_string): Constify.
* c-lex.c (c_lex_with_flags, lex_string): Constify.
* c-ppoutput.c (print_line, pp_dir_change): Likewise.
* c-typeck.c (free_all_tagged_tu_seen_up_to): Likewise.
* cfg.c (bb_copy_original_hash, bb_copy_original_eq): Likewise.
* cfgloop.c (loop_exit_hash, loop_exit_eq): Likewise.
* ddg.c (compare_sccs): Likewise.
* df-scan.c (df_ref_compare, df_mw_compare): Likewise.
* dfp.c (decimal_real_from_string, decimal_to_decnumber,
decimal_to_binary, decimal_do_compare, decimal_real_to_decimal,
decimal_do_fix_trunc, decimal_real_to_integer,
decimal_real_to_integer2, decimal_real_maxval): Likewise.
* dse.c (const_group_info_t): New.
(invariant_group_base_eq, invariant_group_base_hash): Constify.
* dwarf2out.c (const_dw_die_ref): New.
(decl_die_table_hash, decl_die_table_eq, file_info_cmp): Constify.
* tree-browser.c (TB_parent_eq): Likewise.
* unwind-dw2-fde.c (__register_frame_info_bases,
__deregister_frame_info_bases, fde_unencoded_compare, fde_split,
add_fdes, linear_search_fdes, binary_search_unencoded_fdes):
Likewise.
* unwind-dw2-fde.h (get_cie, next_fde): Likewise.
* unwind-dw2.c (uw_frame_state_for): Likewise.
* value-prof.c (histogram_hash, histogram_eq): Likewise.
* value-prof.h (const_histogram_value): New.
From-SVN: r126920
2007-07-25 20:14:57 +02:00
|
|
|
|
aug = (const unsigned char *) fde + sizeof (*fde);
|
except.c (eh_data_format_name): Move to ...
* except.c (eh_data_format_name): Move to ...
* dwarf2asm.c: ... here. Use designated initializers if available.
(dw2_asm_output_encoded_addr_rtx): Accept varargs commentary.
* dwarf2asm.h: Update declarations.
* dwarf2out.c (output_cfi) [DW_CFA_set_loc]: If for_eh, mind
ASM_PREFERRED_EH_DATA_FORMAT.
(output_call_frame_info): Likewise. Use 'L' augmentation for
the LSDA encoding.
* unwind-dw2-fde.h (struct fde_vector): New.
(struct old_object): Rename from struct object.
(struct object): New.
(__register_frame_info_bases): Declare.
(__register_frame_info_table_bases): Declare.
(struct dwarf_fde): Remove explicit pc_begin/pc_range members.
* unwind-dw2-fde.c (objects): Remove.
(unseen_objects, seen_objects): New.
(__register_frame_info_bases): New.
(__register_frame_info): Use it.
(__register_frame_info_table_bases): New.
(__register_frame_info_table): Use it.
(__deregister_frame_info): Rewrite for changed object struct.
(base_from_object, get_cie_encoding, get_fde_encoding): New.
(fde_unencoded_compare): Rename from fde_compare; uninline.
(fde_single_encoding_compare, fde_mixed_encoding_compare): New.
(start_fde_sort): Adjust for new definition of fde_vector.
(fde_insert): Likewise.
(end_fde_sort): Likewise. Select comparison function based
on properties of the object.
(fde_split): Take object and fde_compare_t arguments.
(frame_heapsort, fde_merge): Likewise.
(classify_object_over_fdes): Rename from count_fdes. Handle
encoded pointers. Collect encoding, mixed_encoding, and pc_begin
for the object.
(add_fdes): Handle encoded pointers.
(init_object): Rename from frame_init. Update for new struct object.
(linear_search_fdes): Rename from search_fdes. Handle encoded
pointers.
(binary_search_unencoded_fdes): Broken out from _Unwind_Find_FDE.
(binary_search_single_encoding_fdes): New.
(binary_search_mixed_encoding_fdes): New.
(search_object): New.
(_Unwind_Find_FDE): Update for new struct object. Fill in
the dwarf_eh_bases.
* unwind-dw2.c: Include unwind-pe.h. Constify all pointers
iterating over EH data.
(_Unwind_FrameState): Remove saw_lsda, addr_encoding. Add
fde_encoding, lsda_encoding.
(read_uleb128, read_sleb128): Remove.
(read_encoded_pointer): Remove. All callers use read_encoded_value.
(extract_cie_info): Set lsda_encoding from 'L' augmentation.
(uw_frame_state_for): Don't set bases.func. Handle encoded fde
pointers.
* unwind-pe.h: Add "struct" to _Unwind_Context references.
From-SVN: r42176
2001-05-17 00:42:36 +02:00
|
|
|
|
aug += 2 * size_of_encoded_value (fs->fde_encoding);
|
2001-03-28 13:04:51 +02:00
|
|
|
|
insn = NULL;
|
|
|
|
|
if (fs->saw_z)
|
|
|
|
|
{
|
unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with
_uleb128_t and _Unwind_SWord with _sleb128_t.
* unwind-dw2.c (extract_cie_info, execute_stack_op, execute_cfa_program,
uw_frame_state_for, uw_update_context_1): Likewise.
* unwind-c.c (parse_lsda_header, PERSONALITY_FUNCTION): Likewise.
* unwind-pe.h (read_uleb128, read_sleb128,
read_encoded_value_with_base): Likewise.
* unwind-generic.h: Define _sleb128_t and _uleb128_t types.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* libsupc++/eh_personality.cc (parse_lsda_header, check_exception_spec,
get_ttype_entry, empty_exception_spec, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* exception.cc (parse_lsda_header, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
From-SVN: r121116
2007-01-24 15:46:47 +01:00
|
|
|
|
_uleb128_t i;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
aug = read_uleb128 (aug, &i);
|
|
|
|
|
insn = aug + i;
|
|
|
|
|
}
|
except.c (eh_data_format_name): Move to ...
* except.c (eh_data_format_name): Move to ...
* dwarf2asm.c: ... here. Use designated initializers if available.
(dw2_asm_output_encoded_addr_rtx): Accept varargs commentary.
* dwarf2asm.h: Update declarations.
* dwarf2out.c (output_cfi) [DW_CFA_set_loc]: If for_eh, mind
ASM_PREFERRED_EH_DATA_FORMAT.
(output_call_frame_info): Likewise. Use 'L' augmentation for
the LSDA encoding.
* unwind-dw2-fde.h (struct fde_vector): New.
(struct old_object): Rename from struct object.
(struct object): New.
(__register_frame_info_bases): Declare.
(__register_frame_info_table_bases): Declare.
(struct dwarf_fde): Remove explicit pc_begin/pc_range members.
* unwind-dw2-fde.c (objects): Remove.
(unseen_objects, seen_objects): New.
(__register_frame_info_bases): New.
(__register_frame_info): Use it.
(__register_frame_info_table_bases): New.
(__register_frame_info_table): Use it.
(__deregister_frame_info): Rewrite for changed object struct.
(base_from_object, get_cie_encoding, get_fde_encoding): New.
(fde_unencoded_compare): Rename from fde_compare; uninline.
(fde_single_encoding_compare, fde_mixed_encoding_compare): New.
(start_fde_sort): Adjust for new definition of fde_vector.
(fde_insert): Likewise.
(end_fde_sort): Likewise. Select comparison function based
on properties of the object.
(fde_split): Take object and fde_compare_t arguments.
(frame_heapsort, fde_merge): Likewise.
(classify_object_over_fdes): Rename from count_fdes. Handle
encoded pointers. Collect encoding, mixed_encoding, and pc_begin
for the object.
(add_fdes): Handle encoded pointers.
(init_object): Rename from frame_init. Update for new struct object.
(linear_search_fdes): Rename from search_fdes. Handle encoded
pointers.
(binary_search_unencoded_fdes): Broken out from _Unwind_Find_FDE.
(binary_search_single_encoding_fdes): New.
(binary_search_mixed_encoding_fdes): New.
(search_object): New.
(_Unwind_Find_FDE): Update for new struct object. Fill in
the dwarf_eh_bases.
* unwind-dw2.c: Include unwind-pe.h. Constify all pointers
iterating over EH data.
(_Unwind_FrameState): Remove saw_lsda, addr_encoding. Add
fde_encoding, lsda_encoding.
(read_uleb128, read_sleb128): Remove.
(read_encoded_pointer): Remove. All callers use read_encoded_value.
(extract_cie_info): Set lsda_encoding from 'L' augmentation.
(uw_frame_state_for): Don't set bases.func. Handle encoded fde
pointers.
* unwind-pe.h: Add "struct" to _Unwind_Context references.
From-SVN: r42176
2001-05-17 00:42:36 +02:00
|
|
|
|
if (fs->lsda_encoding != DW_EH_PE_omit)
|
2005-06-14 10:25:18 +02:00
|
|
|
|
{
|
|
|
|
|
_Unwind_Ptr lsda;
|
2009-11-25 11:55:54 +01:00
|
|
|
|
|
2005-06-14 10:25:18 +02:00
|
|
|
|
aug = read_encoded_value (context, fs->lsda_encoding, aug, &lsda);
|
|
|
|
|
context->lsda = (void *) lsda;
|
|
|
|
|
}
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
|
|
|
|
/* Then the insns in the FDE up to our target PC. */
|
|
|
|
|
if (insn == NULL)
|
|
|
|
|
insn = aug;
|
c-lex.c (c_lex_with_flags, lex_string): Constify.
* c-lex.c (c_lex_with_flags, lex_string): Constify.
* c-ppoutput.c (print_line, pp_dir_change): Likewise.
* c-typeck.c (free_all_tagged_tu_seen_up_to): Likewise.
* cfg.c (bb_copy_original_hash, bb_copy_original_eq): Likewise.
* cfgloop.c (loop_exit_hash, loop_exit_eq): Likewise.
* ddg.c (compare_sccs): Likewise.
* df-scan.c (df_ref_compare, df_mw_compare): Likewise.
* dfp.c (decimal_real_from_string, decimal_to_decnumber,
decimal_to_binary, decimal_do_compare, decimal_real_to_decimal,
decimal_do_fix_trunc, decimal_real_to_integer,
decimal_real_to_integer2, decimal_real_maxval): Likewise.
* dse.c (const_group_info_t): New.
(invariant_group_base_eq, invariant_group_base_hash): Constify.
* dwarf2out.c (const_dw_die_ref): New.
(decl_die_table_hash, decl_die_table_eq, file_info_cmp): Constify.
* tree-browser.c (TB_parent_eq): Likewise.
* unwind-dw2-fde.c (__register_frame_info_bases,
__deregister_frame_info_bases, fde_unencoded_compare, fde_split,
add_fdes, linear_search_fdes, binary_search_unencoded_fdes):
Likewise.
* unwind-dw2-fde.h (get_cie, next_fde): Likewise.
* unwind-dw2.c (uw_frame_state_for): Likewise.
* value-prof.c (histogram_hash, histogram_eq): Likewise.
* value-prof.h (const_histogram_value): New.
From-SVN: r126920
2007-07-25 20:14:57 +02:00
|
|
|
|
end = (const unsigned char *) next_fde (fde);
|
2001-03-28 13:04:51 +02:00
|
|
|
|
execute_cfa_program (insn, end, context, fs);
|
|
|
|
|
|
|
|
|
|
return _URC_NO_REASON;
|
|
|
|
|
}
|
2001-07-19 20:20:49 +02:00
|
|
|
|
|
|
|
|
|
typedef struct frame_state
|
|
|
|
|
{
|
|
|
|
|
void *cfa;
|
|
|
|
|
void *eh_ptr;
|
|
|
|
|
long cfa_offset;
|
|
|
|
|
long args_size;
|
2001-12-06 22:38:03 +01:00
|
|
|
|
long reg_or_offset[PRE_GCC3_DWARF_FRAME_REGISTERS+1];
|
2001-07-19 20:20:49 +02:00
|
|
|
|
unsigned short cfa_reg;
|
|
|
|
|
unsigned short retaddr_column;
|
2001-12-06 22:38:03 +01:00
|
|
|
|
char saved[PRE_GCC3_DWARF_FRAME_REGISTERS+1];
|
2001-07-19 20:20:49 +02:00
|
|
|
|
} frame_state;
|
|
|
|
|
|
|
|
|
|
struct frame_state * __frame_state_for (void *, struct frame_state *);
|
|
|
|
|
|
|
|
|
|
/* Called from pre-G++ 3.0 __throw to find the registers to restore for
|
|
|
|
|
a given PC_TARGET. The caller should allocate a local variable of
|
|
|
|
|
`struct frame_state' and pass its address to STATE_IN. */
|
|
|
|
|
|
|
|
|
|
struct frame_state *
|
|
|
|
|
__frame_state_for (void *pc_target, struct frame_state *state_in)
|
|
|
|
|
{
|
|
|
|
|
struct _Unwind_Context context;
|
|
|
|
|
_Unwind_FrameState fs;
|
|
|
|
|
int reg;
|
|
|
|
|
|
|
|
|
|
memset (&context, 0, sizeof (struct _Unwind_Context));
|
2011-08-08 15:26:06 +02:00
|
|
|
|
if (!ASSUME_EXTENDED_UNWIND_CONTEXT)
|
|
|
|
|
context.flags = EXTENDED_CONTEXT_BIT;
|
2001-07-19 20:20:49 +02:00
|
|
|
|
context.ra = pc_target + 1;
|
|
|
|
|
|
|
|
|
|
if (uw_frame_state_for (&context, &fs) != _URC_NO_REASON)
|
|
|
|
|
return 0;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
2001-07-19 20:20:49 +02:00
|
|
|
|
/* We have no way to pass a location expression for the CFA to our
|
|
|
|
|
caller. It wouldn't understand it anyway. */
|
unwind-dw2.h: Move cfa-related variables into struct frame_state_reg_info to ensure that the...
* gcc/unwind-dw2.h: Move cfa-related variables into
struct frame_state_reg_info to ensure that the CFA is properly
handled when executing DW_CFA_{remember,restore}_state.
* gcc/unwind-dw2.c, gcc/config/alpha/linux-unwind.h,
gcc/config/alpha/vms-unwind.h, gcc/config/s390/tpf-unwind.h
gcc/config/s390/linux-unwind.h, gcc/config/sparc/linux-unwind.h
gcc/config/i386/linux-unwind.h, gcc/config/sh/linux-unwind.h
gcc/config/rs6000/linux-unwind.h,
gcc/config/rs6000/darwin-fallback.c, gcc/config/pa/linux-unwind.h,
gcc/config/pa/hpux-unwind.h, gcc/config/mips/linux-unwind.h:
Modify to use new cfa_* fields.
From-SVN: r118068
2006-10-26 21:31:09 +02:00
|
|
|
|
if (fs.regs.cfa_how == CFA_EXP)
|
2001-07-19 20:20:49 +02:00
|
|
|
|
return 0;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
2001-12-06 22:38:03 +01:00
|
|
|
|
for (reg = 0; reg < PRE_GCC3_DWARF_FRAME_REGISTERS + 1; reg++)
|
2001-07-19 20:20:49 +02:00
|
|
|
|
{
|
|
|
|
|
state_in->saved[reg] = fs.regs.reg[reg].how;
|
|
|
|
|
switch (state_in->saved[reg])
|
|
|
|
|
{
|
|
|
|
|
case REG_SAVED_REG:
|
|
|
|
|
state_in->reg_or_offset[reg] = fs.regs.reg[reg].loc.reg;
|
|
|
|
|
break;
|
|
|
|
|
case REG_SAVED_OFFSET:
|
|
|
|
|
state_in->reg_or_offset[reg] = fs.regs.reg[reg].loc.offset;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
state_in->reg_or_offset[reg] = 0;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
unwind-dw2.h: Move cfa-related variables into struct frame_state_reg_info to ensure that the...
* gcc/unwind-dw2.h: Move cfa-related variables into
struct frame_state_reg_info to ensure that the CFA is properly
handled when executing DW_CFA_{remember,restore}_state.
* gcc/unwind-dw2.c, gcc/config/alpha/linux-unwind.h,
gcc/config/alpha/vms-unwind.h, gcc/config/s390/tpf-unwind.h
gcc/config/s390/linux-unwind.h, gcc/config/sparc/linux-unwind.h
gcc/config/i386/linux-unwind.h, gcc/config/sh/linux-unwind.h
gcc/config/rs6000/linux-unwind.h,
gcc/config/rs6000/darwin-fallback.c, gcc/config/pa/linux-unwind.h,
gcc/config/pa/hpux-unwind.h, gcc/config/mips/linux-unwind.h:
Modify to use new cfa_* fields.
From-SVN: r118068
2006-10-26 21:31:09 +02:00
|
|
|
|
state_in->cfa_offset = fs.regs.cfa_offset;
|
|
|
|
|
state_in->cfa_reg = fs.regs.cfa_reg;
|
2001-07-19 20:20:49 +02:00
|
|
|
|
state_in->retaddr_column = fs.retaddr_column;
|
|
|
|
|
state_in->args_size = context.args_size;
|
|
|
|
|
state_in->eh_ptr = fs.eh_ptr;
|
|
|
|
|
|
|
|
|
|
return state_in;
|
|
|
|
|
}
|
|
|
|
|
|
2003-07-16 00:49:07 +02:00
|
|
|
|
typedef union { _Unwind_Ptr ptr; _Unwind_Word word; } _Unwind_SpTmp;
|
|
|
|
|
|
|
|
|
|
static inline void
|
|
|
|
|
_Unwind_SetSpColumn (struct _Unwind_Context *context, void *cfa,
|
2006-03-04 08:07:12 +01:00
|
|
|
|
_Unwind_SpTmp *tmp_sp)
|
2003-07-16 00:49:07 +02:00
|
|
|
|
{
|
|
|
|
|
int size = dwarf_reg_size_table[__builtin_dwarf_sp_column ()];
|
2009-11-25 11:55:54 +01:00
|
|
|
|
|
2003-07-16 00:49:07 +02:00
|
|
|
|
if (size == sizeof(_Unwind_Ptr))
|
|
|
|
|
tmp_sp->ptr = (_Unwind_Ptr) cfa;
|
|
|
|
|
else
|
unwind-dw2-fde-glibc.c (base_from_cb_data, [...]): Use gcc_assert and gcc_unreachable as appropriate.
* unwind-dw2-fde-glibc.c (base_from_cb_data,
_Unwind_IteratePhdrCallback): Use gcc_assert and gcc_unreachable as
appropriate.
* unwind-dw2-fde.c (__deregister_frame_info_bases,
base_from_object, fde_split, end_fde_sort): Likewise.
* unwind-dw2.c (_Unwind_GetGR, _Unwind_SetGR, execute_stack_op,
execute_cfa_program, _Unwind_SetSpColumn, uw_update_context_1,
uw_init_context_1): Likewise.
* unwind.inc (_Unwind_RaiseException_Phase2, _Unwind_Resume,
_Unwind_Resume_or_Rethrow): Likewise.
* unwind-pe.h (__gxx_abort): Do not define.
(size_of_encoded_value, base_of_encoded_value,
read_encoded_value_with_base): Use gcc_unreachable.
* unwind.h (_Unwind_GetTextRelBase): Likewise.
From-SVN: r99835
2005-05-17 17:37:47 +02:00
|
|
|
|
{
|
|
|
|
|
gcc_assert (size == sizeof(_Unwind_Word));
|
|
|
|
|
tmp_sp->word = (_Unwind_Ptr) cfa;
|
|
|
|
|
}
|
2003-07-16 00:49:07 +02:00
|
|
|
|
_Unwind_SetGRPtr (context, __builtin_dwarf_sp_column (), tmp_sp);
|
|
|
|
|
}
|
|
|
|
|
|
2001-03-28 13:04:51 +02:00
|
|
|
|
static void
|
|
|
|
|
uw_update_context_1 (struct _Unwind_Context *context, _Unwind_FrameState *fs)
|
|
|
|
|
{
|
|
|
|
|
struct _Unwind_Context orig_context = *context;
|
|
|
|
|
void *cfa;
|
|
|
|
|
long i;
|
|
|
|
|
|
2003-05-11 00:59:04 +02:00
|
|
|
|
#ifdef EH_RETURN_STACKADJ_RTX
|
2003-05-04 07:22:51 +02:00
|
|
|
|
/* Special handling here: Many machines do not use a frame pointer,
|
|
|
|
|
and track the CFA only through offsets from the stack pointer from
|
|
|
|
|
one frame to the next. In this case, the stack pointer is never
|
|
|
|
|
stored, so it has no saved address in the context. What we do
|
|
|
|
|
have is the CFA from the previous stack frame.
|
|
|
|
|
|
|
|
|
|
In very special situations (such as unwind info for signal return),
|
|
|
|
|
there may be location expressions that use the stack pointer as well.
|
|
|
|
|
|
2003-05-06 19:28:37 +02:00
|
|
|
|
Do this conditionally for one frame. This allows the unwind info
|
|
|
|
|
for one frame to save a copy of the stack pointer from the previous
|
|
|
|
|
frame, and be able to use much easier CFA mechanisms to do it.
|
|
|
|
|
Always zap the saved stack pointer value for the next frame; carrying
|
|
|
|
|
the value over from one frame to another doesn't make sense. */
|
2003-05-11 00:59:04 +02:00
|
|
|
|
|
2003-07-16 00:49:07 +02:00
|
|
|
|
_Unwind_SpTmp tmp_sp;
|
2003-05-11 00:59:04 +02:00
|
|
|
|
|
2003-05-06 19:28:37 +02:00
|
|
|
|
if (!_Unwind_GetGRPtr (&orig_context, __builtin_dwarf_sp_column ()))
|
2003-07-16 00:49:07 +02:00
|
|
|
|
_Unwind_SetSpColumn (&orig_context, context->cfa, &tmp_sp);
|
2003-05-06 19:28:37 +02:00
|
|
|
|
_Unwind_SetGRPtr (context, __builtin_dwarf_sp_column (), NULL);
|
2003-05-11 00:59:04 +02:00
|
|
|
|
#endif
|
2003-05-04 07:22:51 +02:00
|
|
|
|
|
2001-03-28 13:04:51 +02:00
|
|
|
|
/* Compute this frame's CFA. */
|
unwind-dw2.h: Move cfa-related variables into struct frame_state_reg_info to ensure that the...
* gcc/unwind-dw2.h: Move cfa-related variables into
struct frame_state_reg_info to ensure that the CFA is properly
handled when executing DW_CFA_{remember,restore}_state.
* gcc/unwind-dw2.c, gcc/config/alpha/linux-unwind.h,
gcc/config/alpha/vms-unwind.h, gcc/config/s390/tpf-unwind.h
gcc/config/s390/linux-unwind.h, gcc/config/sparc/linux-unwind.h
gcc/config/i386/linux-unwind.h, gcc/config/sh/linux-unwind.h
gcc/config/rs6000/linux-unwind.h,
gcc/config/rs6000/darwin-fallback.c, gcc/config/pa/linux-unwind.h,
gcc/config/pa/hpux-unwind.h, gcc/config/mips/linux-unwind.h:
Modify to use new cfa_* fields.
From-SVN: r118068
2006-10-26 21:31:09 +02:00
|
|
|
|
switch (fs->regs.cfa_how)
|
2001-03-28 13:04:51 +02:00
|
|
|
|
{
|
|
|
|
|
case CFA_REG_OFFSET:
|
unwind-dw2.h: Move cfa-related variables into struct frame_state_reg_info to ensure that the...
* gcc/unwind-dw2.h: Move cfa-related variables into
struct frame_state_reg_info to ensure that the CFA is properly
handled when executing DW_CFA_{remember,restore}_state.
* gcc/unwind-dw2.c, gcc/config/alpha/linux-unwind.h,
gcc/config/alpha/vms-unwind.h, gcc/config/s390/tpf-unwind.h
gcc/config/s390/linux-unwind.h, gcc/config/sparc/linux-unwind.h
gcc/config/i386/linux-unwind.h, gcc/config/sh/linux-unwind.h
gcc/config/rs6000/linux-unwind.h,
gcc/config/rs6000/darwin-fallback.c, gcc/config/pa/linux-unwind.h,
gcc/config/pa/hpux-unwind.h, gcc/config/mips/linux-unwind.h:
Modify to use new cfa_* fields.
From-SVN: r118068
2006-10-26 21:31:09 +02:00
|
|
|
|
cfa = _Unwind_GetPtr (&orig_context, fs->regs.cfa_reg);
|
|
|
|
|
cfa += fs->regs.cfa_offset;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case CFA_EXP:
|
|
|
|
|
{
|
unwind-dw2.h: Move cfa-related variables into struct frame_state_reg_info to ensure that the...
* gcc/unwind-dw2.h: Move cfa-related variables into
struct frame_state_reg_info to ensure that the CFA is properly
handled when executing DW_CFA_{remember,restore}_state.
* gcc/unwind-dw2.c, gcc/config/alpha/linux-unwind.h,
gcc/config/alpha/vms-unwind.h, gcc/config/s390/tpf-unwind.h
gcc/config/s390/linux-unwind.h, gcc/config/sparc/linux-unwind.h
gcc/config/i386/linux-unwind.h, gcc/config/sh/linux-unwind.h
gcc/config/rs6000/linux-unwind.h,
gcc/config/rs6000/darwin-fallback.c, gcc/config/pa/linux-unwind.h,
gcc/config/pa/hpux-unwind.h, gcc/config/mips/linux-unwind.h:
Modify to use new cfa_* fields.
From-SVN: r118068
2006-10-26 21:31:09 +02:00
|
|
|
|
const unsigned char *exp = fs->regs.cfa_exp;
|
unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with
_uleb128_t and _Unwind_SWord with _sleb128_t.
* unwind-dw2.c (extract_cie_info, execute_stack_op, execute_cfa_program,
uw_frame_state_for, uw_update_context_1): Likewise.
* unwind-c.c (parse_lsda_header, PERSONALITY_FUNCTION): Likewise.
* unwind-pe.h (read_uleb128, read_sleb128,
read_encoded_value_with_base): Likewise.
* unwind-generic.h: Define _sleb128_t and _uleb128_t types.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* libsupc++/eh_personality.cc (parse_lsda_header, check_exception_spec,
get_ttype_entry, empty_exception_spec, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* exception.cc (parse_lsda_header, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
From-SVN: r121116
2007-01-24 15:46:47 +01:00
|
|
|
|
_uleb128_t len;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
|
|
|
|
exp = read_uleb128 (exp, &len);
|
|
|
|
|
cfa = (void *) (_Unwind_Ptr)
|
2003-05-04 07:22:51 +02:00
|
|
|
|
execute_stack_op (exp, exp + len, &orig_context, 0);
|
2001-03-28 13:04:51 +02:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
default:
|
unwind-dw2-fde-glibc.c (base_from_cb_data, [...]): Use gcc_assert and gcc_unreachable as appropriate.
* unwind-dw2-fde-glibc.c (base_from_cb_data,
_Unwind_IteratePhdrCallback): Use gcc_assert and gcc_unreachable as
appropriate.
* unwind-dw2-fde.c (__deregister_frame_info_bases,
base_from_object, fde_split, end_fde_sort): Likewise.
* unwind-dw2.c (_Unwind_GetGR, _Unwind_SetGR, execute_stack_op,
execute_cfa_program, _Unwind_SetSpColumn, uw_update_context_1,
uw_init_context_1): Likewise.
* unwind.inc (_Unwind_RaiseException_Phase2, _Unwind_Resume,
_Unwind_Resume_or_Rethrow): Likewise.
* unwind-pe.h (__gxx_abort): Do not define.
(size_of_encoded_value, base_of_encoded_value,
read_encoded_value_with_base): Use gcc_unreachable.
* unwind.h (_Unwind_GetTextRelBase): Likewise.
From-SVN: r99835
2005-05-17 17:37:47 +02:00
|
|
|
|
gcc_unreachable ();
|
2001-03-28 13:04:51 +02:00
|
|
|
|
}
|
|
|
|
|
context->cfa = cfa;
|
|
|
|
|
|
|
|
|
|
/* Compute the addresses of all registers saved in this frame. */
|
|
|
|
|
for (i = 0; i < DWARF_FRAME_REGISTERS + 1; ++i)
|
|
|
|
|
switch (fs->regs.reg[i].how)
|
|
|
|
|
{
|
|
|
|
|
case REG_UNSAVED:
|
2009-04-04 13:41:16 +02:00
|
|
|
|
case REG_UNDEFINED:
|
2001-03-28 13:04:51 +02:00
|
|
|
|
break;
|
2003-05-04 07:22:51 +02:00
|
|
|
|
|
2001-03-28 13:04:51 +02:00
|
|
|
|
case REG_SAVED_OFFSET:
|
2003-05-04 07:22:51 +02:00
|
|
|
|
_Unwind_SetGRPtr (context, i,
|
|
|
|
|
(void *) (cfa + fs->regs.reg[i].loc.offset));
|
2001-03-28 13:04:51 +02:00
|
|
|
|
break;
|
2003-05-04 07:22:51 +02:00
|
|
|
|
|
2001-03-28 13:04:51 +02:00
|
|
|
|
case REG_SAVED_REG:
|
2006-03-04 08:07:12 +01:00
|
|
|
|
if (_Unwind_GRByValue (&orig_context, fs->regs.reg[i].loc.reg))
|
|
|
|
|
_Unwind_SetGRValue (context, i,
|
|
|
|
|
_Unwind_GetGR (&orig_context,
|
|
|
|
|
fs->regs.reg[i].loc.reg));
|
|
|
|
|
else
|
|
|
|
|
_Unwind_SetGRPtr (context, i,
|
|
|
|
|
_Unwind_GetGRPtr (&orig_context,
|
|
|
|
|
fs->regs.reg[i].loc.reg));
|
2001-03-28 13:04:51 +02:00
|
|
|
|
break;
|
2003-05-04 07:22:51 +02:00
|
|
|
|
|
2001-03-28 13:04:51 +02:00
|
|
|
|
case REG_SAVED_EXP:
|
|
|
|
|
{
|
except.c (eh_data_format_name): Move to ...
* except.c (eh_data_format_name): Move to ...
* dwarf2asm.c: ... here. Use designated initializers if available.
(dw2_asm_output_encoded_addr_rtx): Accept varargs commentary.
* dwarf2asm.h: Update declarations.
* dwarf2out.c (output_cfi) [DW_CFA_set_loc]: If for_eh, mind
ASM_PREFERRED_EH_DATA_FORMAT.
(output_call_frame_info): Likewise. Use 'L' augmentation for
the LSDA encoding.
* unwind-dw2-fde.h (struct fde_vector): New.
(struct old_object): Rename from struct object.
(struct object): New.
(__register_frame_info_bases): Declare.
(__register_frame_info_table_bases): Declare.
(struct dwarf_fde): Remove explicit pc_begin/pc_range members.
* unwind-dw2-fde.c (objects): Remove.
(unseen_objects, seen_objects): New.
(__register_frame_info_bases): New.
(__register_frame_info): Use it.
(__register_frame_info_table_bases): New.
(__register_frame_info_table): Use it.
(__deregister_frame_info): Rewrite for changed object struct.
(base_from_object, get_cie_encoding, get_fde_encoding): New.
(fde_unencoded_compare): Rename from fde_compare; uninline.
(fde_single_encoding_compare, fde_mixed_encoding_compare): New.
(start_fde_sort): Adjust for new definition of fde_vector.
(fde_insert): Likewise.
(end_fde_sort): Likewise. Select comparison function based
on properties of the object.
(fde_split): Take object and fde_compare_t arguments.
(frame_heapsort, fde_merge): Likewise.
(classify_object_over_fdes): Rename from count_fdes. Handle
encoded pointers. Collect encoding, mixed_encoding, and pc_begin
for the object.
(add_fdes): Handle encoded pointers.
(init_object): Rename from frame_init. Update for new struct object.
(linear_search_fdes): Rename from search_fdes. Handle encoded
pointers.
(binary_search_unencoded_fdes): Broken out from _Unwind_Find_FDE.
(binary_search_single_encoding_fdes): New.
(binary_search_mixed_encoding_fdes): New.
(search_object): New.
(_Unwind_Find_FDE): Update for new struct object. Fill in
the dwarf_eh_bases.
* unwind-dw2.c: Include unwind-pe.h. Constify all pointers
iterating over EH data.
(_Unwind_FrameState): Remove saw_lsda, addr_encoding. Add
fde_encoding, lsda_encoding.
(read_uleb128, read_sleb128): Remove.
(read_encoded_pointer): Remove. All callers use read_encoded_value.
(extract_cie_info): Set lsda_encoding from 'L' augmentation.
(uw_frame_state_for): Don't set bases.func. Handle encoded fde
pointers.
* unwind-pe.h: Add "struct" to _Unwind_Context references.
From-SVN: r42176
2001-05-17 00:42:36 +02:00
|
|
|
|
const unsigned char *exp = fs->regs.reg[i].loc.exp;
|
unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with
_uleb128_t and _Unwind_SWord with _sleb128_t.
* unwind-dw2.c (extract_cie_info, execute_stack_op, execute_cfa_program,
uw_frame_state_for, uw_update_context_1): Likewise.
* unwind-c.c (parse_lsda_header, PERSONALITY_FUNCTION): Likewise.
* unwind-pe.h (read_uleb128, read_sleb128,
read_encoded_value_with_base): Likewise.
* unwind-generic.h: Define _sleb128_t and _uleb128_t types.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* libsupc++/eh_personality.cc (parse_lsda_header, check_exception_spec,
get_ttype_entry, empty_exception_spec, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* exception.cc (parse_lsda_header, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
From-SVN: r121116
2007-01-24 15:46:47 +01:00
|
|
|
|
_uleb128_t len;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
_Unwind_Ptr val;
|
|
|
|
|
|
|
|
|
|
exp = read_uleb128 (exp, &len);
|
|
|
|
|
val = execute_stack_op (exp, exp + len, &orig_context,
|
|
|
|
|
(_Unwind_Ptr) cfa);
|
2003-03-11 21:40:54 +01:00
|
|
|
|
_Unwind_SetGRPtr (context, i, (void *) val);
|
2001-03-28 13:04:51 +02:00
|
|
|
|
}
|
|
|
|
|
break;
|
2006-03-04 08:07:12 +01:00
|
|
|
|
|
|
|
|
|
case REG_SAVED_VAL_OFFSET:
|
|
|
|
|
_Unwind_SetGRValue (context, i,
|
|
|
|
|
(_Unwind_Internal_Ptr)
|
|
|
|
|
(cfa + fs->regs.reg[i].loc.offset));
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case REG_SAVED_VAL_EXP:
|
|
|
|
|
{
|
|
|
|
|
const unsigned char *exp = fs->regs.reg[i].loc.exp;
|
unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with
_uleb128_t and _Unwind_SWord with _sleb128_t.
* unwind-dw2.c (extract_cie_info, execute_stack_op, execute_cfa_program,
uw_frame_state_for, uw_update_context_1): Likewise.
* unwind-c.c (parse_lsda_header, PERSONALITY_FUNCTION): Likewise.
* unwind-pe.h (read_uleb128, read_sleb128,
read_encoded_value_with_base): Likewise.
* unwind-generic.h: Define _sleb128_t and _uleb128_t types.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* libsupc++/eh_personality.cc (parse_lsda_header, check_exception_spec,
get_ttype_entry, empty_exception_spec, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* exception.cc (parse_lsda_header, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
From-SVN: r121116
2007-01-24 15:46:47 +01:00
|
|
|
|
_uleb128_t len;
|
2006-03-04 08:07:12 +01:00
|
|
|
|
_Unwind_Ptr val;
|
|
|
|
|
|
|
|
|
|
exp = read_uleb128 (exp, &len);
|
|
|
|
|
val = execute_stack_op (exp, exp + len, &orig_context,
|
|
|
|
|
(_Unwind_Ptr) cfa);
|
|
|
|
|
_Unwind_SetGRValue (context, i, val);
|
|
|
|
|
}
|
|
|
|
|
break;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
}
|
2003-07-16 13:52:55 +02:00
|
|
|
|
|
unwind-dw2.c (SIGNAL_FRAME_BIT, [...]): Define.
* unwind-dw2.c (SIGNAL_FRAME_BIT, EXTENDED_CONTEXT_BIT): Define.
(struct _Unwind_Context): Rename args_size to flags, remove
signal_frame field, add a new args_size field and version field.
(_Unwind_IsSignalFrame, _Unwind_SetSignalFrame,
_Unwind_IsExtendedContext): New inline functions.
(_Unwind_GetGR, _Unwind_SetGR, _Unwind_GetGRPtr, _Unwind_SetGRPtr):
Assume by_value array is only present if _Unwind_IsExtendedContext.
(_Unwind_GetIPInfo, execute_cfa_program, uw_frame_state_for): Use
_Unwind_IsSignalFrame.
(__frame_state_for): Initialize context.flags to EXTENDED_CONTEXT_BIT.
(uw_update_context_1): Use _Unwind_SetSignalFrame.
(uw_init_context_1): Initialize context->flags to
EXTENDED_CONTEXT_BIT.
* config/rs6000/linux-unwind.h (frob_update_context): Use
_Unwind_SetSignalFrame.
From-SVN: r120406
2007-01-04 00:45:47 +01:00
|
|
|
|
_Unwind_SetSignalFrame (context, fs->signal_frame);
|
2006-02-27 18:26:26 +01:00
|
|
|
|
|
tm.texi (MD_UNWIND_SUPPORT): Document.
* doc/tm.texi (MD_UNWIND_SUPPORT): Document.
(MD_FALLBACK_FRAME_STATE_FOR): Update.
* unwind-dw2.c (MD_UNWIND_SUPPORT): #include if defined.
(uw_frame_state_for): Adjust MD_FALLBACK_FRAME_STATE_FOR invocation.
(MD_FROB_UPDATE_CONTEXT): Remove default.
(uw_update_context_1): Instead #ifdef invocation.
* config/ia64/unwind-ia64.c (MD_UNWIND_SUPPORT): #include if defined.
(uw_frame_state_for): Adjust MD_FALLBACK_FRAME_STATE_FOR invocation.
* config/alpha/gnu.h (MD_FALLBACK_FRAME_STATE_FOR): Don't undef.
(MD_UNWIND_SUPPORT): Undefine this instead.
* config/i386/gnu.h: Likewise.
* config/alpha/linux-unwind.h: New file, macro converted to
function, extracted from..
* config/alpha/linux.h (MD_FALLBACK_FRAME_STATE_FOR): ..this.
(MD_UNWIND_SUPPORT): Define.
* config/alpha/vms-unwind.h, config/alpha/vms.h: Likewise.
* config/i386/linux-unwind.h, config/i386/linux.h,
config/i386/linux64.h: Likewise.
* config/ia64/linux-unwind.h, config/ia64/linux.h: Likewise.
MD_HANDLE_UNWABI too.
* config/mips/linux-unwind.h, config/mips/linux.h: Likewise.
* config/pa/linux-unwind.h, config/pa/pa32-linux.h: Likewise.
* config/rs6000/darwin-unwind.h, config/rs6000/darwin.h: Likewise.
* config/s390/linux-unwind.h, config/s390/linux.h: Likewise.
* config/sparc/linux-unwind.h, config/sparc/linux.h,
config/sparc/linux64.h: Likewise.
* config/sh/linux-unwind.h, config/sh/linux.h: Likewise, but merge
SH_FALLBACK_FRAME_FLOAT_STATE into sh_fallback_frame_state.
* config/rs6000/linux-unwind.h, config/rs6000/linux.h,
config/rs6000/linux64.h: Likewise. Split out get_sigcontext
function. Use ARG_POINTER_REGNUM for 32-bit temp reg too.
From-SVN: r87167
2004-09-08 02:17:19 +02:00
|
|
|
|
#ifdef MD_FROB_UPDATE_CONTEXT
|
2003-07-16 13:52:55 +02:00
|
|
|
|
MD_FROB_UPDATE_CONTEXT (context, fs);
|
tm.texi (MD_UNWIND_SUPPORT): Document.
* doc/tm.texi (MD_UNWIND_SUPPORT): Document.
(MD_FALLBACK_FRAME_STATE_FOR): Update.
* unwind-dw2.c (MD_UNWIND_SUPPORT): #include if defined.
(uw_frame_state_for): Adjust MD_FALLBACK_FRAME_STATE_FOR invocation.
(MD_FROB_UPDATE_CONTEXT): Remove default.
(uw_update_context_1): Instead #ifdef invocation.
* config/ia64/unwind-ia64.c (MD_UNWIND_SUPPORT): #include if defined.
(uw_frame_state_for): Adjust MD_FALLBACK_FRAME_STATE_FOR invocation.
* config/alpha/gnu.h (MD_FALLBACK_FRAME_STATE_FOR): Don't undef.
(MD_UNWIND_SUPPORT): Undefine this instead.
* config/i386/gnu.h: Likewise.
* config/alpha/linux-unwind.h: New file, macro converted to
function, extracted from..
* config/alpha/linux.h (MD_FALLBACK_FRAME_STATE_FOR): ..this.
(MD_UNWIND_SUPPORT): Define.
* config/alpha/vms-unwind.h, config/alpha/vms.h: Likewise.
* config/i386/linux-unwind.h, config/i386/linux.h,
config/i386/linux64.h: Likewise.
* config/ia64/linux-unwind.h, config/ia64/linux.h: Likewise.
MD_HANDLE_UNWABI too.
* config/mips/linux-unwind.h, config/mips/linux.h: Likewise.
* config/pa/linux-unwind.h, config/pa/pa32-linux.h: Likewise.
* config/rs6000/darwin-unwind.h, config/rs6000/darwin.h: Likewise.
* config/s390/linux-unwind.h, config/s390/linux.h: Likewise.
* config/sparc/linux-unwind.h, config/sparc/linux.h,
config/sparc/linux64.h: Likewise.
* config/sh/linux-unwind.h, config/sh/linux.h: Likewise, but merge
SH_FALLBACK_FRAME_FLOAT_STATE into sh_fallback_frame_state.
* config/rs6000/linux-unwind.h, config/rs6000/linux.h,
config/rs6000/linux64.h: Likewise. Split out get_sigcontext
function. Use ARG_POINTER_REGNUM for 32-bit temp reg too.
From-SVN: r87167
2004-09-08 02:17:19 +02:00
|
|
|
|
#endif
|
2001-03-28 13:04:51 +02:00
|
|
|
|
}
|
|
|
|
|
|
2002-03-15 11:18:21 +01:00
|
|
|
|
/* CONTEXT describes the unwind state for a frame, and FS describes the FDE
|
|
|
|
|
of its caller. Update CONTEXT to refer to the caller as well. Note
|
|
|
|
|
that the args_size and lsda members are not updated here, but later in
|
|
|
|
|
uw_frame_state_for. */
|
|
|
|
|
|
2001-03-28 13:04:51 +02:00
|
|
|
|
static void
|
|
|
|
|
uw_update_context (struct _Unwind_Context *context, _Unwind_FrameState *fs)
|
|
|
|
|
{
|
|
|
|
|
uw_update_context_1 (context, fs);
|
|
|
|
|
|
2009-04-04 13:41:16 +02:00
|
|
|
|
/* In general this unwinder doesn't make any distinction between
|
|
|
|
|
undefined and same_value rule. Call-saved registers are assumed
|
|
|
|
|
to have same_value rule by default and explicit undefined
|
|
|
|
|
rule is handled like same_value. The only exception is
|
|
|
|
|
DW_CFA_undefined on retaddr_column which is supposed to
|
|
|
|
|
mark outermost frame in DWARF 3. */
|
|
|
|
|
if (fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (fs->retaddr_column)].how
|
|
|
|
|
== REG_UNDEFINED)
|
|
|
|
|
/* uw_frame_state_for uses context->ra == 0 check to find outermost
|
|
|
|
|
stack frame. */
|
|
|
|
|
context->ra = 0;
|
|
|
|
|
else
|
|
|
|
|
/* Compute the return address now, since the return address column
|
|
|
|
|
can change from frame to frame. */
|
|
|
|
|
context->ra = __builtin_extract_return_addr
|
|
|
|
|
(_Unwind_GetPtr (context, fs->retaddr_column));
|
2001-03-28 13:04:51 +02:00
|
|
|
|
}
|
2005-11-16 23:10:39 +01:00
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
uw_advance_context (struct _Unwind_Context *context, _Unwind_FrameState *fs)
|
|
|
|
|
{
|
|
|
|
|
uw_update_context (context, fs);
|
|
|
|
|
}
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
|
|
|
|
/* Fill in CONTEXT for top-of-stack. The only valid registers at this
|
|
|
|
|
level will be the return address and the CFA. */
|
2002-06-01 00:15:42 +02:00
|
|
|
|
|
2002-01-10 21:12:57 +01:00
|
|
|
|
#define uw_init_context(CONTEXT) \
|
|
|
|
|
do \
|
|
|
|
|
{ \
|
|
|
|
|
/* Do any necessary initialization to access arbitrary stack frames. \
|
|
|
|
|
On the SPARC, this means flushing the register windows. */ \
|
|
|
|
|
__builtin_unwind_init (); \
|
|
|
|
|
uw_init_context_1 (CONTEXT, __builtin_dwarf_cfa (), \
|
|
|
|
|
__builtin_return_address (0)); \
|
|
|
|
|
} \
|
|
|
|
|
while (0)
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
2003-07-16 00:49:07 +02:00
|
|
|
|
static inline void
|
|
|
|
|
init_dwarf_reg_size_table (void)
|
|
|
|
|
{
|
|
|
|
|
__builtin_init_dwarf_reg_size_table (dwarf_reg_size_table);
|
|
|
|
|
}
|
|
|
|
|
|
2009-09-07 17:41:52 +02:00
|
|
|
|
static void __attribute__((noinline))
|
2001-03-28 13:04:51 +02:00
|
|
|
|
uw_init_context_1 (struct _Unwind_Context *context,
|
|
|
|
|
void *outer_cfa, void *outer_ra)
|
|
|
|
|
{
|
|
|
|
|
void *ra = __builtin_extract_return_addr (__builtin_return_address (0));
|
|
|
|
|
_Unwind_FrameState fs;
|
2003-07-16 00:49:07 +02:00
|
|
|
|
_Unwind_SpTmp sp_slot;
|
unwind-dw2-fde-glibc.c (base_from_cb_data, [...]): Use gcc_assert and gcc_unreachable as appropriate.
* unwind-dw2-fde-glibc.c (base_from_cb_data,
_Unwind_IteratePhdrCallback): Use gcc_assert and gcc_unreachable as
appropriate.
* unwind-dw2-fde.c (__deregister_frame_info_bases,
base_from_object, fde_split, end_fde_sort): Likewise.
* unwind-dw2.c (_Unwind_GetGR, _Unwind_SetGR, execute_stack_op,
execute_cfa_program, _Unwind_SetSpColumn, uw_update_context_1,
uw_init_context_1): Likewise.
* unwind.inc (_Unwind_RaiseException_Phase2, _Unwind_Resume,
_Unwind_Resume_or_Rethrow): Likewise.
* unwind-pe.h (__gxx_abort): Do not define.
(size_of_encoded_value, base_of_encoded_value,
read_encoded_value_with_base): Use gcc_unreachable.
* unwind.h (_Unwind_GetTextRelBase): Likewise.
From-SVN: r99835
2005-05-17 17:37:47 +02:00
|
|
|
|
_Unwind_Reason_Code code;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
|
|
|
|
memset (context, 0, sizeof (struct _Unwind_Context));
|
|
|
|
|
context->ra = ra;
|
2011-08-08 15:26:06 +02:00
|
|
|
|
if (!ASSUME_EXTENDED_UNWIND_CONTEXT)
|
|
|
|
|
context->flags = EXTENDED_CONTEXT_BIT;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
unwind-dw2-fde-glibc.c (base_from_cb_data, [...]): Use gcc_assert and gcc_unreachable as appropriate.
* unwind-dw2-fde-glibc.c (base_from_cb_data,
_Unwind_IteratePhdrCallback): Use gcc_assert and gcc_unreachable as
appropriate.
* unwind-dw2-fde.c (__deregister_frame_info_bases,
base_from_object, fde_split, end_fde_sort): Likewise.
* unwind-dw2.c (_Unwind_GetGR, _Unwind_SetGR, execute_stack_op,
execute_cfa_program, _Unwind_SetSpColumn, uw_update_context_1,
uw_init_context_1): Likewise.
* unwind.inc (_Unwind_RaiseException_Phase2, _Unwind_Resume,
_Unwind_Resume_or_Rethrow): Likewise.
* unwind-pe.h (__gxx_abort): Do not define.
(size_of_encoded_value, base_of_encoded_value,
read_encoded_value_with_base): Use gcc_unreachable.
* unwind.h (_Unwind_GetTextRelBase): Likewise.
From-SVN: r99835
2005-05-17 17:37:47 +02:00
|
|
|
|
code = uw_frame_state_for (context, &fs);
|
|
|
|
|
gcc_assert (code == _URC_NO_REASON);
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
2003-07-16 00:49:07 +02:00
|
|
|
|
#if __GTHREADS
|
|
|
|
|
{
|
|
|
|
|
static __gthread_once_t once_regsizes = __GTHREAD_ONCE_INIT;
|
|
|
|
|
if (__gthread_once (&once_regsizes, init_dwarf_reg_size_table) != 0
|
2006-10-30 18:55:33 +01:00
|
|
|
|
&& dwarf_reg_size_table[0] == 0)
|
2003-07-16 00:49:07 +02:00
|
|
|
|
init_dwarf_reg_size_table ();
|
|
|
|
|
}
|
|
|
|
|
#else
|
|
|
|
|
if (dwarf_reg_size_table[0] == 0)
|
|
|
|
|
init_dwarf_reg_size_table ();
|
|
|
|
|
#endif
|
|
|
|
|
|
2001-03-28 13:04:51 +02:00
|
|
|
|
/* Force the frame state to use the known cfa value. */
|
2003-07-16 00:49:07 +02:00
|
|
|
|
_Unwind_SetSpColumn (context, outer_cfa, &sp_slot);
|
unwind-dw2.h: Move cfa-related variables into struct frame_state_reg_info to ensure that the...
* gcc/unwind-dw2.h: Move cfa-related variables into
struct frame_state_reg_info to ensure that the CFA is properly
handled when executing DW_CFA_{remember,restore}_state.
* gcc/unwind-dw2.c, gcc/config/alpha/linux-unwind.h,
gcc/config/alpha/vms-unwind.h, gcc/config/s390/tpf-unwind.h
gcc/config/s390/linux-unwind.h, gcc/config/sparc/linux-unwind.h
gcc/config/i386/linux-unwind.h, gcc/config/sh/linux-unwind.h
gcc/config/rs6000/linux-unwind.h,
gcc/config/rs6000/darwin-fallback.c, gcc/config/pa/linux-unwind.h,
gcc/config/pa/hpux-unwind.h, gcc/config/mips/linux-unwind.h:
Modify to use new cfa_* fields.
From-SVN: r118068
2006-10-26 21:31:09 +02:00
|
|
|
|
fs.regs.cfa_how = CFA_REG_OFFSET;
|
|
|
|
|
fs.regs.cfa_reg = __builtin_dwarf_sp_column ();
|
|
|
|
|
fs.regs.cfa_offset = 0;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
|
|
|
|
uw_update_context_1 (context, &fs);
|
|
|
|
|
|
|
|
|
|
/* If the return address column was saved in a register in the
|
|
|
|
|
initialization context, then we can't see it in the given
|
|
|
|
|
call frame data. So have the initialization context tell us. */
|
|
|
|
|
context->ra = __builtin_extract_return_addr (outer_ra);
|
|
|
|
|
}
|
|
|
|
|
|
2010-04-27 11:40:46 +02:00
|
|
|
|
static void _Unwind_DebugHook (void *, void *)
|
|
|
|
|
__attribute__ ((__noinline__, __used__, __noclone__));
|
2009-05-28 01:12:21 +02:00
|
|
|
|
|
|
|
|
|
/* This function is called during unwinding. It is intended as a hook
|
|
|
|
|
for a debugger to intercept exceptions. CFA is the CFA of the
|
|
|
|
|
target frame. HANDLER is the PC to which control will be
|
|
|
|
|
transferred. */
|
|
|
|
|
static void
|
|
|
|
|
_Unwind_DebugHook (void *cfa __attribute__ ((__unused__)),
|
|
|
|
|
void *handler __attribute__ ((__unused__)))
|
|
|
|
|
{
|
2011-03-14 20:47:58 +01:00
|
|
|
|
/* We only want to use stap probes starting with v3. Earlier
|
|
|
|
|
versions added too much startup cost. */
|
|
|
|
|
#if defined (HAVE_SYS_SDT_H) && defined (STAP_PROBE2) && _SDT_NOTE_TYPE >= 3
|
|
|
|
|
STAP_PROBE2 (libgcc, unwind, cfa, handler);
|
|
|
|
|
#else
|
2009-05-28 01:12:21 +02:00
|
|
|
|
asm ("");
|
2011-03-14 20:47:58 +01:00
|
|
|
|
#endif
|
2009-05-28 01:12:21 +02:00
|
|
|
|
}
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
|
|
|
|
/* Install TARGET into CURRENT so that we can return to it. This is a
|
|
|
|
|
macro because __builtin_eh_return must be invoked in the context of
|
|
|
|
|
our caller. */
|
|
|
|
|
|
2009-05-28 01:12:21 +02:00
|
|
|
|
#define uw_install_context(CURRENT, TARGET) \
|
|
|
|
|
do \
|
|
|
|
|
{ \
|
|
|
|
|
long offset = uw_install_context_1 ((CURRENT), (TARGET)); \
|
|
|
|
|
void *handler = __builtin_frob_return_addr ((TARGET)->ra); \
|
|
|
|
|
_Unwind_DebugHook ((TARGET)->cfa, handler); \
|
|
|
|
|
__builtin_eh_return (offset, handler); \
|
|
|
|
|
} \
|
2002-01-10 21:12:57 +01:00
|
|
|
|
while (0)
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
|
|
|
|
static long
|
|
|
|
|
uw_install_context_1 (struct _Unwind_Context *current,
|
|
|
|
|
struct _Unwind_Context *target)
|
|
|
|
|
{
|
|
|
|
|
long i;
|
2004-08-09 22:31:41 +02:00
|
|
|
|
_Unwind_SpTmp sp_slot;
|
|
|
|
|
|
|
|
|
|
/* If the target frame does not have a saved stack pointer,
|
|
|
|
|
then set up the target's CFA. */
|
|
|
|
|
if (!_Unwind_GetGRPtr (target, __builtin_dwarf_sp_column ()))
|
2006-03-04 08:07:12 +01:00
|
|
|
|
_Unwind_SetSpColumn (target, target->cfa, &sp_slot);
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
|
|
|
|
for (i = 0; i < DWARF_FRAME_REGISTERS; ++i)
|
|
|
|
|
{
|
2011-08-08 15:26:06 +02:00
|
|
|
|
void *c = (void *) (_Unwind_Internal_Ptr) current->reg[i];
|
|
|
|
|
void *t = (void *) (_Unwind_Internal_Ptr)target->reg[i];
|
2003-03-11 21:40:54 +01:00
|
|
|
|
|
2006-03-04 08:07:12 +01:00
|
|
|
|
gcc_assert (current->by_value[i] == 0);
|
|
|
|
|
if (target->by_value[i] && c)
|
|
|
|
|
{
|
|
|
|
|
_Unwind_Word w;
|
|
|
|
|
_Unwind_Ptr p;
|
|
|
|
|
if (dwarf_reg_size_table[i] == sizeof (_Unwind_Word))
|
|
|
|
|
{
|
|
|
|
|
w = (_Unwind_Internal_Ptr) t;
|
|
|
|
|
memcpy (c, &w, sizeof (_Unwind_Word));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
gcc_assert (dwarf_reg_size_table[i] == sizeof (_Unwind_Ptr));
|
|
|
|
|
p = (_Unwind_Internal_Ptr) t;
|
|
|
|
|
memcpy (c, &p, sizeof (_Unwind_Ptr));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (t && c && t != c)
|
2001-03-28 13:04:51 +02:00
|
|
|
|
memcpy (c, t, dwarf_reg_size_table[i]);
|
|
|
|
|
}
|
|
|
|
|
|
2004-08-09 22:31:41 +02:00
|
|
|
|
/* If the current frame doesn't have a saved stack pointer, then we
|
|
|
|
|
need to rely on EH_RETURN_STACKADJ_RTX to get our target stack
|
|
|
|
|
pointer value reloaded. */
|
|
|
|
|
if (!_Unwind_GetGRPtr (current, __builtin_dwarf_sp_column ()))
|
|
|
|
|
{
|
|
|
|
|
void *target_cfa;
|
2003-05-11 00:59:04 +02:00
|
|
|
|
|
2003-07-16 00:49:07 +02:00
|
|
|
|
target_cfa = _Unwind_GetPtr (target, __builtin_dwarf_sp_column ());
|
2004-08-09 22:31:41 +02:00
|
|
|
|
|
|
|
|
|
/* We adjust SP by the difference between CURRENT and TARGET's CFA. */
|
|
|
|
|
if (STACK_GROWS_DOWNWARD)
|
|
|
|
|
return target_cfa - current->cfa + target->args_size;
|
|
|
|
|
else
|
|
|
|
|
return current->cfa - target_cfa - target->args_size;
|
|
|
|
|
}
|
2003-05-11 00:59:04 +02:00
|
|
|
|
return 0;
|
2001-03-28 13:04:51 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline _Unwind_Ptr
|
|
|
|
|
uw_identify_context (struct _Unwind_Context *context)
|
|
|
|
|
{
|
2009-11-03 23:49:37 +01:00
|
|
|
|
/* The CFA is not sufficient to disambiguate the context of a function
|
|
|
|
|
interrupted by a signal before establishing its frame and the context
|
|
|
|
|
of the signal itself. */
|
|
|
|
|
if (STACK_GROWS_DOWNWARD)
|
|
|
|
|
return _Unwind_GetCFA (context) - _Unwind_IsSignalFrame (context);
|
|
|
|
|
else
|
|
|
|
|
return _Unwind_GetCFA (context) + _Unwind_IsSignalFrame (context);
|
2001-03-28 13:04:51 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "unwind.inc"
|
|
|
|
|
|
2004-09-04 02:15:42 +02:00
|
|
|
|
#if defined (USE_GAS_SYMVER) && defined (SHARED) && defined (USE_LIBUNWIND_EXCEPTIONS)
|
|
|
|
|
alias (_Unwind_Backtrace);
|
|
|
|
|
alias (_Unwind_DeleteException);
|
|
|
|
|
alias (_Unwind_FindEnclosingFunction);
|
|
|
|
|
alias (_Unwind_ForcedUnwind);
|
|
|
|
|
alias (_Unwind_GetDataRelBase);
|
|
|
|
|
alias (_Unwind_GetTextRelBase);
|
|
|
|
|
alias (_Unwind_GetCFA);
|
|
|
|
|
alias (_Unwind_GetGR);
|
|
|
|
|
alias (_Unwind_GetIP);
|
|
|
|
|
alias (_Unwind_GetLanguageSpecificData);
|
|
|
|
|
alias (_Unwind_GetRegionStart);
|
|
|
|
|
alias (_Unwind_RaiseException);
|
|
|
|
|
alias (_Unwind_Resume);
|
|
|
|
|
alias (_Unwind_Resume_or_Rethrow);
|
|
|
|
|
alias (_Unwind_SetGR);
|
|
|
|
|
alias (_Unwind_SetIP);
|
|
|
|
|
#endif
|
|
|
|
|
|
2001-03-28 13:04:51 +02:00
|
|
|
|
#endif /* !USING_SJLJ_EXCEPTIONS */
|