2004-07-01 12:09:07 +08:00
|
|
|
/* DWARF2 frame unwind data structure.
|
2014-01-03 06:25:22 +08:00
|
|
|
Copyright (C) 1997-2014 Free Software Foundation, Inc.
|
2004-07-01 12:09:07 +08:00
|
|
|
|
|
|
|
This file is part of GCC.
|
|
|
|
|
|
|
|
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 23:00:19 +08:00
|
|
|
the Free Software Foundation; either version 3, or (at your option)
|
2004-07-01 12:09:07 +08:00
|
|
|
any later version.
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
2009-04-09 23:00:19 +08: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/>. */
|
2004-07-01 12:09:07 +08:00
|
|
|
|
|
|
|
/* The result of interpreting the frame unwind info for a frame.
|
|
|
|
This is all symbolic at this point, as none of the values can
|
|
|
|
be resolved until the target pc is located. */
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
/* Each register save state can be described in terms of a CFA slot,
|
|
|
|
another register, or a location expression. */
|
|
|
|
struct frame_state_reg_info
|
|
|
|
{
|
|
|
|
struct {
|
|
|
|
union {
|
|
|
|
_Unwind_Word reg;
|
|
|
|
_Unwind_Sword offset;
|
|
|
|
const unsigned char *exp;
|
|
|
|
} loc;
|
|
|
|
enum {
|
|
|
|
REG_UNSAVED,
|
|
|
|
REG_SAVED_OFFSET,
|
|
|
|
REG_SAVED_REG,
|
2006-03-04 15:07:12 +08:00
|
|
|
REG_SAVED_EXP,
|
|
|
|
REG_SAVED_VAL_OFFSET,
|
2009-04-04 19:41:16 +08:00
|
|
|
REG_SAVED_VAL_EXP,
|
|
|
|
REG_UNDEFINED
|
2004-07-01 12:09:07 +08:00
|
|
|
} how;
|
Use -fbuilding-libgcc for more target macros used in libgcc.
gcc/c-family:
* c-cppbuiltin.c (c_cpp_builtins): Also define
__LIBGCC_EH_TABLES_CAN_BE_READ_ONLY__,
__LIBGCC_EH_FRAME_SECTION_NAME__, __LIBGCC_JCR_SECTION_NAME__,
__LIBGCC_CTORS_SECTION_ASM_OP__, __LIBGCC_DTORS_SECTION_ASM_OP__,
__LIBGCC_TEXT_SECTION_ASM_OP__, __LIBGCC_INIT_SECTION_ASM_OP__,
__LIBGCC_INIT_ARRAY_SECTION_ASM_OP__,
__LIBGCC_STACK_GROWS_DOWNWARD__,
__LIBGCC_DONT_USE_BUILTIN_SETJMP__,
__LIBGCC_DWARF_ALT_FRAME_RETURN_COLUMN__,
__LIBGCC_DWARF_FRAME_REGISTERS__,
__LIBGCC_EH_RETURN_STACKADJ_RTX__, __LIBGCC_JMP_BUF_SIZE__,
__LIBGCC_STACK_POINTER_REGNUM__ and
__LIBGCC_VTABLE_USES_DESCRIPTORS__ for -fbuilding-libgcc.
(builtin_define_with_value): Handle backslash-escaping in string
macro values.
libgcc:
* Makefile.in (CRTSTUFF_CFLAGS): Add -fbuilding-libgcc.
* config/aarch64/linux-unwind.h (STACK_POINTER_REGNUM): Change all
uses to __LIBGCC_STACK_POINTER_REGNUM__.
(DWARF_ALT_FRAME_RETURN_COLUMN): Change all uses to
__LIBGCC_DWARF_ALT_FRAME_RETURN_COLUMN__.
* config/alpha/vms-unwind.h (DWARF_ALT_FRAME_RETURN_COLUMN):
Change use to __LIBGCC_DWARF_ALT_FRAME_RETURN_COLUMN__.
* config/cr16/unwind-cr16.c (STACK_GROWS_DOWNWARD): Change all
uses to __LIBGCC_STACK_GROWS_DOWNWARD__.
(DWARF_FRAME_REGISTERS): Change all uses to
__LIBGCC_DWARF_FRAME_REGISTERS__.
(EH_RETURN_STACKADJ_RTX): Change all uses to
__LIBGCC_EH_RETURN_STACKADJ_RTX__.
* config/cr16/unwind-dw2.h (DWARF_FRAME_REGISTERS): Change use to
__LIBGCC_DWARF_FRAME_REGISTERS__. Remove conditional definition.
* config/i386/cygming-crtbegin.c (EH_FRAME_SECTION_NAME): Change
use to __LIBGCC_EH_FRAME_SECTION_NAME__.
(JCR_SECTION_NAME): Change use to __LIBGCC_JCR_SECTION_NAME__.
* config/i386/cygming-crtend.c (EH_FRAME_SECTION_NAME): Change use
to __LIBGCC_EH_FRAME_SECTION_NAME__.
(JCR_SECTION_NAME): Change use to __LIBGCC_JCR_SECTION_NAME__
* config/mips/linux-unwind.h (STACK_POINTER_REGNUM): Change use to
__LIBGCC_STACK_POINTER_REGNUM__.
(DWARF_ALT_FRAME_RETURN_COLUMN): Change all uses to
__LIBGCC_DWARF_ALT_FRAME_RETURN_COLUMN__.
* config/nios2/linux-unwind.h (STACK_POINTER_REGNUM): Change use
to __LIBGCC_STACK_POINTER_REGNUM__.
* config/pa/hpux-unwind.h (DWARF_ALT_FRAME_RETURN_COLUMN): Change
all uses to __LIBGCC_DWARF_ALT_FRAME_RETURN_COLUMN__.
* config/pa/linux-unwind.h (DWARF_ALT_FRAME_RETURN_COLUMN): Change
all uses to __LIBGCC_DWARF_ALT_FRAME_RETURN_COLUMN__.
* config/rs6000/aix-unwind.h (DWARF_ALT_FRAME_RETURN_COLUMN):
Change all uses to __LIBGCC_DWARF_ALT_FRAME_RETURN_COLUMN__.
(STACK_POINTER_REGNUM): Change all uses to
__LIBGCC_STACK_POINTER_REGNUM__.
* config/rs6000/darwin-fallback.c (STACK_POINTER_REGNUM): Change
use to __LIBGCC_STACK_POINTER_REGNUM__.
* config/rs6000/linux-unwind.h (STACK_POINTER_REGNUM): Change all
uses to __LIBGCC_STACK_POINTER_REGNUM__.
* config/sparc/linux-unwind.h (DWARF_FRAME_REGISTERS): Change use
to __LIBGCC_DWARF_FRAME_REGISTERS__.
* config/sparc/sol2-unwind.h (DWARF_FRAME_REGISTERS): Change use
to __LIBGCC_DWARF_FRAME_REGISTERS__.
* config/tilepro/linux-unwind.h (STACK_POINTER_REGNUM): Change use
to __LIBGCC_STACK_POINTER_REGNUM__.
* config/xtensa/unwind-dw2-xtensa.h (DWARF_FRAME_REGISTERS):
Remove conditional definition.
* crtstuff.c (TEXT_SECTION_ASM_OP): Change all uses to
__LIBGCC_TEXT_SECTION_ASM_OP__.
(EH_FRAME_SECTION_NAME): Change all uses to
__LIBGCC_EH_FRAME_SECTION_NAME__.
(EH_TABLES_CAN_BE_READ_ONLY): Change all uses to
__LIBGCC_EH_TABLES_CAN_BE_READ_ONLY__.
(CTORS_SECTION_ASM_OP): Change all uses to
__LIBGCC_CTORS_SECTION_ASM_OP__.
(DTORS_SECTION_ASM_OP): Change all uses to
__LIBGCC_DTORS_SECTION_ASM_OP__.
(JCR_SECTION_NAME): Change all uses to
__LIBGCC_JCR_SECTION_NAME__.
(INIT_SECTION_ASM_OP): Change all uses to
__LIBGCC_INIT_SECTION_ASM_OP__.
(INIT_ARRAY_SECTION_ASM_OP): Change all uses to
__LIBGCC_INIT_ARRAY_SECTION_ASM_OP__.
* generic-morestack.c (STACK_GROWS_DOWNWARD): Change all uses to
__LIBGCC_STACK_GROWS_DOWNWARD__.
* libgcc2.c (INIT_SECTION_ASM_OP): Change all uses to
__LIBGCC_INIT_SECTION_ASM_OP__.
(INIT_ARRAY_SECTION_ASM_OP): Change all uses to
__LIBGCC_INIT_ARRAY_SECTION_ASM_OP__.
(EH_FRAME_SECTION_NAME): Change all uses to
__LIBGCC_EH_FRAME_SECTION_NAME__.
* libgcov-profiler.c (VTABLE_USES_DESCRIPTORS): Remove conditional
definitions. Change all uses to
__LIBGCC_VTABLE_USES_DESCRIPTORS__.
* unwind-dw2.c (STACK_GROWS_DOWNWARD): Change all uses to
__LIBGCC_STACK_GROWS_DOWNWARD__.
(DWARF_FRAME_REGISTERS): Change all uses to
__LIBGCC_DWARF_FRAME_REGISTERS__.
(EH_RETURN_STACKADJ_RTX): Change all uses to
__LIBGCC_EH_RETURN_STACKADJ_RTX__.
* unwind-dw2.h (DWARF_FRAME_REGISTERS): Remove conditional
definition. Change use to __LIBGCC_DWARF_FRAME_REGISTERS__.
* unwind-sjlj.c (DONT_USE_BUILTIN_SETJMP): Change all uses to
__LIBGCC_DONT_USE_BUILTIN_SETJMP__.
(JMP_BUF_SIZE): Change use to __LIBGCC_JMP_BUF_SIZE__.
From-SVN: r214954
2014-09-05 20:03:46 +08:00
|
|
|
} reg[__LIBGCC_DWARF_FRAME_REGISTERS__+1];
|
2004-07-01 12:09:07 +08:00
|
|
|
|
|
|
|
/* Used to implement DW_CFA_remember_state. */
|
|
|
|
struct frame_state_reg_info *prev;
|
|
|
|
|
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-27 03:31:09 +08:00
|
|
|
/* The CFA can be described in terms of a reg+offset or a
|
|
|
|
location expression. */
|
|
|
|
_Unwind_Sword cfa_offset;
|
|
|
|
_Unwind_Word cfa_reg;
|
|
|
|
const unsigned char *cfa_exp;
|
|
|
|
enum {
|
|
|
|
CFA_UNSET,
|
|
|
|
CFA_REG_OFFSET,
|
|
|
|
CFA_EXP
|
|
|
|
} cfa_how;
|
|
|
|
} regs;
|
2004-07-01 12:09:07 +08:00
|
|
|
|
|
|
|
/* The PC described by the current frame state. */
|
|
|
|
void *pc;
|
|
|
|
|
|
|
|
/* The information we care about from the CIE/FDE. */
|
|
|
|
_Unwind_Personality_Fn personality;
|
|
|
|
_Unwind_Sword data_align;
|
|
|
|
_Unwind_Word code_align;
|
|
|
|
_Unwind_Word retaddr_column;
|
|
|
|
unsigned char fde_encoding;
|
|
|
|
unsigned char lsda_encoding;
|
|
|
|
unsigned char saw_z;
|
2006-02-28 01:26:26 +08:00
|
|
|
unsigned char signal_frame;
|
2004-07-01 12:09:07 +08:00
|
|
|
void *eh_ptr;
|
|
|
|
} _Unwind_FrameState;
|
|
|
|
|