Blame libdwarf/pro_frame.h

Packit cdaae3
/*
Packit cdaae3
Packit cdaae3
  Copyright (C) 2000,2004 Silicon Graphics, Inc.  All Rights Reserved.
Packit cdaae3
  Portions Copyright (C) 2017 David Anderson. All Rights Reserved.
Packit cdaae3
Packit cdaae3
  This program is free software; you can redistribute it and/or modify it
Packit cdaae3
  under the terms of version 2.1 of the GNU Lesser General Public License
Packit cdaae3
  as published by the Free Software Foundation.
Packit cdaae3
Packit cdaae3
  This program is distributed in the hope that it would be useful, but
Packit cdaae3
  WITHOUT ANY WARRANTY; without even the implied warranty of
Packit cdaae3
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Packit cdaae3
Packit cdaae3
  Further, this software is distributed without any warranty that it is
Packit cdaae3
  free of the rightful claim of any third person regarding infringement
Packit cdaae3
  or the like.  Any license provided herein, whether implied or
Packit cdaae3
  otherwise, applies only to this software file.  Patent licenses, if
Packit cdaae3
  any, provided herein do not apply to combinations of this program with
Packit cdaae3
  other software, or any other product whatsoever.
Packit cdaae3
Packit cdaae3
  You should have received a copy of the GNU Lesser General Public
Packit cdaae3
  License along with this program; if not, write the Free Software
Packit cdaae3
  Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
Packit cdaae3
  USA.
Packit cdaae3
Packit cdaae3
*/
Packit cdaae3
Packit cdaae3
Packit cdaae3
Packit cdaae3
/*
Packit cdaae3
    Largest register value that can be coded into
Packit cdaae3
    the opcode since there are only 6 bits in the
Packit cdaae3
    register field.
Packit cdaae3
*/
Packit cdaae3
#define MAX_6_BIT_VALUE		0x3f
Packit cdaae3
Packit cdaae3
/* This struct holds debug_frame instructions */
Packit cdaae3
typedef struct Dwarf_P_Frame_Pgm_s *Dwarf_P_Frame_Pgm;
Packit cdaae3
Packit cdaae3
struct Dwarf_P_Frame_Pgm_s {
Packit cdaae3
    Dwarf_Ubyte dfp_opcode; /* opcode - includes reg # */
Packit cdaae3
    char *dfp_args;	 /* operands */
Packit cdaae3
    int dfp_nbytes;	 /* number of bytes in args */
Packit cdaae3
    Dwarf_P_Frame_Pgm dfp_next;
Packit cdaae3
};
Packit cdaae3
Packit cdaae3
Packit cdaae3
/*
Packit cdaae3
    This struct has cie related information. Used to gather data
Packit cdaae3
    from user program, and later to transform to disk form
Packit cdaae3
*/
Packit cdaae3
struct Dwarf_P_Cie_s {
Packit cdaae3
    Dwarf_Half cie_version;
Packit cdaae3
Packit cdaae3
    /*  augmentation. The string is an strdup() copy
Packit cdaae3
        and on freeing the Dwarf_P_Cie the string must be freed. */
Packit cdaae3
    char *cie_aug;
Packit cdaae3
Packit cdaae3
Packit cdaae3
    Dwarf_Ubyte cie_code_align;	/* alignment of code */
Packit cdaae3
    Dwarf_Sbyte cie_data_align;
Packit cdaae3
    Dwarf_Ubyte cie_ret_reg;	/* return register # */
Packit cdaae3
    char *cie_inst;		/* initial instruction */
Packit cdaae3
    long cie_inst_bytes;
Packit cdaae3
    /* no of init_inst */
Packit cdaae3
    Dwarf_P_Cie cie_next;
Packit cdaae3
};
Packit cdaae3
Packit cdaae3
Packit cdaae3
/* producer fields */
Packit cdaae3
struct Dwarf_P_Fde_s {
Packit cdaae3
    Dwarf_Unsigned fde_unused1;
Packit cdaae3
Packit cdaae3
    /* function/subr die for this fde */
Packit cdaae3
    Dwarf_P_Die fde_die;
Packit cdaae3
Packit cdaae3
    /* index to asso. cie */
Packit cdaae3
    Dwarf_Word fde_cie;
Packit cdaae3
Packit cdaae3
    /*  Address of first location of the code this frame applies to If
Packit cdaae3
        fde_end_symbol non-zero, this represents the offset from the
Packit cdaae3
        symbol indicated by fde_r_symidx */
Packit cdaae3
    Dwarf_Addr fde_initloc;
Packit cdaae3
Packit cdaae3
    /* Relocation symbol for address of the code this frame applies to.  */
Packit cdaae3
    Dwarf_Unsigned fde_r_symidx;
Packit cdaae3
Packit cdaae3
    /* Bytes of instr for this fde, if known */
Packit cdaae3
    Dwarf_Unsigned fde_addr_range;
Packit cdaae3
Packit cdaae3
    /* linked list of instructions we will put in fde. */
Packit cdaae3
    Dwarf_P_Frame_Pgm fde_inst;
Packit cdaae3
Packit cdaae3
    /* number of instructions in fde */
Packit cdaae3
    long fde_n_inst;
Packit cdaae3
Packit cdaae3
    /* number of bytes of inst in fde */
Packit cdaae3
    long fde_n_bytes;
Packit cdaae3
Packit cdaae3
    /* offset into exception table for this function. */
Packit cdaae3
    Dwarf_Signed fde_offset_into_exception_tables;
Packit cdaae3
Packit cdaae3
    /* The symbol for the exception table elf section. */
Packit cdaae3
    Dwarf_Unsigned fde_exception_table_symbol;
Packit cdaae3
Packit cdaae3
    /* pointer to last inst */
Packit cdaae3
    Dwarf_P_Frame_Pgm fde_last_inst;
Packit cdaae3
Packit cdaae3
    Dwarf_P_Fde fde_next;
Packit cdaae3
Packit cdaae3
    /*  The symbol and offset of the end symbol. When fde_end_symbol is
Packit cdaae3
        non-zero we must represent the */
Packit cdaae3
    Dwarf_Addr fde_end_symbol_offset;
Packit cdaae3
    Dwarf_Unsigned fde_end_symbol;
Packit cdaae3
Packit cdaae3
    int fde_uwordb_size;
Packit cdaae3
    Dwarf_P_Debug fde_dbg;
Packit cdaae3
Packit cdaae3
    /*  If fde_block is non-null, then it is the set of instructions.
Packit cdaae3
        so we should use it rather than fde_inst. */
Packit cdaae3
    Dwarf_Unsigned fde_inst_block_size;
Packit cdaae3
    void *fde_block;
Packit cdaae3
};