GCC Middle and Back End API Reference
vmsdbgout.c File Reference

Data Structures

struct  dst_line_info_struct
struct  dst_file_info_struct
struct  $descriptor_fib
struct  IOSB
struct  vstring

Typedefs

typedef struct
dst_line_info_struct
dst_line_info_ref
typedef struct dst_line_info_struct dst_line_info_entry
typedef struct
dst_file_info_struct
dst_file_info_ref
typedef struct dst_file_info_struct dst_file_info_entry
typedef char * char_p
typedef struct fibdef
*__fibdef_ptr32 
__attribute__ ((mode(SI)))

Functions

int vms_file_stats_name (const char *, long long *, long *, char *, int *)
static char * full_name (const char *)
static unsigned int lookup_filename (const char *)
static int write_debug_header (DST_HEADER *, const char *, int)
static int write_debug_addr (const char *, const char *, int)
static int write_debug_data1 (unsigned int, const char *, int)
static int write_debug_data2 (unsigned int, const char *, int)
static int write_debug_data4 (unsigned long, const char *, int)
static int write_debug_data8 (unsigned long long, const char *, int)
static int write_debug_delta4 (const char *, const char *, const char *, int)
static int write_debug_string (const char *, const char *, int)
static int write_modbeg (int)
static int write_modend (int)
static int write_rtnbeg (int, int)
static int write_rtnend (int, int)
static int write_pclines (int)
static int write_srccorr (int, dst_file_info_entry, int)
static int write_srccorrs (int)
static void vmsdbgout_init (const char *)
static void vmsdbgout_finish (const char *)
static void vmsdbgout_assembly_start (void)
static void vmsdbgout_define (unsigned int, const char *)
static void vmsdbgout_undef (unsigned int, const char *)
static void vmsdbgout_start_source_file (unsigned int, const char *)
static void vmsdbgout_end_source_file (unsigned int)
static void vmsdbgout_begin_block (unsigned int, unsigned int)
static void vmsdbgout_end_block (unsigned int, unsigned int)
static bool vmsdbgout_ignore_block (const_tree)
static void vmsdbgout_source_line (unsigned int, const char *, int, bool)
static void vmsdbgout_write_source_line (unsigned, const char *, int, bool)
static void vmsdbgout_begin_prologue (unsigned int, const char *)
static void vmsdbgout_end_prologue (unsigned int, const char *)
static void vmsdbgout_end_function (unsigned int)
static void vmsdbgout_begin_epilogue (unsigned int, const char *)
static void vmsdbgout_end_epilogue (unsigned int, const char *)
static void vmsdbgout_begin_function (tree)
static void vmsdbgout_decl (tree)
static void vmsdbgout_global_decl (tree)
static void vmsdbgout_type_decl (tree, int)
static void vmsdbgout_abstract_function (tree)
static int write_debug_header ()
static int write_debug_addr ()
static int write_debug_data1 ()
static int write_debug_data2 ()
static int write_debug_data4 ()
static int write_debug_string ()
static int write_modbeg ()
static int write_modend ()
static int write_rtnbeg ()
static int write_rtnend ()
static int write_pclines ()
static int write_srccorrs ()
static void vmsdbgout_begin_prologue ()
static void vmsdbgout_end_prologue ()
static void vmsdbgout_end_function ()
static void vmsdbgout_begin_epilogue ()
static void vmsdbgout_end_epilogue ()
static void vmsdbgout_begin_block ()
static void vmsdbgout_end_block ()
static bool vmsdbgout_ignore_block ()
static void vmsdbgout_begin_function ()
static char * full_name ()
static unsigned int lookup_filename ()
static void vmsdbgout_source_line (register unsigned line, register const char *filename, int discriminator, bool is_stmt)
static void vmsdbgout_start_source_file ()
static void vmsdbgout_end_source_file ()
static void vmsdbgout_init ()
static void vmsdbgout_define ()
static void vmsdbgout_undef ()
static void vmsdbgout_decl ()
static void vmsdbgout_global_decl ()
static void vmsdbgout_type_decl ()
static void vmsdbgout_abstract_function ()
static void vmsdbgout_finish ()
static int translate_unix ()
static char * to_vms_file_spec ()

