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 lookup_filename(), and gcc::pass_manager::register_one_dump_file().

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.   

References fullname_buff.

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.   

References dst_file_info_struct::cdt, dst_file_info_struct::ebk, dst_file_info_struct::ffb, file_info_table_allocated, file_info_table_in_use, dst_file_info_struct::file_name, full_name(), dst_file_info_struct::max_line, dst_file_info_struct::rfo, and vms_file_stats_name().

static char* to_vms_file_spec ( )
static
Wrapper for DECC function that converts a Unix filespec
   to VMS style filespec.   

References translate_unix(), and vms_filespec.

Referenced by vms_file_stats_name().

static int translate_unix ( )
static
Callback function for filespec style conversion.   

Referenced by to_vms_file_spec().

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.   

References vstring::length, memset(), IOSB::status, vstring::string, strlen(), to_vms_file_spec(), and tryfile.

Referenced by lookup_filename(), and output_file_names().

static void vmsdbgout_abstract_function ( tree  )
static
static void vmsdbgout_abstract_function ( )
static
static void vmsdbgout_assembly_start ( )
static
Not implemented in VMS Debug.   

References gcc_debug_hooks::assembly_start, dwarf2_debug_hooks, and VMS_AND_DWARF2_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.   

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_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.   

References asm_out_file, gcc_debug_hooks::begin_epilogue, DINFO_LEVEL_NONE, dwarf2_debug_hooks, gcc_debug_hooks::label, VMS_AND_DWARF2_DEBUG, and vmsdbgout_write_source_line().

static void vmsdbgout_begin_function ( tree  )
static
static void vmsdbgout_begin_function ( )
static
Add an entry for function DECL into the funcnam_table.   

References gcc_debug_hooks::begin_function, dwarf2_debug_hooks, and VMS_AND_DWARF2_DEBUG.

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_prologue, DINFO_LEVEL_NONE, dwarf2_debug_hooks, gcc_debug_hooks::label, and VMS_AND_DWARF2_DEBUG.

static void vmsdbgout_decl ( tree  )
static
static void vmsdbgout_decl ( )
static
Not implemented in VMS Debug.   

References dwarf2_debug_hooks, gcc_debug_hooks::function_decl, and VMS_AND_DWARF2_DEBUG.

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

References gcc_debug_hooks::define, dwarf2_debug_hooks, and VMS_AND_DWARF2_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.   

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

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.   

References asm_out_file, DINFO_LEVEL_NONE, dwarf2_debug_hooks, gcc_debug_hooks::end_epilogue, gcc_debug_hooks::label, VMS_AND_DWARF2_DEBUG, and vmsdbgout_write_source_line().

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  

References dwarf2_debug_hooks, gcc_debug_hooks::end_function, and VMS_AND_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.   

References asm_out_file, DINFO_LEVEL_TERSE, dwarf2_debug_hooks, gcc_debug_hooks::end_prologue, gcc_debug_hooks::label, VMS_AND_DWARF2_DEBUG, and vmsdbgout_write_source_line().

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::end_source_file, and VMS_AND_DWARF2_DEBUG.

static void vmsdbgout_finish ( const char *  )
static
static void vmsdbgout_finish ( )
static
static void vmsdbgout_global_decl ( tree  )
static
static void vmsdbgout_global_decl ( )
static
Not implemented in VMS Debug.   

References dwarf2_debug_hooks, gcc_debug_hooks::global_decl, and VMS_AND_DWARF2_DEBUG.

static bool vmsdbgout_ignore_block ( const_tree  )
static
static bool vmsdbgout_ignore_block ( )
static
Not implemented in VMS Debug.   

References dwarf2_debug_hooks, gcc_debug_hooks::ignore_block, and VMS_AND_DWARF2_DEBUG.

static void vmsdbgout_init ( const char *  )
static
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 dwarf2_debug_hooks, gcc_debug_hooks::start_source_file, and VMS_AND_DWARF2_DEBUG.

static void vmsdbgout_type_decl ( tree  ,
int   
)
static
static void vmsdbgout_type_decl ( )
static
Not implemented in VMS Debug.   

References dwarf2_debug_hooks, gcc_debug_hooks::type_decl, and VMS_AND_DWARF2_DEBUG.

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

References dwarf2_debug_hooks, gcc_debug_hooks::undef, and VMS_AND_DWARF2_DEBUG.

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.   

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

Referenced by vmsdbgout_begin_epilogue(), vmsdbgout_end_epilogue(), vmsdbgout_end_prologue(), and vmsdbgout_source_line().

static int write_debug_addr ( const char *  ,
const char *  ,
int   
)
static

Referenced by write_rtnbeg().

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.   

References asm_out_file.

static int write_debug_data1 ( unsigned  int,
const char *  ,
int   
)
static
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.   

References asm_out_file.

static int write_debug_data2 ( unsigned  int,
const char *  ,
int   
)
static

Referenced by write_modbeg(), and write_srccorr().

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.   

References asm_out_file.

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.   

References asm_out_file.

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.   

References asm_out_file.

Referenced by write_srccorr().

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.   

References asm_out_file.

Referenced by write_pclines(), and write_rtnend().

static int write_debug_header ( DST_HEADER ,
const char *  ,
int   
)
static
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.   

References asm_out_file, _DST_HEADER::dst__header_length, _DST_HEADER::dst__header_type, and _DST_HEADER::dst_w_length.

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.   

References asm_out_file, and strlen().

static int write_modbeg ( int  )
static

Referenced by vmsdbgout_finish().

static int write_modend ( int  )
static

Referenced by vmsdbgout_finish().

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_MODULE_END::dst_a_modend_header, DST_K_MODEND, _DST_HEADER::dst_w_length, and write_debug_header().

static int write_pclines ( int  )
static

Referenced by vmsdbgout_finish().

static int write_rtnbeg ( int  ,
int   
)
static

Referenced by vmsdbgout_finish().

static int write_rtnend ( int  ,
int   
)
static

Referenced by vmsdbgout_finish().

static int write_rtnend ( )
static
static int write_srccorrs ( int  )
static

Referenced by vmsdbgout_finish().

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

References file_info_table_in_use, and write_srccorr().


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 lookup_filename(), and vmsdbgout_init().

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

Referenced by lookup_filename(), vmsdbgout_init(), write_pclines(), and write_srccorrs().

char filename_buff[MAXPATH]
static
char fullname_buff[4096]
static

Referenced by full_name().

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 vmsdbgout_init(), and vmsdbgout_write_source_line().

unsigned int line_info_table_in_use
static
Number of elements in line_info_table currently in use.   

Referenced by vmsdbgout_init(), vmsdbgout_write_source_line(), and write_pclines().

unsigned int module_language
static

Referenced by vmsdbgout_init(), and write_modbeg().

char* module_producer
static

Referenced by vmsdbgout_init(), and write_modbeg().

const char* primary_filename
static
Local pointer to the name of the main input file.  Initialized in
   vmsdbgout_init.   

Referenced by vmsdbgout_init(), and write_modbeg().

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.   

Referenced by vmsdbgout_init().

char* tryfile
static

Referenced by vms_file_stats_name().

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

Referenced by to_vms_file_spec().

struct gcc_debug_hooks vmsdbg_debug_hooks
The debug hooks structure.   

Referenced by process_options().