Back to index

cell-binutils  2.17cvs20070401
dwarf2dbg.h
Go to the documentation of this file.
00001 /* dwarf2dbg.h - DWARF2 debug support
00002    Copyright 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
00003 
00004    This file is part of GAS, the GNU Assembler.
00005 
00006    GAS is free software; you can redistribute it and/or modify
00007    it under the terms of the GNU General Public License as published by
00008    the Free Software Foundation; either version 2, or (at your option)
00009    any later version.
00010 
00011    GAS is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014    GNU General Public License for more details.
00015 
00016    You should have received a copy of the GNU General Public License
00017    along with GAS; see the file COPYING.  If not, write to the Free
00018    Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
00019    02110-1301, USA.  */
00020 
00021 #ifndef AS_DWARF2DBG_H
00022 #define AS_DWARF2DBG_H
00023 
00024 #include "as.h"
00025 
00026 #define DWARF2_FLAG_IS_STMT        (1 << 0)
00027 #define DWARF2_FLAG_BASIC_BLOCK           (1 << 1)
00028 #define DWARF2_FLAG_PROLOGUE_END   (1 << 2)
00029 #define DWARF2_FLAG_EPILOGUE_BEGIN (1 << 3)
00030 
00031 struct dwarf2_line_info {
00032   unsigned int filenum;
00033   unsigned int line;
00034   unsigned int column;
00035   unsigned int isa;
00036   unsigned int flags;
00037 };
00038 
00039 /* Implements the .file FILENO "FILENAME" directive.  FILENO can be 0
00040    to indicate that no file number has been assigned.  All real file
00041    number must be >0.  */
00042 extern char *dwarf2_directive_file (int dummy);
00043 
00044 /* Implements the .loc FILENO LINENO [COLUMN] directive.  FILENO is
00045    the file number, LINENO the line number and the (optional) COLUMN
00046    the column of the source code that the following instruction
00047    corresponds to.  FILENO can be 0 to indicate that the filename
00048    specified by the textually most recent .file directive should be
00049    used.  */
00050 extern void dwarf2_directive_loc (int dummy);
00051 
00052 /* Implements the .loc_mark_labels {0,1} directive.  */
00053 extern void dwarf2_directive_loc_mark_labels (int dummy);
00054 
00055 /* Returns the current source information.  If .file directives have
00056    been encountered, the info for the corresponding source file is
00057    returned.  Otherwise, the info for the assembly source file is
00058    returned.  */
00059 extern void dwarf2_where (struct dwarf2_line_info *l);
00060 
00061 /* A hook to allow the target backend to inform the line number state 
00062    machine of isa changes when assembler debug info is enabled.  */
00063 extern void dwarf2_set_isa (unsigned int isa);
00064 
00065 /* This function generates .debug_line info based on the address and
00066    source information passed in the arguments.  ADDR should be the
00067    frag-relative offset of the instruction the information is for and
00068    L is the source information that should be associated with that
00069    address.  */
00070 extern void dwarf2_gen_line_info (addressT addr, struct dwarf2_line_info *l);
00071 
00072 /* Must be called for each generated instruction.  */
00073 extern void dwarf2_emit_insn (int);
00074 
00075 /* Should be called for each code label.  */
00076 extern void dwarf2_emit_label (symbolS *);
00077 
00078 /* True when we're supposed to set the basic block mark whenever a label
00079    is seen.  Unless the target is doing Something Weird, just call 
00080    dwarf2_emit_label.  */
00081 bfd_boolean dwarf2_loc_mark_labels;
00082 
00083 extern void dwarf2_finish (void);
00084 
00085 extern int dwarf2dbg_estimate_size_before_relax (fragS *);
00086 extern int dwarf2dbg_relax_frag (fragS *);
00087 extern void dwarf2dbg_convert_frag (fragS *);
00088 
00089 /* An enumeration which describes the sizes of offsets (to DWARF sections)
00090    and the mechanism by which the size is indicated.  */
00091 enum dwarf2_format {
00092   /* 32-bit format: the initial length field is 4 bytes long.  */
00093   dwarf2_format_32bit,
00094   /* DWARF3 64-bit format: the representation of the initial length
00095      (of a DWARF section) is 0xffffffff (4 bytes) followed by eight
00096      bytes indicating the actual length.  */
00097   dwarf2_format_64bit,
00098   /* SGI extension to DWARF2: The initial length is eight bytes.  */
00099   dwarf2_format_64bit_irix
00100 };
00101 
00102 #endif /* AS_DWARF2DBG_H */