Variables

static const long long vms_epoch_offset = 3506716800ll
static dst_file_info_ref file_info_table
static unsigned int file_info_table_allocated
static unsigned int file_info_table_in_use
static vec< char_pfuncnam_table
static vec< unsigned > funcnum_table
static const char * primary_filename
static char * module_producer
static unsigned int module_language
static dst_line_info_ref line_info_table
static unsigned int line_info_table_allocated
static unsigned int line_info_table_in_use
struct gcc_debug_hooks vmsdbg_debug_hooks
static char text_end_label [MAX_ARTIFICIAL_LABEL_BYTES]
static char fullname_buff [4096]
static char * tryfile
static char filename_buff [MAXPATH]
static char vms_filespec [MAXPATH]

Typedef Documentation

typedef struct fibdef* __fibdef_ptr32 __attribute__((mode(SI)))
   descrip.h doesn't have everything ...  
typedef char* char_p
   Each entry in the line_info_table maintains the file and
   line number associated with the label generated for that
   entry.  The label gives the PC value associated with
   the line number entry.  
   NOTE: In the comments in this file, many references are made to "Debug
   Symbol Table".  This term is abbreviated as `DST' throughout the remainder
   of this file.  

Function Documentation

static char* full_name ( const char *  )
static
   Forward declarations for functions defined in this file.  

Referenced by gcc::pass_manager::set_pass_for_id().

static char* full_name ( )
static
   Return the full file specification for FILENAME.  The specification must be
   in VMS syntax in order to be processed by VMS Debug.  
     Unix paths really mess up VMS debug. Better to just output the
     base filename.  

References file_info_table_allocated.

static unsigned int lookup_filename ( const char *  )
static
static unsigned int lookup_filename ( )
static
   Lookup a filename (in the list of filenames that we know about here in
   vmsdbgout.c) and return its "index".  The index of each (known) filename is
   just a unique number which is associated with only that one filename.  We
   need such numbers for the sake of generating labels  and references
   to those files numbers.  If the filename given as an argument is not
   found in our current list, add it to the list and assign it the next
   available unique index number.  In order to speed up searches, we remember
   the index of the filename was looked up last.  This handles the majority of
   all searches.  
     Check to see if the file name that was searched on the previous call
     matches this file name. If so, return the index.  
     Didn't match the previous lookup, search the table 
     Prepare to add a new table entry by making sure there is enough space in
     the table to do so.  If not, expand the current table.  
     Add the new entry to the end of the filename table.  

References asm_out_file, dst_line_info_struct::dst_file_num, dst_line_info_struct::dst_line_num, line_info_table_allocated, lookup_filename(), dst_file_info_struct::max_line, and targetm.

static char* to_vms_file_spec ( )
static
   Wrapper for DECC function that converts a Unix filespec
   to VMS style filespec.  
static int translate_unix ( )
static
   Callback function for filespec style conversion.  
int vms_file_stats_name ( const char *  filename,
long long *  cdt,
long *  siz,
char *  rfo,
int *  ver 
)
   Return VMS file date, size, format, version given a name.  
     Allocate and initialize a FAB and NAM structures.  
     Validate filespec syntax and device existence.  
     Find matching filespec.  
     Get the device name and assign an IO channel.  
     Initialize the FIB and fill in the directory id field.  
     Open and close the file to fill in the attributes.  
     Deassign the channel and exit.  
static void vmsdbgout_abstract_function ( tree  )
static
static void vmsdbgout_abstract_function ( )
static
   Not implemented in VMS Debug.  

References vstring::length.

static void vmsdbgout_assembly_start ( )
static
   Not implemented in VMS Debug.  
static void vmsdbgout_begin_block ( unsigned  int,
unsigned  int 
)
static
static void vmsdbgout_begin_block ( )
static
   Output a marker (i.e. a label) for the beginning of the generated code for
   a lexical block.  
