libdwarf.h revision 1
1N/A * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 1N/A * Use is subject to license terms. 1N/A#
pragma ident "%Z%%M% %I% %E% SMI" 1N/A Copyright (C) 2000, 2001 Silicon Graphics, Inc. All Rights Reserved. 1N/A This program is free software; you can redistribute it and/or modify it 1N/A under the terms of version 2.1 of the GNU Lesser General Public License 1N/A as published by the Free Software Foundation. 1N/A This program is distributed in the hope that it would be useful, but 1N/A WITHOUT ANY WARRANTY; without even the implied warranty of 1N/A MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 1N/A Further, this software is distributed without any warranty that it is 1N/A free of the rightful claim of any third person regarding infringement 1N/A or the like. Any license provided herein, whether implied or 1N/A otherwise, applies only to this software file. Patent licenses, if 1N/A any, provided herein do not apply to combinations of this program with 1N/A other software, or any other product whatsoever. 1N/A You should have received a copy of the GNU Lesser General Public 1N/A License along with this program; if not, write the Free Software 1N/A Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, 1N/A Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pky, 1N/A Mountain View, CA 94043, or: 1N/A For further information regarding this notice, see: 1N/A $Revision: 1.71 $ $Date: 2001/05/23 23:34:52 $ 1N/A For libdwarf producers and consumers 1N/A The interface is defined as having 8-byte signed and unsigned 1N/A values so it can handle 64-or-32bit target on 64-or-32bit host. 1N/A Addr is the native size: it represents pointers on 1N/A the host machine (not the target!). 1N/A This contains declarations for types and all producer 1N/A and consumer functions. 1N/A Function declarations are written on a single line each here 1N/A so one can use grep to each declaration in its entirety. 1N/A The declarations are a little harder to read this way, but... 1N/A/* Special case for MIPS, so -64 (LP64) build gets simple -long-. 1N/A Non-MIPS LP64 or ILP64 environments should probably ensure 1N/A _MIPS_SZLONG set to 64 everywhere this header is #included. 1N/Atypedef unsigned long Dwarf_Off;
/* 4 or 8 byte file offset */ 1N/A/* This is for ILP32, allowing i/o of 64bit dwarf info. 1N/A Also should be fine for LP64 and ILP64 cases. 1N/Atypedef unsigned long long Dwarf_Off;
/* 8 byte file offset */ 1N/Atypedef unsigned long long Dwarf_Addr;
/* target memory address */ 1N/A/* uninterpreted block of data 1N/A/* location description 1N/A/* Frame description instructions expanded. 1N/A/* DW_REG_TABLE_SIZE must reflect the number of registers 1N/A/* for DW_DLC_SYMBOLIC_RELOCATIONS output to caller 1N/A v2, adding drd_length: some relocations are 4 and 1N/A some 8 bytes (pointers are 8, section offsets 4) in 1N/A some dwarf environments. (MIPS relocations are all one 1N/A size in any given ABI.) Changing drd_type to an unsigned char 1N/A to keep struct size down. 1N/A for .word end - begin 1N/A to keep size small in struct */ 1N/A of data being relocated. 4 for 32bit. 1N/A/* Opaque types for Consumer Library. */ 1N/A/* Opaque types for Producer Library. */ 1N/A/* error handler function 1N/A Dwarf_dealloc() alloc_type arguments. 1N/A/* The augmenter string for CIE */ 1N/A/* dwarf_init() access arguments 1N/A/* dwarf_init() access flag modifiers 1N/A/* dwarf_init() access flag modifiers 1N/A/* dwarf_pcline() slide arguments 1N/A/* libdwarf error numbers 1N/A /* It is not an allowed size (64 or 32) */ 1N/A /* Error codes defined by the current Libdwarf Implementation. */ 1N/A /* DW_DLE_LAST MUST EQUAL LAST ERROR NUMBER */ 1N/A /* taken as meaning 'undefined value', this is not 1N/A a column or register number. 1N/A Only present at libdwarf runtime. Never on disk. 1N/A /* taken as meaning 'same value' as caller had, not a column 1N/A Only present at libdwarf runtime. Never on disk. 1N/A/* error return values 1N/A /* for functions returning target address */ 1N/A /* for functions returning count */ 1N/A /* for functions returning offset */ 1N/A/* standard return values for functions */ 1N/A/* Special values for offset_into_exception_table field of dwarf fde's. */ 1N/A/* The following value indicates that there is no Exception table offset 1N/A associated with a dwarf frame. */ 1N/A/* The following value indicates that the producer was unable to analyse the 1N/A source file to generate Exception tables for this function. */ 1N/A/*===========================================================================*/ 1N/A/* Dwarf consumer interface initialization and termination operations */ 1N/A/* non-elf initialization */ 1N/A/* elf intialization */ 1N/A/* Undocumented function for memory allocator. */ 1N/A/* die traversal operations */ 1N/A/* finding die given offset */ 1N/A/* higher level functions (Unimplemented) */ 1N/A/* operations on DIEs */ 1N/A char **
/*diename*/,
1N/A/* convenience functions, alternative to using dwarf_attrlist() */ 1N/A/* end of convenience function list */ 1N/A/* this is the main interface to attributes of a DIE */ 1N/A/* query operations for attributes */ 1N/A The following are concerned with the Primary Interface: getting 1N/A the actual data values. One function per 'kind' of FORM. 1N/A /*dwarf_formref returns, thru return_offset, a CU-relative offset 1N/A ** and does not allow DW_FORM_ref_addr*/ 1N/A /*dwarf_global_formref returns, thru return_offset, 1N/A a debug_info-relative offset and does allow all reference forms*/ 1N/A char **
/*returned_string*/,
1N/A/* end attribute query operations. */ 1N/A/* line number operations */ 1N/A/* dwarf_srclines is the normal interface */ 1N/A char***
/*srcfiles*/,
1N/A char **
/*returned_name*/,
1N/A/* tertiary interface to line info */ 1N/A/* end line number operations */ 1N/A/* global name space operations (.debug_pubnames access) */ 1N/A char **
/*returned_name*/,
1N/A#
ifdef __sgi /* pragma is sgi MIPS only */ 1N/A char **
/*returned_name*/,
1N/A/* Static function name operations. */ 1N/A char **
/*returned_name*/,
1N/A char **
/*returned_name*/,
1N/A/* User-defined type name operations. */ 1N/A char **
/*returned_name*/,
1N/A char **
/*returned_name*/,
1N/A/* File-scope static variable name operations. */ 1N/A char **
/*returned_name*/,
1N/A char **
/*returned_name*/,
1N/A/* weak name operations. */ 1N/A char **
/*returned_name*/,
1N/A char **
/*returned_name*/,
1N/A/* location list section operation. (.debug_loc access) */ 1N/A/* abbreviation section operations */ 1N/A/* consumer string section operation */ 1N/A/* Consumer op on gnu .eh_frame info */ 1N/A/* consumer operations on frame info: .debug_frame */ 1N/A char **
/*augmenter*/,
1N/A/* Operations on .debug_aranges. */ 1N/A#
ifdef __sgi /* pragma is sgi MIPS only */ 1N/A/* consumer .debug_macinfo information interface. 1N/A of this macro info */ 1N/A applicable and vend_def # if 1N/A applies to define undef start_file 1N/A string from vendor ext 1N/A/* _dwarf_print_lines is for use by dwarfdump: it prints 1N/A line info to stdout. 1N/A/* _dwarf_ld_sort_lines is for use solely by ld for 1N/A rearranging lines in .debug_line in a .o created with a text 1N/A section per function. 1N/A -OPT:procedure_reorder=ON 1N/A where ld-cord (cord(1)ing by ld, 1N/A not by cord(1)) may have changed the function order. 1N/A/* Used by dwarfdump -v to print offsets, for debugging 1N/A/* Used by dwarfdump -v to print offsets, for debugging 1N/A char *
/*requested_macro_name*/,
1N/A char **
/*returned_macro_value*/,
1N/A char ***
/*returned_pointers_to_macros*/,
1N/A/* utility operations */ 1N/A/* stringcheck zero is default and means do all 1N/A** string length validity checks. 1N/A** Call with parameter value 1 to turn off many such checks (and 1N/A** increase performance). 1N/A** Call with zero for safest running. 1N/A** Actual value saved and returned is only 8 bits! Upper bits 1N/A** ignored by libdwarf (and zero on return). 1N/A** Returns previous value. 1N/A/* DWARF Producer Interface */ 1N/A int*
/*sect name index*/,
1N/A int *
/*drd_buffer_version*/,
1N/A/* v1: no drd_length field, enum explicit */ 1N/A/* v2: has the drd_length field, enum value in uchar member */ 1N/A/* Producer attribute addition functions. */ 1N/A char*
/*string_value*/,
1N/A char*
/*producer_string*/,
1N/A char*
/*current_working_directory*/,
1N/A/* Producer line creation functions (.debug_line) */ 1N/A/* Producer .debug_frame functions */ 1N/A char*
/*augmenter*/,
1N/A/* die creation & addition routines */ 1N/A/* Operations to create location expressions. */ 1N/A char*
/*pubname_name*/,
1N/A char*
/*func_name*/,
1N/A char*
/*type_name*/,
1N/A char*
/*weak_name*/,
1N/A/* .debug_macinfo producer functions 1N/A Functions must be called in right order: the section is output 1N/A In the order these are presented. 1N/A char *
/*macname, with (arglist), no space before (*/,
1N/A char *
/*macvalue*/,
1N/A char *
/*macname, no arglist, of course*/,
1N/A/* end macinfo producer functions */ 1N/A#
endif /* _LIBDWARF_H */