GCC Middle and Back End API Reference
dbxout.c File Reference
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
#include "tree.h"
#include "rtl.h"
#include "flags.h"
#include "regs.h"
#include "insn-config.h"
#include "reload.h"
#include "output.h"
#include "dbxout.h"
#include "diagnostic-core.h"
#include "toplev.h"
#include "tm_p.h"
#include "ggc.h"
#include "debug.h"
#include "function.h"
#include "target.h"
#include "common/common-target.h"
#include "langhooks.h"
#include "obstack.h"
#include "expr.h"
#include "cgraph.h"
#include "gt-dbxout.h"
Include dependency graph for dbxout.c:

Data Structures

struct  typeinfo
struct  dbx_file

Macros

#define ASM_STABS_OP   "\t.stabs\t"
#define ASM_STABN_OP   "\t.stabn\t"
#define ASM_STABD_OP   "\t.stabd\t"
#define DBX_TYPE_DECL_STABS_CODE   N_LSYM
#define DBX_STATIC_CONST_VAR_CODE   N_FUN
#define DBX_REGPARM_STABS_CODE   N_RSYM
#define DBX_REGPARM_STABS_LETTER   'P'
#define NO_DBX_FUNCTION_END   0
#define NO_DBX_BNSYM_ENSYM   0
#define NO_DBX_MAIN_SOURCE_DIRECTORY   0
#define DBX_BLOCKS_FUNCTION_RELATIVE   0
#define DBX_LINES_FUNCTION_RELATIVE   0
#define DBX_CONTIN_LENGTH   80
#define DBX_CONTIN_CHAR   '\\'

Enumerations

enum  typestatus { TYPE_UNSEEN, TYPE_XREF, TYPE_DEFINED }
enum  binclstatus { BINCL_NOT_REQUIRED, BINCL_PENDING, BINCL_PROCESSED }

Functions

void default_stabs_asm_out_destructor (rtx symbol, int priority)
void default_stabs_asm_out_constructor (rtx symbol, int priority)

Variables

static struct typeinfotypevec
static int typevec_len
static int next_type_number
static tree preinit_symbols
static int next_file_number
static int scope_labelno
static int dbxout_source_line_counter
static int source_label_number = 1
static const char * lastfile
static int lastfile_is_base

Macro Definition Documentation

#define ASM_STABD_OP   "\t.stabd\t"
#define ASM_STABN_OP   "\t.stabn\t"
#define ASM_STABS_OP   "\t.stabs\t"

Output dbx-format symbol table information from GNU compiler. Copyright (C) 1987-2013 Free Software Foundation, Inc.

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/. Output dbx-format symbol table data. This consists of many symbol table entries, each of them a .stabs assembler pseudo-op with four operands: a "name" which is really a description of one symbol and its type, a "code", which is a symbol defined in stab.h whose name starts with N_, an unused operand always 0, and a "value" which is an address or an offset. The name is enclosed in doublequote characters.

Each function, variable, typedef, and structure tag has a symbol table entry to define it. The beginning and end of each level of name scoping within a function are also marked by special symbol table entries.

The "name" consists of the symbol name, a colon, a kind-of-symbol letter, and a data type number. The data type number may be followed by "=" and a type definition; normally this will happen the first time the type number is mentioned. The type definition may refer to other types by number, and those type numbers may be followed by "=" and nested definitions.

This can make the "name" quite long. When a name is more than 80 characters, we split the .stabs pseudo-op into two .stabs pseudo-ops, both sharing the same "code" and "value". The first one is marked as continued with a double-backslash at the end of its "name".

The kind-of-symbol letter distinguished function names from global variables from file-scope variables from parameters from auto variables in memory from typedef names from register variables. See `dbxout_symbol'.

The "code" is mostly redundant with the kind-of-symbol letter that goes in the "name", but not entirely: for symbols located in static storage, the "code" says which segment the address is in, which controls how it is relocated.

The "value" for a symbol in static storage is the core address of the symbol (actually, the assembler label for the symbol). For a symbol located in a stack slot it is the stack offset; for one in a register, the register number. For a typedef symbol, it is zero.

If DEBUG_SYMS_TEXT is defined, all debugging symbols must be output while in the text section.

For more on data type definitions, see `dbxout_type'.

#define DBX_BLOCKS_FUNCTION_RELATIVE   0
#define DBX_CONTIN_CHAR   '\\'
#define DBX_CONTIN_LENGTH   80
#define DBX_LINES_FUNCTION_RELATIVE   0
#define DBX_REGPARM_STABS_CODE   N_RSYM
#define DBX_REGPARM_STABS_LETTER   'P'
#define DBX_STATIC_CONST_VAR_CODE   N_FUN
#define DBX_TYPE_DECL_STABS_CODE   N_LSYM
#define NO_DBX_BNSYM_ENSYM   0
#define NO_DBX_FUNCTION_END   0
#define NO_DBX_MAIN_SOURCE_DIRECTORY   0

Enumeration Type Documentation

Enumerator:
BINCL_NOT_REQUIRED 
BINCL_PENDING 
BINCL_PROCESSED 
enum typestatus
Enumerator:
TYPE_UNSEEN 
TYPE_XREF 
TYPE_DEFINED 

Function Documentation

void default_stabs_asm_out_constructor ( rtx  symbol,
int  priority 
)

Likewise for global constructors.

void default_stabs_asm_out_destructor ( rtx  symbol,
int  priority 
)

Typical USG systems don't have stab.h, and they also have no use for DBX-format debugging info. Record an element in the table of global destructors. SYMBOL is a SYMBOL_REF of the function to be called; PRIORITY is a number between 0 and MAX_INIT_PRIORITY.


Variable Documentation

int dbxout_source_line_counter
static

A counter for dbxout_source_line.

const char* lastfile
static

Last source file name mentioned in a NOTE insn.

int lastfile_is_base
static

Used by PCH machinery to detect if 'lastfile' should be reset to base_input_file.

int next_file_number
static

This is the top of the stack.

This is not saved for PCH, because restoring a PCH should not change it. next_file_number does have to be saved, because the PCH may use some file numbers; however, just before restoring a PCH, next_file_number should always be 0 because we should not have needed any file numbers yet. This is the next file number to use.

int next_type_number
static

In dbx output, each type gets a unique number. This is the number for the next type output. The number, once assigned, is in the TYPE_SYMTAB_ADDRESS field.

tree preinit_symbols
static

The C front end may call dbxout_symbol before dbxout_init runs. We save all such decls in this list and output them when we get to dbxout_init.

int scope_labelno
static

A counter for dbxout_function_end.

int source_label_number = 1
static

Number for the next N_SOL filename stabs label. The number 0 is reserved for the N_SO filename stabs label.

struct typeinfo* typevec
static

Vector recording information about C data types. When we first notice a data type (a tree node), we assign it a number using next_type_number. That is its index in this vector.

int typevec_len
static

Number of elements of space allocated in `typevec'.