static void vmsdbgout_begin_epilogue ( unsigned  int,
const char *   
)
static
static void vmsdbgout_begin_epilogue ( )
static
   Output a marker (i.e. a label) for the beginning of the epilogue.
   This gets called *before* the epilogue code has been generated.  
             Output a label to mark the endpoint of the code generated for this
             function.  
             VMS PCA expects every PC range to correlate to some line and
             file.  

References asm_out_file, gcc_debug_hooks::begin_block, DINFO_LEVEL_TERSE, dwarf2_debug_hooks, targetm, and VMS_AND_DWARF2_DEBUG.

static void vmsdbgout_begin_function ( tree  )
static
static void vmsdbgout_begin_function ( )
static
   Add an entry for function DECL into the funcnam_table.  
     Add the new entry to the end of the function name table.  

References dst_file_info_struct::file_name.

static void vmsdbgout_begin_prologue ( unsigned  int,
const char *   
)
static
static void vmsdbgout_begin_prologue ( )
static
   Output a marker (i.e. a label) for the beginning of a function, before
   the prologue.  

References asm_out_file, gcc_debug_hooks::begin_epilogue, DINFO_LEVEL_NONE, dwarf2_debug_hooks, and VMS_AND_DWARF2_DEBUG.

static void vmsdbgout_decl ( tree  )
static
static void vmsdbgout_decl ( )
static
   Not implemented in VMS Debug.  
static void vmsdbgout_define ( unsigned  int,
const char *   
)
static
static void vmsdbgout_define ( )
static
   Not implemented in VMS Debug.  
static void vmsdbgout_end_block ( unsigned  int,
unsigned  int 
)
static
static void vmsdbgout_end_block ( )
static
   Output a marker (i.e. a label) for the end of the generated code for a
   lexical block.  
static void vmsdbgout_end_epilogue ( unsigned  int,
const char *   
)
static
static void vmsdbgout_end_epilogue ( )
static
   Output a marker (i.e. a label) for the absolute end of the generated code
   for a function definition.  This gets called *after* the epilogue code has
   been generated.  
         Output a label to mark the endpoint of the code generated for this
         function.  
         VMS PCA expects every PC range to correlate to some line and file.  
static void vmsdbgout_end_function ( unsigned  int)
static
static void vmsdbgout_end_function ( )
static
   No output for VMS debug, but make obligatory call to Dwarf2 debug 
static void vmsdbgout_end_prologue ( unsigned  int,
const char *   
)
static
static void vmsdbgout_end_prologue ( )
static
   Output a marker (i.e. a label) for the beginning of a function, after
   the prologue.  
         VMS PCA expects every PC range to correlate to some line and file.  
static void vmsdbgout_end_source_file ( unsigned  int)
static
static void vmsdbgout_end_source_file ( )
static
   Record the end of a source file, for later output.
   At present, unimplemented.  

References dwarf2_debug_hooks, gcc_debug_hooks::undef, and VMS_AND_DWARF2_DEBUG.

static void vmsdbgout_finish ( const char *  )
static
static void vmsdbgout_finish ( )
static
   Output stuff that Debug requires at the end of every file and generate the
   VMS Debug debugging info.  
     Output a terminator label for the .text section.  
     Output debugging information.
     Warning! Do not change the name of the .vmsdebug section without
     changing it in the assembler also.  
static void vmsdbgout_global_decl ( tree  )
static
static void vmsdbgout_global_decl ( )
static
   Not implemented in VMS Debug.  
static bool vmsdbgout_ignore_block ( const_tree  )
static
static bool vmsdbgout_ignore_block ( )
static
   Not implemented in VMS Debug.  
static void vmsdbgout_init ( const char *  )
static
static void vmsdbgout_init ( )
static
   Set up for Debug output at the start of compilation.  
     Remember the name of the primary input file.  
     Allocate the initial hunk of the file_info_table.  
     Skip the first entry - file numbers begin at 1.  
     Allocate the initial hunk of the line_info_table.  
     zero-th entry is allocated, but unused 

References dwarf2_debug_hooks, gcc_debug_hooks::function_decl, and VMS_AND_DWARF2_DEBUG.

