pro_frame.c revision 49d3bc91e27cd871b950d56c01398fa2f2e12ab4
/*
Copyright (C) 2000 Silicon Graphics, Inc. All Rights Reserved.
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307,
USA.
Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pky,
Mountain View, CA 94043, or:
For further information regarding this notice, see:
*/
#include "config.h"
#include "libdwarfdefs.h"
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include "pro_incl.h"
#include "pro_frame.h"
/*-------------------------------------------------------------------------
This functions adds a cie struct to the debug pointer. Its in the
form of a linked list.
augmenter: string reps augmentation (implementation defined)
code_align: alignment of code
data_align: alignment of data
init_bytes: byts having initial instructions
init_n_bytes: number of bytes of initial instructions
--------------------------------------------------------------------------*/
char *augmenter,
{
}
} else {
}
}
}
/*-------------------------------------------------------------------------
This functions adds a fde struct to the debug pointer. Its in the
form of a linked list.
die: subprogram/function die corresponding to this fde
cie: cie referred to by this fde, obtained from call to
add_frame_cie() routine.
virt_addr: beginning address
code_len: length of code reps by the fde
--------------------------------------------------------------------------*/
/*ARGSUSED*/ /* pretend all args used */
{
}
/*ARGSUSED10*/
Dwarf_Error * error)
{
} else {
}
}
/*-------------------------------------------------------------------------
This functions adds information to an fde. The fde is
linked into the linked list of fde's maintained in the Dwarf_P_Debug
structure.
dbg: The debug descriptor.
fde: The fde to be added.
die: subprogram/function die corresponding to this fde
cie: cie referred to by this fde, obtained from call to
add_frame_cie() routine.
virt_addr: beginning address
code_len: length of code reps by the fde
symidx: The symbol id of the symbol wrt to which relocation needs
to be performed for 'virt_addr'.
offset_into_exception_tables: The start of exception tables for
this function (indicated as an offset into the exception
tables). A value of -1 indicates that there is no exception
table entries associated with this function.
exception_table_symbol: The symbol id of the section for exception
tables wrt to which the offset_into_exception_tables will
be relocated.
--------------------------------------------------------------------------*/
Dwarf_Error * error)
{
/* end_symbol */ 0,
/* offset_from_end */ 0,
}
/*ARGSUSED*/ /* pretend all args used */
Dwarf_Error * error)
{
} else {
}
}
/*-------------------------------------------------------------------
Create a new fde
---------------------------------------------------------------------*/
{
fde = (Dwarf_P_Fde)
}
fde->fde_n_inst = 0;
fde->fde_n_bytes = 0;
return fde;
}
/*------------------------------------------------------------------------
Add cfe_offset instruction to fde
-------------------------------------------------------------------------*/
{
char *ptr;
int nbytes;
int res;
char buff1[ENCODE_SPACE_NEEDED];
}
opc = DW_CFA_offset;
if (regno & 0xc0) {
}
return ((Dwarf_P_Fde) DW_DLV_BADADDR);
}
return ((Dwarf_P_Fde) DW_DLV_BADADDR);
}
return fde;
}
/*
Generic routine to add opcode to fde instructions. val1 and
val2 are parameters whose interpretation depends on the 'op'.
This does not work properly for DW_DLC_SYMBOLIC_RELOCATIONS
for DW_CFA_set_loc or DW_DVA_advance_loc* 'op', as
these ops normally are addresses or (DW_CFA_set_loc)
or code lengths (DW_DVA_advance_loc*) and such must be
represented with relocations and symbol indices for
DW_DLC_SYMBOLIC_RELOCATIONS.
*/
{
char *ptr;
int res;
char buff1[ENCODE_SPACE_NEEDED];
char buff2[ENCODE_SPACE_NEEDED];
nbytes = 0;
return ((Dwarf_P_Fde) DW_DLV_BADADDR);
}
switch (op) {
case DW_CFA_advance_loc:
if (val1 <= 0x3f) {
}
/* test not portable FIX */
return ((Dwarf_P_Fde) DW_DLV_BADADDR);
}
nbytes = 1;
}
/* test not portable FIX */
return ((Dwarf_P_Fde) DW_DLV_BADADDR);
}
nbytes = 2;
}
/* test not portable FIX */
return ((Dwarf_P_Fde) DW_DLV_BADADDR);
}
nbytes = 4;
} else {
ptr =
(char *) _dwarf_p_get_alloc(NULL,
sizeof(Dwarf_Unsigned));
return ((Dwarf_P_Fde) DW_DLV_BADADDR);
}
nbytes = 8;
}
break;
case DW_CFA_offset:
if (val1 <= MAX_6_BIT_VALUE) {
return ((Dwarf_P_Fde) DW_DLV_BADADDR);
}
return ((Dwarf_P_Fde) DW_DLV_BADADDR);
}
} else {
return ((Dwarf_P_Fde) DW_DLV_BADADDR);
}
return ((Dwarf_P_Fde) DW_DLV_BADADDR);
}
return ((Dwarf_P_Fde) DW_DLV_BADADDR);
}
}
break;
case DW_CFA_undefined:
case DW_CFA_same_value:
return ((Dwarf_P_Fde) DW_DLV_BADADDR);
}
return ((Dwarf_P_Fde) DW_DLV_BADADDR);
}
break;
case DW_CFA_register:
case DW_CFA_def_cfa:
return ((Dwarf_P_Fde) DW_DLV_BADADDR);
}
return ((Dwarf_P_Fde) DW_DLV_BADADDR);
}
return ((Dwarf_P_Fde) DW_DLV_BADADDR);
}
break;
case DW_CFA_def_cfa_register:
case DW_CFA_def_cfa_offset:
return ((Dwarf_P_Fde) DW_DLV_BADADDR);
}
return ((Dwarf_P_Fde) DW_DLV_BADADDR);
}
break;
default:
break;
}
return fde;
}
/*------------------------------------------------------------------------
instructions are added to fde in the form of a linked
list. This function manages the linked list
-------------------------------------------------------------------------*/
void
{
if (fde->fde_last_inst) {
fde->fde_n_inst++;
fde->fde_n_bytes +=
} else {
fde->fde_n_bytes =
}
}