dwarf2dbg.h revision 130561
160484Sobrien/* dwarf2dbg.h - DWARF2 debug support 278828Sobrien Copyright 1999, 2000 Free Software Foundation, Inc. 360484Sobrien 460484Sobrien This file is part of GAS, the GNU Assembler. 560484Sobrien 660484Sobrien GAS is free software; you can redistribute it and/or modify 760484Sobrien it under the terms of the GNU General Public License as published by 860484Sobrien the Free Software Foundation; either version 2, or (at your option) 960484Sobrien any later version. 1060484Sobrien 1160484Sobrien GAS is distributed in the hope that it will be useful, 1260484Sobrien but WITHOUT ANY WARRANTY; without even the implied warranty of 1360484Sobrien MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1460484Sobrien GNU General Public License for more details. 1560484Sobrien 1660484Sobrien You should have received a copy of the GNU General Public License 1760484Sobrien along with GAS; see the file COPYING. If not, write to the Free 1860484Sobrien Software Foundation, 59 Temple Place - Suite 330, Boston, MA 1960484Sobrien 02111-1307, USA. */ 2060484Sobrien 2160484Sobrien#ifndef AS_DWARF2DBG_H 2260484Sobrien#define AS_DWARF2DBG_H 2360484Sobrien 2460484Sobrien#include "as.h" 2560484Sobrien 2660484Sobrien#define DWARF2_FLAG_BEGIN_STMT (1 << 0) /* beginning of statement */ 2760484Sobrien#define DWARF2_FLAG_BEGIN_BLOCK (1 << 1) /* beginning of basic block */ 2860484Sobrien 2977298Sobrienstruct dwarf2_line_info { 3077298Sobrien unsigned int filenum; 3177298Sobrien unsigned int line; 3277298Sobrien unsigned int column; 3377298Sobrien unsigned int flags; 3477298Sobrien}; 3560484Sobrien 3660484Sobrien/* Implements the .file FILENO "FILENAME" directive. FILENO can be 0 3760484Sobrien to indicate that no file number has been assigned. All real file 3860484Sobrien number must be >0. */ 39130561Sobrienextern char *dwarf2_directive_file (int dummy); 4060484Sobrien 4160484Sobrien/* Implements the .loc FILENO LINENO [COLUMN] directive. FILENO is 4260484Sobrien the file number, LINENO the line number and the (optional) COLUMN 4360484Sobrien the column of the source code that the following instruction 4460484Sobrien corresponds to. FILENO can be 0 to indicate that the filename 4560484Sobrien specified by the textually most recent .file directive should be 4660484Sobrien used. */ 47130561Sobrienextern void dwarf2_directive_loc (int dummy); 4860484Sobrien 4960484Sobrien/* Returns the current source information. If .file directives have 5060484Sobrien been encountered, the info for the corresponding source file is 5160484Sobrien returned. Otherwise, the info for the assembly source file is 5260484Sobrien returned. */ 53130561Sobrienextern void dwarf2_where (struct dwarf2_line_info *l); 5460484Sobrien 5560484Sobrien/* This function generates .debug_line info based on the address and 5660484Sobrien source information passed in the arguments. ADDR should be the 5760484Sobrien frag-relative offset of the instruction the information is for and 5860484Sobrien L is the source information that should be associated with that 5977298Sobrien address. */ 60130561Sobrienextern void dwarf2_gen_line_info (addressT addr, struct dwarf2_line_info *l); 6160484Sobrien 6277298Sobrien/* Must be called for each generated instruction. */ 63130561Sobrienextern void dwarf2_emit_insn (int); 6477298Sobrien 65130561Sobrienextern void dwarf2_finish (void); 6660484Sobrien 67130561Sobrienextern int dwarf2dbg_estimate_size_before_relax (fragS *); 68130561Sobrienextern int dwarf2dbg_relax_frag (fragS *); 69130561Sobrienextern void dwarf2dbg_convert_frag (fragS *); 7077298Sobrien 71130561Sobrien/* An enumeration which describes the sizes of offsets (to DWARF sections) 72130561Sobrien and the mechanism by which the size is indicated. */ 73130561Sobrienenum dwarf2_format { 74130561Sobrien /* 32-bit format: the initial length field is 4 bytes long. */ 75130561Sobrien dwarf2_format_32bit, 76130561Sobrien /* DWARF3 64-bit format: the representation of the initial length 77130561Sobrien (of a DWARF section) is 0xffffffff (4 bytes) followed by eight 78130561Sobrien bytes indicating the actual length. */ 79130561Sobrien dwarf2_format_64bit, 80130561Sobrien /* SGI extension to DWARF2: The initial length is eight bytes. */ 81130561Sobrien dwarf2_format_64bit_irix 82130561Sobrien}; 83130561Sobrien 8460484Sobrien#endif /* AS_DWARF2DBG_H */ 85