static void vmsdbgout_source_line ( unsigned  int,
const char *  ,
int  ,
bool   
)
static
static void vmsdbgout_source_line ( register unsigned  line,
register const char *  filename,
int  discriminator,
bool  is_stmt 
)
static
static void vmsdbgout_start_source_file ( unsigned  int,
const char *   
)
static
static void vmsdbgout_start_source_file ( )
static
   Record the beginning of a new source file, for later output.
   At present, unimplemented.  

References gcc_debug_hooks::define, dwarf2_debug_hooks, and VMS_AND_DWARF2_DEBUG.

static void vmsdbgout_type_decl ( tree  ,
int   
)
static
static void vmsdbgout_type_decl ( )
static
   Not implemented in VMS Debug.  
static void vmsdbgout_undef ( unsigned  int,
const char *   
)
static
static void vmsdbgout_undef ( )
static
   Not implemented in VMS Debug.  

References write_srccorrs().

static void vmsdbgout_write_source_line ( unsigned  line,
const char *  filename,
int  ,
bool   
)
static
   Output a label to mark the beginning of a source code line entry
   and record information relating to this source line, in
   'line_info_table' for later output of the .debug_line section.  
     Expand the line info table if necessary.  
     Add the new entry at the end of the line_info_table.  
static int write_debug_addr ( const char *  ,
const char *  ,
int   
)
static
static int write_debug_addr ( )
static
   Output the address of SYMBOL.  Also output COMMENT if flag_verbose_asm is
   set.  Return the address size.  Just return the size if DOSIZEONLY is
   nonzero.  
static int write_debug_data1 ( unsigned  int,
const char *  ,
int   
)
static

Referenced by write_modend(), and write_rtnend().

static int write_debug_data1 ( )
static
   Output the single byte DATA1.  Also output COMMENT if flag_verbose_asm is
   set.  Return the data size.  Just return the size if DOSIZEONLY is
   nonzero.  
static int write_debug_data2 ( unsigned  int,
const char *  ,
int   
)
static
static int write_debug_data2 ( )
static
   Output the single word DATA2.  Also output COMMENT if flag_verbose_asm is
   set.  Return the data size.  Just return the size if DOSIZEONLY is
   nonzero.  
static int write_debug_data4 ( unsigned  long,
const char *  ,
int   
)
static
static int write_debug_data4 ( )
static
   Output double word DATA4.  Also output COMMENT if flag_verbose_asm is set.
   Return the data size.  Just return the size if DOSIZEONLY is nonzero.  
static int write_debug_data8 ( unsigned long long  data8,
const char *  comment,
int  dosizeonly 
)
static
   Output quad word DATA8.  Also output COMMENT if flag_verbose_asm is set.
   Return the data size.  Just return the size if DOSIZEONLY is nonzero.  
static int write_debug_delta4 ( const char *  label1,
const char *  label2,
const char *  comment,
int  dosizeonly 
)
static
   Output the difference between LABEL1 and LABEL2.  Also output COMMENT if
   flag_verbose_asm is set.  Return the data size.  Just return the size if
   DOSIZEONLY is nonzero.  
static int write_debug_header ( DST_HEADER ,
const char *  ,
int   
)
static

Referenced by write_modend(), and write_rtnend().

static int write_debug_header ( )
static
   Output the debug header HEADER.  Also output COMMENT if flag_verbose_asm is
   set.  Return the header size.  Just return the size if DOSIZEONLY is
   nonzero.  
static int write_debug_string ( const char *  ,
const char *  ,
int   
)
static
static int write_debug_string ( )
static
   Output a character string STRING.  Also write COMMENT if flag_verbose_asm is
   set.  Return the string length.  Just return the length if DOSIZEONLY is
   nonzero.  
static int write_modbeg ( int  )
static
static int write_modbeg ( )
static
   Output a module begin header and return the header size.  Just return the
   size if DOSIZEONLY is nonzero.  
     Assumes primary filename has Unix syntax file spec.  
