dwarf_query.c revision 49d3bc91e27cd871b950d56c01398fa2f2e12ab4
/*
Copyright (C) 2000, 2002 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 "dwarf_incl.h"
#include <stdio.h>
#include "dwarf_die_deliv.h"
int
{
if (dbg == 0) {
return (DW_DLV_ERROR);
}
/* length size same as address size */
return DW_DLV_OK;
}
int
{
return DW_DLV_OK;
}
/*
This function returns the offset of
the die relative to the start of its
compilation-unit rather than .debug_info.
Returns DW_DLV_ERROR on error.
*/
int
{
*cu_off =
return DW_DLV_OK;
}
int
{
return DW_DLV_OK;
}
int
{
Dwarf_Word attr_count = 0;
Dwarf_Word i;
ab_code);
if (abbrev_list == NULL) {
return (DW_DLV_ERROR);
}
do {
if (attr != 0) {
new_attr =
return (DW_DLV_ERROR);
}
if(attr_form == DW_FORM_indirect) {
/* DECODE_LEB128_UWORD does info_ptr update */
}
die->di_cu_context->
else {
}
attr_count++;
}
if (attr_count == 0) {
*attrcnt = 0;
return (DW_DLV_NO_ENTRY);
}
attr_ptr = (Dwarf_Attribute *)
return (DW_DLV_ERROR);
}
for (i = 0; i < attr_count; i++) {
}
*attrcnt = attr_count;
return (DW_DLV_OK);
}
/*
This function takes a die, and an attr, and returns
a pointer to the start of the value of that attr in
the given die in the .debug_info section. The form
is returned in *attr_form.
Returns NULL on error, or if attr is not found.
However, *attr_form is 0 on error, and positive
otherwise.
*/
static Dwarf_Byte_Ptr
{
ab_code);
if (abbrev_list == NULL) {
*attr_form = 0;
return (NULL);
}
do {
if(curr_attr_form == DW_FORM_indirect) {
/* DECODE_LEB128_UWORD updates info_ptr */
}
return (info_ptr);
}
die->di_cu_context->
} while (curr_attr != 0 || curr_attr_form != 0);
*attr_form = 1;
return (NULL);
}
int
{
int res;
if (attr_form == 0) {
return (DW_DLV_ERROR);
}
return DW_DLV_NO_ENTRY;
}
if (attr_form == DW_FORM_string) {
return DW_DLV_OK;
}
if (attr_form != DW_FORM_strp) {
return (DW_DLV_ERROR);
}
return (DW_DLV_ERROR);
}
res =
&dbg->de_debug_str,
error);
return res;
}
return DW_DLV_OK;
}
int
{
if (attr_form == 0) {
return (DW_DLV_ERROR);
}
*return_bool = false;
return DW_DLV_OK;
}
*return_bool = (true);
return DW_DLV_OK;
}
int
{
if (attr_form == 0) {
return (DW_DLV_ERROR);
}
return DW_DLV_NO_ENTRY;
}
return (DW_DLV_ERROR);
}
return DW_DLV_OK;
}
int
{
return (DW_DLV_ERROR);
}
return (DW_DLV_NO_ENTRY);
}
*return_addr = ret_addr;
return (DW_DLV_OK);
}
int
{
return (DW_DLV_ERROR);
}
return (DW_DLV_NO_ENTRY);
}
*return_addr = ret_addr;
return (DW_DLV_OK);
}
/*
Takes a die, an attribute attr, and checks if attr
occurs in die. Attr is required to be an attribute
whose form is in the "constant" class. If attr occurs
in die, the value is returned.
Returns DW_DLV_OK, DW_DLV_ERROR, or DW_DLV_NO_ENTRY as
appropriate. Sets the value thru the pointer return_val.
This function is meant to do all the
processing for dwarf_bytesize, dwarf_bitsize, dwarf_bitoffset,
and dwarf_srclang.
*/
static int
Dwarf_Error * error)
{
switch (attr_form) {
case DW_FORM_data1:
return (DW_DLV_OK);
case DW_FORM_data2:
info_ptr, sizeof(Dwarf_Shalf));
*return_val = ret_value;
return (DW_DLV_OK);
case DW_FORM_data4:
info_ptr, sizeof(Dwarf_sfixed));
*return_val = ret_value;
return (DW_DLV_OK);
case DW_FORM_data8:
info_ptr, sizeof(Dwarf_Unsigned));
*return_val = ret_value;
return (DW_DLV_OK);
case DW_FORM_udata:
return (DW_DLV_OK);
default:
return (DW_DLV_ERROR);
}
}
if (attr_form == 0) {
return (DW_DLV_ERROR);
}
return DW_DLV_NO_ENTRY;
}
int
{
int res =
error);
return res;
}
int
{
int res;
res =
error);
return res;
}
int
{
int res;
res =
error);
return res;
}
/* Refer section 3.1, page 21 in Dwarf Definition. */
int
{
int res;
res =
error);
return res;
}
/* Refer section 5.4, page 37 in Dwarf Definition. */
int
{
int res;
res =
error);
return res;
}
/*
Return DW_DLV_OK if ok
DW_DLV_ERROR if failure.
If the die and the attr are not related the result is
meaningless.
*/
int
offset
thru
this
ptr
*/
Dwarf_Error * error)
{
return DW_DLV_OK;
}