www.delorie.com/gnu/docs/gcc/gccint_158.html   search  
 
Buy the book!


GNU Compiler Collection (GCC) Internals

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10.21.3 Open-Ended Hooks for DBX Format

These are hooks for DBX format.

DBX_OUTPUT_LBRAC (stream, name)
Define this macro to say how to output to stream the debugging information for the start of a scope level for variable names. The argument name is the name of an assembler symbol (for use with assemble_name) whose value is the address where the scope begins.

DBX_OUTPUT_RBRAC (stream, name)
Like DBX_OUTPUT_LBRAC, but for the end of a scope level.

DBX_OUTPUT_NFUN (stream, lscope_label, decl)
Define this macro if the target machine requires special handling to output an N_FUN entry for the function decl.

DBX_OUTPUT_ENUM (stream, type)
Define this macro if the target machine requires special handling to output an enumeration type. The definition should be a C statement (sans semicolon) to output the appropriate information to stream for the type type.

DBX_OUTPUT_FUNCTION_END (stream, function)
Define this macro if the target machine requires special output at the end of the debugging information for a function. The definition should be a C statement (sans semicolon) to output the appropriate information to stream. function is the FUNCTION_DECL node for the function.

DBX_OUTPUT_STANDARD_TYPES (syms)
Define this macro if you need to control the order of output of the standard data types at the beginning of compilation. The argument syms is a tree which is a chain of all the predefined global symbols, including names of data types.

Normally, DBX output starts with definitions of the types for integers and characters, followed by all the other predefined types of the particular language in no particular order.

On some machines, it is necessary to output different particular types first. To do this, define DBX_OUTPUT_STANDARD_TYPES to output those symbols in the necessary order. Any predefined types that you don't explicitly output will be output afterward in no particular order.

Be careful not to define this macro so that it works only for C. There are no global variables to access most of the built-in types, because another language may have another set of types. The way to output a particular type is to look through syms to see if you can find it. Here is an example:

 
{
  tree decl;
  for (decl = syms; decl; decl = TREE_CHAIN (decl))
    if (!strcmp (IDENTIFIER_POINTER (DECL_NAME (decl)),
                 "long int"))
      dbxout_symbol (decl);
  ...
}

This does nothing if the expected type does not exist.

See the function init_decl_processing in `c-decl.c' to find the names to use for all the built-in C types.

Here is another way of finding a particular type:

 
{
  tree decl;
  for (decl = syms; decl; decl = TREE_CHAIN (decl))
    if (TREE_CODE (decl) == TYPE_DECL
        && (TREE_CODE (TREE_TYPE (decl))
            == INTEGER_CST)
        && TYPE_PRECISION (TREE_TYPE (decl)) == 16
        && TYPE_UNSIGNED (TREE_TYPE (decl)))
      /* This must be unsigned short.  */
      dbxout_symbol (decl);
  ...
}

NO_DBX_FUNCTION_END
Some stabs encapsulation formats (in particular ECOFF), cannot handle the .stabs "",N_FUN,,0,0,Lscope-function-1 gdb dbx extension construct. On those machines, define this macro to turn this feature off without disturbing the rest of the gdb extensions.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003