static int write_modend ( int  )
static
static int write_modend ( )
static
   Output a module end trailer and return the trailer size.   Just return
   the size if DOSIZEONLY is nonzero.  

References _DST_HEADER::dst__header_length, _DST_HEADER::dst__header_type, DST_K_TBG, _DST_HEADER::dst_w_length, strlen(), write_debug_data1(), and write_debug_header().

static int write_pclines ( int  )
static
static int write_pclines ( )
static
   Output the PC to line number correlations and return the size.  Just return
   the size if DOSIZEONLY is nonzero 
     Set starting address to beginning of text section.  
             K_INCR_LINUM (lndif); 
             K_SET_LINUM (ln-1); 
static int write_rtnbeg ( int  ,
int   
)
static
static int write_rtnbeg ( )
static
   Output a routine begin header routine RTNNUM and return the header size.
   Just return the size if DOSIZEONLY is nonzero.  
         This command isn't documented in DSTRECORDS, so it's made to
         look like what DEC C does 
         header size - 1st byte + flag byte + STO_LW size
         + string count byte + string length 
         I think this is a flag byte, but I don't know what this flag means 
         Routine Begin PD Address 
     The header length never includes the length byte.  
     Routine Begin Address 
     Routine Begin PD Address 
     Routine Begin Name 
static int write_rtnend ( int  ,
int   
)
static
static int write_srccorr ( int  fileid,
dst_file_info_entry  file_info_entry,
int  dosizeonly 
)
static
   Output a source correlation for file FILEID using information saved in
   FILE_INFO_ENTRY and return the size.  Just return the size if DOSIZEONLY is
   nonzero.  
static int write_srccorrs ( int  )
static

Referenced by vmsdbgout_undef().

static int write_srccorrs ( )
static
   Output all the source correlation entries and return the size.  Just return
   the size if DOSIZEONLY is nonzero.  

Variable Documentation

dst_file_info_ref file_info_table
static
   Pointer to a structure of filenames referenced by this compilation unit.  
unsigned int file_info_table_allocated
static
   Total number of entries in the table (i.e. array) pointed to by
   `file_info_table'.  This is the *total* and includes both used and unused
   slots.  

Referenced by full_name().

unsigned int file_info_table_in_use
static
   Number of entries in the file_info_table which are actually in use.  

Referenced by write_rtnend().

char filename_buff[MAXPATH]
static
char fullname_buff[4096]
static
vec<char_p> funcnam_table
static
vec<unsigned> funcnum_table
static
dst_line_info_ref line_info_table
static
   A pointer to the base of a table that contains line information
   for each source code line in .text in the compilation unit.  
unsigned int line_info_table_allocated
static
   Number of elements currently allocated for line_info_table.  

Referenced by lookup_filename().

unsigned int line_info_table_in_use
static
   Number of elements in line_info_table currently in use.  
unsigned int module_language
static
char* module_producer
static
const char* primary_filename
static
   Local pointer to the name of the main input file.  Initialized in
   vmsdbgout_init.  
char text_end_label[MAX_ARTIFICIAL_LABEL_BYTES]
static
   Definitions of defaults for formats and names of various special
   (artificial) labels which may be generated within this file (when the -g
   options is used and VMS_DEBUGGING_INFO is in effect.  If necessary, these
   may be overridden from within the tm.h file, but typically, overriding these
   defaults is unnecessary.  
char* tryfile
static
const long long vms_epoch_offset = 3506716800ll
static
@verbatim 

Output VMS debug format symbol table information from GCC. Copyright (C) 1987-2013 Free Software Foundation, Inc. Contributed by Douglas B. Rupp (rupp@.nosp@m.gnat.nosp@m..com). Updated by Bernard W. Giroud (bgiro.nosp@m.ud@u.nosp@m.sers..nosp@m.sour.nosp@m.cefor.nosp@m.ge.n.nosp@m.et).

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.

GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see http://www.gnu.org/licenses/.

   Difference in seconds between the VMS Epoch and the Unix Epoch 
char vms_filespec[MAXPATH]
static
struct gcc_debug_hooks vmsdbg_debug_hooks
   The debug hooks structure.