1*fae548d3Szrj /* dwarf2dbg.h - DWARF2 debug support 2*fae548d3Szrj Copyright (C) 1999-2020 Free Software Foundation, Inc. 3*fae548d3Szrj 4*fae548d3Szrj This file is part of GAS, the GNU Assembler. 5*fae548d3Szrj 6*fae548d3Szrj GAS is free software; you can redistribute it and/or modify 7*fae548d3Szrj it under the terms of the GNU General Public License as published by 8*fae548d3Szrj the Free Software Foundation; either version 3, or (at your option) 9*fae548d3Szrj any later version. 10*fae548d3Szrj 11*fae548d3Szrj GAS is distributed in the hope that it will be useful, 12*fae548d3Szrj but WITHOUT ANY WARRANTY; without even the implied warranty of 13*fae548d3Szrj MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14*fae548d3Szrj GNU General Public License for more details. 15*fae548d3Szrj 16*fae548d3Szrj You should have received a copy of the GNU General Public License 17*fae548d3Szrj along with GAS; see the file COPYING. If not, write to the Free 18*fae548d3Szrj Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 19*fae548d3Szrj 02110-1301, USA. */ 20*fae548d3Szrj 21*fae548d3Szrj #ifndef AS_DWARF2DBG_H 22*fae548d3Szrj #define AS_DWARF2DBG_H 23*fae548d3Szrj 24*fae548d3Szrj #include "as.h" 25*fae548d3Szrj 26*fae548d3Szrj #define DWARF2_FLAG_IS_STMT (1 << 0) 27*fae548d3Szrj #define DWARF2_FLAG_BASIC_BLOCK (1 << 1) 28*fae548d3Szrj #define DWARF2_FLAG_PROLOGUE_END (1 << 2) 29*fae548d3Szrj #define DWARF2_FLAG_EPILOGUE_BEGIN (1 << 3) 30*fae548d3Szrj 31*fae548d3Szrj struct dwarf2_line_info 32*fae548d3Szrj { 33*fae548d3Szrj unsigned int filenum; 34*fae548d3Szrj unsigned int line; 35*fae548d3Szrj unsigned int column; 36*fae548d3Szrj unsigned int isa; 37*fae548d3Szrj unsigned int flags; 38*fae548d3Szrj unsigned int discriminator; 39*fae548d3Szrj symbolS *view; 40*fae548d3Szrj }; 41*fae548d3Szrj 42*fae548d3Szrj /* Implements the .file FILENO "FILENAME" directive. FILENO can be 0 43*fae548d3Szrj to indicate that no file number has been assigned. All real file 44*fae548d3Szrj number must be >0. The second form returns the filename extracted 45*fae548d3Szrj from the input stream. */ 46*fae548d3Szrj extern void dwarf2_directive_file (int); 47*fae548d3Szrj extern char * dwarf2_directive_filename (void); 48*fae548d3Szrj 49*fae548d3Szrj /* Implements the .loc FILENO LINENO [COLUMN] directive. FILENO is 50*fae548d3Szrj the file number, LINENO the line number and the (optional) COLUMN 51*fae548d3Szrj the column of the source code that the following instruction 52*fae548d3Szrj corresponds to. FILENO can be 0 to indicate that the filename 53*fae548d3Szrj specified by the textually most recent .file directive should be 54*fae548d3Szrj used. */ 55*fae548d3Szrj extern void dwarf2_directive_loc (int); 56*fae548d3Szrj 57*fae548d3Szrj /* Implements the .loc_mark_labels {0,1} directive. */ 58*fae548d3Szrj extern void dwarf2_directive_loc_mark_labels (int); 59*fae548d3Szrj 60*fae548d3Szrj /* Returns the current source information. If .file directives have 61*fae548d3Szrj been encountered, the info for the corresponding source file is 62*fae548d3Szrj returned. Otherwise, the info for the assembly source file is 63*fae548d3Szrj returned. */ 64*fae548d3Szrj extern void dwarf2_where (struct dwarf2_line_info *); 65*fae548d3Szrj 66*fae548d3Szrj /* A hook to allow the target backend to inform the line number state 67*fae548d3Szrj machine of isa changes when assembler debug info is enabled. */ 68*fae548d3Szrj extern void dwarf2_set_isa (unsigned int); 69*fae548d3Szrj 70*fae548d3Szrj /* This function generates .debug_line info based on the address and 71*fae548d3Szrj source information passed in the arguments. ADDR should be the 72*fae548d3Szrj frag-relative offset of the instruction the information is for and 73*fae548d3Szrj L is the source information that should be associated with that 74*fae548d3Szrj address. */ 75*fae548d3Szrj extern void dwarf2_gen_line_info (addressT, struct dwarf2_line_info *); 76*fae548d3Szrj 77*fae548d3Szrj /* Must be called for each generated instruction. */ 78*fae548d3Szrj extern void dwarf2_emit_insn (int); 79*fae548d3Szrj 80*fae548d3Szrj void dwarf2_move_insn (int); 81*fae548d3Szrj 82*fae548d3Szrj /* Reset the state of the line number information to reflect that 83*fae548d3Szrj it has been used. */ 84*fae548d3Szrj extern void dwarf2_consume_line_info (void); 85*fae548d3Szrj 86*fae548d3Szrj /* Should be called for each code label. */ 87*fae548d3Szrj extern void dwarf2_emit_label (symbolS *); 88*fae548d3Szrj 89*fae548d3Szrj /* True when we've seen a .loc directive recently. Used to avoid 90*fae548d3Szrj doing work when there's nothing to do. */ 91*fae548d3Szrj extern bfd_boolean dwarf2_loc_directive_seen; 92*fae548d3Szrj 93*fae548d3Szrj /* True when we're supposed to set the basic block mark whenever a label 94*fae548d3Szrj is seen. Unless the target is doing Something Weird, just call 95*fae548d3Szrj dwarf2_emit_label. */ 96*fae548d3Szrj extern bfd_boolean dwarf2_loc_mark_labels; 97*fae548d3Szrj 98*fae548d3Szrj extern void dwarf2_init (void); 99*fae548d3Szrj 100*fae548d3Szrj extern void dwarf2_finish (void); 101*fae548d3Szrj 102*fae548d3Szrj extern int dwarf2dbg_estimate_size_before_relax (fragS *); 103*fae548d3Szrj extern int dwarf2dbg_relax_frag (fragS *); 104*fae548d3Szrj extern void dwarf2dbg_convert_frag (fragS *); 105*fae548d3Szrj 106*fae548d3Szrj extern void dwarf2dbg_final_check (void); 107*fae548d3Szrj 108*fae548d3Szrj /* An enumeration which describes the sizes of offsets (to DWARF sections) 109*fae548d3Szrj and the mechanism by which the size is indicated. */ 110*fae548d3Szrj enum dwarf2_format 111*fae548d3Szrj { 112*fae548d3Szrj /* 32-bit format: the initial length field is 4 bytes long. */ 113*fae548d3Szrj dwarf2_format_32bit, 114*fae548d3Szrj /* DWARF3 64-bit format: the representation of the initial length 115*fae548d3Szrj (of a DWARF section) is 0xffffffff (4 bytes) followed by eight 116*fae548d3Szrj bytes indicating the actual length. */ 117*fae548d3Szrj dwarf2_format_64bit, 118*fae548d3Szrj /* SGI extension to DWARF2: The initial length is eight bytes. */ 119*fae548d3Szrj dwarf2_format_64bit_irix 120*fae548d3Szrj }; 121*fae548d3Szrj 122*fae548d3Szrj #endif /* AS_DWARF2DBG_H */ 123