debug.h

Go to the documentation of this file.
00001 /* debug.h -- Describe generic debugging information.
00002    Copyright (C) 1995, 1996 Free Software Foundation, Inc.
00003    Written by Ian Lance Taylor <ian@cygnus.com>.
00004 
00005    This file is part of GNU Binutils.
00006 
00007    This program is free software; you can redistribute it and/or modify
00008    it under the terms of the GNU General Public License as published by
00009    the Free Software Foundation; either version 2 of the License, or
00010    (at your option) any later version.
00011 
00012    This program is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015    GNU General Public License for more details.
00016 
00017    You should have received a copy of the GNU General Public License
00018    along with this program; if not, write to the Free Software
00019    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00020    02111-1307, USA.  */
00021 
00022 #ifndef DEBUG_H
00023 #define DEBUG_H
00024 
00025 /* This header file describes a generic debugging information format.
00026    We may eventually have readers which convert different formats into
00027    this generic format, and writers which write it out.  The initial
00028    impetus for this was writing a convertor from stabs to HP IEEE-695
00029    debugging format.  */
00030 
00031 /* Different kinds of types.  */
00032 
00033 enum debug_type_kind
00034 {
00035   /* Not used.  */
00036   DEBUG_KIND_ILLEGAL,
00037   /* Indirect via a pointer.  */
00038   DEBUG_KIND_INDIRECT,
00039   /* Void.  */
00040   DEBUG_KIND_VOID,
00041   /* Integer.  */
00042   DEBUG_KIND_INT,
00043   /* Floating point.  */
00044   DEBUG_KIND_FLOAT,
00045   /* Complex.  */
00046   DEBUG_KIND_COMPLEX,
00047   /* Boolean.  */
00048   DEBUG_KIND_BOOL,
00049   /* Struct.  */
00050   DEBUG_KIND_STRUCT,
00051   /* Union.  */
00052   DEBUG_KIND_UNION,
00053   /* Class.  */
00054   DEBUG_KIND_CLASS,
00055   /* Union class (can this really happen?).  */
00056   DEBUG_KIND_UNION_CLASS,
00057   /* Enumeration type.  */
00058   DEBUG_KIND_ENUM,
00059   /* Pointer.  */
00060   DEBUG_KIND_POINTER,
00061   /* Function.  */
00062   DEBUG_KIND_FUNCTION,
00063   /* Reference.  */
00064   DEBUG_KIND_REFERENCE,
00065   /* Range.  */
00066   DEBUG_KIND_RANGE,
00067   /* Array.  */
00068   DEBUG_KIND_ARRAY,
00069   /* Set.  */
00070   DEBUG_KIND_SET,
00071   /* Based pointer.  */
00072   DEBUG_KIND_OFFSET,
00073   /* Method.  */
00074   DEBUG_KIND_METHOD,
00075   /* Const qualified type.  */
00076   DEBUG_KIND_CONST,
00077   /* Volatile qualified type.  */
00078   DEBUG_KIND_VOLATILE,
00079   /* Named type.  */
00080   DEBUG_KIND_NAMED,
00081   /* Tagged type.  */
00082   DEBUG_KIND_TAGGED
00083 };
00084 
00085 /* Different kinds of variables.  */
00086 
00087 enum debug_var_kind
00088 {
00089   /* Not used.  */
00090   DEBUG_VAR_ILLEGAL,
00091   /* A global variable.  */
00092   DEBUG_GLOBAL,
00093   /* A static variable.  */
00094   DEBUG_STATIC,
00095   /* A local static variable.  */
00096   DEBUG_LOCAL_STATIC,
00097   /* A local variable.  */
00098   DEBUG_LOCAL,
00099   /* A register variable.  */
00100   DEBUG_REGISTER
00101 };
00102 
00103 /* Different kinds of function parameters.  */
00104 
00105 enum debug_parm_kind
00106 {
00107   /* Not used.  */
00108   DEBUG_PARM_ILLEGAL,
00109   /* A stack based parameter.  */
00110   DEBUG_PARM_STACK,
00111   /* A register parameter.  */
00112   DEBUG_PARM_REG,
00113   /* A stack based reference parameter.  */
00114   DEBUG_PARM_REFERENCE,
00115   /* A register reference parameter.  */
00116   DEBUG_PARM_REF_REG
00117 };
00118 
00119 /* Different kinds of visibility.  */
00120 
00121 enum debug_visibility
00122 {
00123   /* A public field (e.g., a field in a C struct).  */
00124   DEBUG_VISIBILITY_PUBLIC,
00125   /* A protected field.  */
00126   DEBUG_VISIBILITY_PROTECTED,
00127   /* A private field.  */
00128   DEBUG_VISIBILITY_PRIVATE,
00129   /* A field which should be ignored.  */
00130   DEBUG_VISIBILITY_IGNORE
00131 };
00132 
00133 /* A type.  */
00134 
00135 typedef struct debug_type *debug_type;
00136 
00137 #define DEBUG_TYPE_NULL ((debug_type) NULL)
00138 
00139 /* A field in a struct or union.  */
00140 
00141 typedef struct debug_field *debug_field;
00142 
00143 #define DEBUG_FIELD_NULL ((debug_field) NULL)
00144 
00145 /* A base class for an object.  */
00146 
00147 typedef struct debug_baseclass *debug_baseclass;
00148 
00149 #define DEBUG_BASECLASS_NULL ((debug_baseclass) NULL)
00150 
00151 /* A method of an object.  */
00152 
00153 typedef struct debug_method *debug_method;
00154 
00155 #define DEBUG_METHOD_NULL ((debug_method) NULL)
00156 
00157 /* The arguments to a method function of an object.  These indicate
00158    which method to run.  */
00159 
00160 typedef struct debug_method_variant *debug_method_variant;
00161 
00162 #define DEBUG_METHOD_VARIANT_NULL ((debug_method_variant) NULL)
00163 
00164 /* This structure is passed to debug_write.  It holds function
00165    pointers that debug_write will call based on the accumulated
00166    debugging information.  */
00167 
00168 struct debug_write_fns
00169 {
00170   /* This is called at the start of each new compilation unit with the
00171      name of the main file in the new unit.  */
00172   boolean (*start_compilation_unit) PARAMS ((PTR, const char *));
00173 
00174   /* This is called at the start of each source file within a
00175      compilation unit, before outputting any global information for
00176      that file.  The argument is the name of the file.  */
00177   boolean (*start_source) PARAMS ((PTR, const char *));
00178 
00179   /* Each writer must keep a stack of types.  */
00180 
00181   /* Push an empty type onto the type stack.  This type can appear if
00182      there is a reference to a type which is never defined.  */
00183   boolean (*empty_type) PARAMS ((PTR));
00184 
00185   /* Push a void type onto the type stack.  */
00186   boolean (*void_type) PARAMS ((PTR));
00187 
00188   /* Push an integer type onto the type stack, given the size and
00189      whether it is unsigned.  */
00190   boolean (*int_type) PARAMS ((PTR, unsigned int, boolean));
00191 
00192   /* Push a floating type onto the type stack, given the size.  */
00193   boolean (*float_type) PARAMS ((PTR, unsigned int));
00194 
00195   /* Push a complex type onto the type stack, given the size.  */
00196   boolean (*complex_type) PARAMS ((PTR, unsigned int));
00197 
00198   /* Push a boolean type onto the type stack, given the size.  */
00199   boolean (*bool_type) PARAMS ((PTR, unsigned int));
00200 
00201   /* Push an enum type onto the type stack, given the tag, a NULL
00202      terminated array of names and the associated values.  If there is
00203      no tag, the tag argument will be NULL.  If this is an undefined
00204      enum, the names and values arguments will be NULL.  */
00205   boolean (*enum_type) PARAMS ((PTR, const char *, const char **,
00206                                 bfd_signed_vma *));
00207 
00208   /* Pop the top type on the type stack, and push a pointer to that
00209      type onto the type stack.  */
00210   boolean (*pointer_type) PARAMS ((PTR));
00211 
00212   /* Push a function type onto the type stack.  The second argument
00213      indicates the number of argument types that have been pushed onto
00214      the stack.  If the number of argument types is passed as -1, then
00215      the argument types of the function are unknown, and no types have
00216      been pushed onto the stack.  The third argument is true if the
00217      function takes a variable number of arguments.  The return type
00218      of the function is pushed onto the type stack below the argument
00219      types, if any.  */
00220   boolean (*function_type) PARAMS ((PTR, int, boolean));
00221 
00222   /* Pop the top type on the type stack, and push a reference to that
00223      type onto the type stack.  */
00224   boolean (*reference_type) PARAMS ((PTR));
00225 
00226   /* Pop the top type on the type stack, and push a range of that type
00227      with the given lower and upper bounds onto the type stack.  */
00228   boolean (*range_type) PARAMS ((PTR, bfd_signed_vma, bfd_signed_vma));
00229 
00230   /* Push an array type onto the type stack.  The top type on the type
00231      stack is the range, and the next type on the type stack is the
00232      element type.  These should be popped before the array type is
00233      pushed.  The arguments are the lower bound, the upper bound, and
00234      whether the array is a string.  */
00235   boolean (*array_type) PARAMS ((PTR, bfd_signed_vma, bfd_signed_vma,
00236                                  boolean));
00237 
00238   /* Pop the top type on the type stack, and push a set of that type
00239      onto the type stack.  The argument indicates whether this set is
00240      a bitstring.  */
00241   boolean (*set_type) PARAMS ((PTR, boolean));
00242 
00243   /* Push an offset type onto the type stack.  The top type on the
00244      type stack is the target type, and the next type on the type
00245      stack is the base type.  These should be popped before the offset
00246      type is pushed.  */
00247   boolean (*offset_type) PARAMS ((PTR));
00248 
00249   /* Push a method type onto the type stack.  If the second argument
00250      is true, the top type on the stack is the class to which the
00251      method belongs; otherwise, the class must be determined by the
00252      class to which the method is attached.  The third argument is the
00253      number of argument types; these are pushed onto the type stack in
00254      reverse order (the first type popped is the last argument to the
00255      method).  A value of -1 for the third argument means that no
00256      argument information is available.  The fourth argument is true
00257      if the function takes a variable number of arguments.  The next
00258      type on the type stack below the domain and the argument types is
00259      the return type of the method.  All these types must be popped,
00260      and then the method type must be pushed.  */
00261   boolean (*method_type) PARAMS ((PTR, boolean, int, boolean));
00262 
00263   /* Pop the top type off the type stack, and push a const qualified
00264      version of that type onto the type stack.  */
00265   boolean (*const_type) PARAMS ((PTR));
00266 
00267   /* Pop the top type off the type stack, and push a volatile
00268      qualified version of that type onto the type stack.  */
00269   boolean (*volatile_type) PARAMS ((PTR));
00270 
00271   /* Start building a struct.  This is followed by calls to the
00272      struct_field function, and finished by a call to the
00273      end_struct_type function.  The second argument is the tag; this
00274      will be NULL if there isn't one.  If the second argument is NULL,
00275      the third argument is a constant identifying this struct for use
00276      with tag_type.  The fourth argument is true for a struct, false
00277      for a union.  The fifth argument is the size.  If this is an
00278      undefined struct or union, the size will be 0 and struct_field
00279      will not be called before end_struct_type is called.  */
00280   boolean (*start_struct_type) PARAMS ((PTR, const char *, unsigned int,
00281                                         boolean, unsigned int));
00282 
00283   /* Add a field to the struct type currently being built.  The type
00284      of the field should be popped off the type stack.  The arguments
00285      are the name, the bit position, the bit size (may be zero if the
00286      field is not packed), and the visibility.  */
00287   boolean (*struct_field) PARAMS ((PTR, const char *, bfd_vma, bfd_vma,
00288                                    enum debug_visibility));
00289 
00290   /* Finish building a struct, and push it onto the type stack.  */
00291   boolean (*end_struct_type) PARAMS ((PTR));
00292 
00293   /* Start building a class.  This is followed by calls to several
00294      functions: struct_field, class_static_member, class_baseclass,
00295      class_start_method, class_method_variant,
00296      class_static_method_variant, and class_end_method.  The class is
00297      finished by a call to end_class_type.  The first five arguments
00298      are the same as for start_struct_type.  The sixth argument is
00299      true if there is a virtual function table; if there is, the
00300      seventh argument is true if the virtual function table can be
00301      found in the type itself, and is false if the type of the object
00302      holding the virtual function table should be popped from the type
00303      stack.  */
00304   boolean (*start_class_type) PARAMS ((PTR, const char *, unsigned int,
00305                                        boolean, unsigned int, boolean,
00306                                        boolean));
00307 
00308   /* Add a static member to the class currently being built.  The
00309      arguments are the field name, the physical name, and the
00310      visibility.  The type must be popped off the type stack.  */
00311   boolean (*class_static_member) PARAMS ((PTR, const char *, const char *,
00312                                           enum debug_visibility));
00313 
00314   /* Add a baseclass to the class currently being built.  The type of
00315      the baseclass must be popped off the type stack.  The arguments
00316      are the bit position, whether the class is virtual, and the
00317      visibility.  */
00318   boolean (*class_baseclass) PARAMS ((PTR, bfd_vma, boolean,
00319                                       enum debug_visibility));
00320 
00321   /* Start adding a method to the class currently being built.  This
00322      is followed by calls to class_method_variant and
00323      class_static_method_variant to describe different variants of the
00324      method which take different arguments.  The method is finished
00325      with a call to class_end_method.  The argument is the method
00326      name.  */
00327   boolean (*class_start_method) PARAMS ((PTR, const char *));
00328 
00329   /* Describe a variant to the class method currently being built.
00330      The type of the variant must be popped off the type stack.  The
00331      second argument is the physical name of the function.  The
00332      following arguments are the visibility, whether the variant is
00333      const, whether the variant is volatile, the offset in the virtual
00334      function table, and whether the context is on the type stack
00335      (below the variant type).  */
00336   boolean (*class_method_variant) PARAMS ((PTR, const char *,
00337                                            enum debug_visibility,
00338                                            boolean, boolean,
00339                                            bfd_vma, boolean));
00340 
00341   /* Describe a static variant to the class method currently being
00342      built.  The arguments are the same as for class_method_variant,
00343      except that the last two arguments are omitted.  The type of the
00344      variant must be popped off the type stack.  */
00345   boolean (*class_static_method_variant) PARAMS ((PTR, const char *,
00346                                                   enum debug_visibility,
00347                                                   boolean, boolean));
00348 
00349   /* Finish describing a class method.  */
00350   boolean (*class_end_method) PARAMS ((PTR));
00351 
00352   /* Finish describing a class, and push it onto the type stack.  */
00353   boolean (*end_class_type) PARAMS ((PTR));
00354 
00355   /* Push a type on the stack which was given a name by an earlier
00356      call to typdef.  */
00357   boolean (*typedef_type) PARAMS ((PTR, const char *));
00358 
00359   /* Push a tagged type on the stack which was defined earlier.  If
00360      the second argument is not NULL, the type was defined by a call
00361      to tag.  If the second argument is NULL, the type was defined by
00362      a call to start_struct_type or start_class_type with a tag of
00363      NULL and the number of the third argument.  Either way, the
00364      fourth argument is the tag kind.  Note that this may be called
00365      for a struct (class) being defined, in between the call to
00366      start_struct_type (start_class_type) and the call to
00367      end_struct_type (end_class_type).  */
00368   boolean (*tag_type) PARAMS ((PTR, const char *, unsigned int,
00369                                enum debug_type_kind));
00370 
00371   /* Pop the type stack, and typedef it to the given name.  */
00372   boolean (*typdef) PARAMS ((PTR, const char *));
00373 
00374   /* Pop the type stack, and declare it as a tagged struct or union or
00375      enum or whatever.  The tag passed down here is redundant, since
00376      was also passed when enum_type, start_struct_type, or
00377      start_class_type was called.  */
00378   boolean (*tag) PARAMS ((PTR, const char *));
00379 
00380   /* This is called to record a named integer constant.  */
00381   boolean (*int_constant) PARAMS ((PTR, const char *, bfd_vma));
00382 
00383   /* This is called to record a named floating point constant.  */
00384   boolean (*float_constant) PARAMS ((PTR, const char *, double));
00385 
00386   /* This is called to record a typed integer constant.  The type is
00387      popped off the type stack.  */
00388   boolean (*typed_constant) PARAMS ((PTR, const char *, bfd_vma));
00389 
00390   /* This is called to record a variable.  The type is popped off the
00391      type stack.  */
00392   boolean (*variable) PARAMS ((PTR, const char *, enum debug_var_kind,
00393                                bfd_vma));
00394 
00395   /* Start writing out a function.  The return type must be popped off
00396      the stack.  The boolean is true if the function is global.  This
00397      is followed by calls to function_parameter, followed by block
00398      information.  */
00399   boolean (*start_function) PARAMS ((PTR, const char *, boolean));
00400 
00401   /* Record a function parameter for the current function.  The type
00402      must be popped off the stack.  */
00403   boolean (*function_parameter) PARAMS ((PTR, const char *,
00404                                          enum debug_parm_kind, bfd_vma));
00405 
00406   /* Start writing out a block.  There is at least one top level block
00407      per function.  Blocks may be nested.  The argument is the
00408      starting address of the block.  */
00409   boolean (*start_block) PARAMS ((PTR, bfd_vma));
00410 
00411   /* Finish writing out a block.  The argument is the ending address
00412      of the block.  */
00413   boolean (*end_block) PARAMS ((PTR, bfd_vma));
00414 
00415   /* Finish writing out a function.  */
00416   boolean (*end_function) PARAMS ((PTR));
00417 
00418   /* Record line number information for the current compilation unit.  */
00419   boolean (*lineno) PARAMS ((PTR, const char *, unsigned long, bfd_vma));
00420 };
00421 
00422 /* Exported functions.  */
00423 
00424 /* The first argument to most of these functions is a handle.  This
00425    handle is returned by the debug_init function.  The purpose of the
00426    handle is to permit the debugging routines to not use static
00427    variables, and hence to be reentrant.  This would be useful for a
00428    program which wanted to handle two executables simultaneously.  */
00429 
00430 /* Return a debugging handle.  */
00431 
00432 extern PTR debug_init PARAMS ((void));
00433 
00434 /* Set the source filename.  This implicitly starts a new compilation
00435    unit.  */
00436 
00437 extern boolean debug_set_filename PARAMS ((PTR, const char *));
00438 
00439 /* Change source files to the given file name.  This is used for
00440    include files in a single compilation unit.  */
00441 
00442 extern boolean debug_start_source PARAMS ((PTR, const char *));
00443 
00444 /* Record a function definition.  This implicitly starts a function
00445    block.  The debug_type argument is the type of the return value.
00446    The boolean indicates whether the function is globally visible.
00447    The bfd_vma is the address of the start of the function.  Currently
00448    the parameter types are specified by calls to
00449    debug_record_parameter.  */
00450 
00451 extern boolean debug_record_function
00452   PARAMS ((PTR, const char *, debug_type, boolean, bfd_vma));
00453 
00454 /* Record a parameter for the current function.  */
00455 
00456 extern boolean debug_record_parameter
00457   PARAMS ((PTR, const char *, debug_type, enum debug_parm_kind, bfd_vma));
00458 
00459 /* End a function definition.  The argument is the address where the
00460    function ends.  */
00461 
00462 extern boolean debug_end_function PARAMS ((PTR, bfd_vma));
00463 
00464 /* Start a block in a function.  All local information will be
00465    recorded in this block, until the matching call to debug_end_block.
00466    debug_start_block and debug_end_block may be nested.  The argument
00467    is the address at which this block starts.  */
00468 
00469 extern boolean debug_start_block PARAMS ((PTR, bfd_vma));
00470 
00471 /* Finish a block in a function.  This matches the call to
00472    debug_start_block.  The argument is the address at which this block
00473    ends.  */
00474 
00475 extern boolean debug_end_block PARAMS ((PTR, bfd_vma));
00476 
00477 /* Associate a line number in the current source file with a given
00478    address.  */
00479 
00480 extern boolean debug_record_line PARAMS ((PTR, unsigned long, bfd_vma));
00481 
00482 /* Start a named common block.  This is a block of variables that may
00483    move in memory.  */
00484 
00485 extern boolean debug_start_common_block PARAMS ((PTR, const char *));
00486 
00487 /* End a named common block.  */
00488 
00489 extern boolean debug_end_common_block PARAMS ((PTR, const char *));
00490 
00491 /* Record a named integer constant.  */
00492 
00493 extern boolean debug_record_int_const PARAMS ((PTR, const char *, bfd_vma));
00494 
00495 /* Record a named floating point constant.  */
00496 
00497 extern boolean debug_record_float_const PARAMS ((PTR, const char *, double));
00498 
00499 /* Record a typed constant with an integral value.  */
00500 
00501 extern boolean debug_record_typed_const
00502   PARAMS ((PTR, const char *, debug_type, bfd_vma));
00503 
00504 /* Record a label.  */
00505 
00506 extern boolean debug_record_label
00507   PARAMS ((PTR, const char *, debug_type, bfd_vma));
00508 
00509 /* Record a variable.  */
00510 
00511 extern boolean debug_record_variable
00512   PARAMS ((PTR, const char *, debug_type, enum debug_var_kind, bfd_vma));
00513 
00514 /* Make an indirect type.  The first argument is a pointer to the
00515    location where the real type will be placed.  The second argument
00516    is the type tag, if there is one; this may be NULL; the only
00517    purpose of this argument is so that debug_get_type_name can return
00518    something useful.  This function may be used when a type is
00519    referenced before it is defined.  */
00520 
00521 extern debug_type debug_make_indirect_type
00522   PARAMS ((PTR, debug_type *, const char *));
00523 
00524 /* Make a void type.  */
00525 
00526 extern debug_type debug_make_void_type PARAMS ((PTR));
00527 
00528 /* Make an integer type of a given size.  The boolean argument is true
00529    if the integer is unsigned.  */
00530 
00531 extern debug_type debug_make_int_type PARAMS ((PTR, unsigned int, boolean));
00532 
00533 /* Make a floating point type of a given size.  FIXME: On some
00534    platforms, like an Alpha, you probably need to be able to specify
00535    the format.  */
00536 
00537 extern debug_type debug_make_float_type PARAMS ((PTR, unsigned int));
00538 
00539 /* Make a boolean type of a given size.  */
00540 
00541 extern debug_type debug_make_bool_type PARAMS ((PTR, unsigned int));
00542 
00543 /* Make a complex type of a given size.  */
00544 
00545 extern debug_type debug_make_complex_type PARAMS ((PTR, unsigned int));
00546 
00547 /* Make a structure type.  The second argument is true for a struct,
00548    false for a union.  The third argument is the size of the struct.
00549    The fourth argument is a NULL terminated array of fields.  */
00550 
00551 extern debug_type debug_make_struct_type
00552   PARAMS ((PTR, boolean, bfd_vma, debug_field *));
00553 
00554 /* Make an object type.  The first three arguments after the handle
00555    are the same as for debug_make_struct_type.  The next arguments are
00556    a NULL terminated array of base classes, a NULL terminated array of
00557    methods, the type of the object holding the virtual function table
00558    if it is not this object, and a boolean which is true if this
00559    object has its own virtual function table.  */
00560 
00561 extern debug_type debug_make_object_type
00562   PARAMS ((PTR, boolean, bfd_vma, debug_field *, debug_baseclass *,
00563            debug_method *, debug_type, boolean));
00564 
00565 /* Make an enumeration type.  The arguments are a null terminated
00566    array of strings, and an array of corresponding values.  */
00567 
00568 extern debug_type debug_make_enum_type
00569   PARAMS ((PTR, const char **, bfd_signed_vma *));
00570 
00571 /* Make a pointer to a given type.  */
00572 
00573 extern debug_type debug_make_pointer_type
00574   PARAMS ((PTR, debug_type));
00575 
00576 /* Make a function type.  The second argument is the return type.  The
00577    third argument is a NULL terminated array of argument types.  The
00578    fourth argument is true if the function takes a variable number of
00579    arguments.  If the third argument is NULL, then the argument types
00580    are unknown.  */
00581 
00582 extern debug_type debug_make_function_type
00583   PARAMS ((PTR, debug_type, debug_type *, boolean));
00584 
00585 /* Make a reference to a given type.  */
00586 
00587 extern debug_type debug_make_reference_type PARAMS ((PTR, debug_type));
00588 
00589 /* Make a range of a given type from a lower to an upper bound.  */
00590 
00591 extern debug_type debug_make_range_type
00592   PARAMS ((PTR, debug_type, bfd_signed_vma, bfd_signed_vma));
00593 
00594 /* Make an array type.  The second argument is the type of an element
00595    of the array.  The third argument is the type of a range of the
00596    array.  The fourth and fifth argument are the lower and upper
00597    bounds, respectively (if the bounds are not known, lower should be
00598    0 and upper should be -1).  The sixth argument is true if this
00599    array is actually a string, as in C.  */
00600 
00601 extern debug_type debug_make_array_type
00602   PARAMS ((PTR, debug_type, debug_type, bfd_signed_vma, bfd_signed_vma,
00603            boolean));
00604 
00605 /* Make a set of a given type.  For example, a Pascal set type.  The
00606    boolean argument is true if this set is actually a bitstring, as in
00607    CHILL.  */
00608 
00609 extern debug_type debug_make_set_type PARAMS ((PTR, debug_type, boolean));
00610 
00611 /* Make a type for a pointer which is relative to an object.  The
00612    second argument is the type of the object to which the pointer is
00613    relative.  The third argument is the type that the pointer points
00614    to.  */
00615 
00616 extern debug_type debug_make_offset_type
00617   PARAMS ((PTR, debug_type, debug_type));
00618 
00619 /* Make a type for a method function.  The second argument is the
00620    return type.  The third argument is the domain.  The fourth
00621    argument is a NULL terminated array of argument types.  The fifth
00622    argument is true if the function takes a variable number of
00623    arguments, in which case the array of argument types indicates the
00624    types of the first arguments.  The domain and the argument array
00625    may be NULL, in which case this is a stub method and that
00626    information is not available.  Stabs debugging uses this, and gets
00627    the argument types from the mangled name.  */
00628 
00629 extern debug_type debug_make_method_type
00630   PARAMS ((PTR, debug_type, debug_type, debug_type *, boolean));
00631 
00632 /* Make a const qualified version of a given type.  */
00633 
00634 extern debug_type debug_make_const_type PARAMS ((PTR, debug_type));
00635 
00636 /* Make a volatile qualified version of a given type.  */
00637 
00638 extern debug_type debug_make_volatile_type PARAMS ((PTR, debug_type));
00639 
00640 /* Make an undefined tagged type.  For example, a struct which has
00641    been mentioned, but not defined.  */
00642 
00643 extern debug_type debug_make_undefined_tagged_type
00644   PARAMS ((PTR, const char *, enum debug_type_kind));
00645 
00646 /* Make a base class for an object.  The second argument is the base
00647    class type.  The third argument is the bit position of this base
00648    class in the object.  The fourth argument is whether this is a
00649    virtual class.  The fifth argument is the visibility of the base
00650    class.  */
00651 
00652 extern debug_baseclass debug_make_baseclass
00653   PARAMS ((PTR, debug_type, bfd_vma, boolean, enum debug_visibility));
00654 
00655 /* Make a field for a struct.  The second argument is the name.  The
00656    third argument is the type of the field.  The fourth argument is
00657    the bit position of the field.  The fifth argument is the size of
00658    the field (it may be zero).  The sixth argument is the visibility
00659    of the field.  */
00660 
00661 extern debug_field debug_make_field
00662   PARAMS ((PTR, const char *, debug_type, bfd_vma, bfd_vma,
00663            enum debug_visibility));
00664 
00665 /* Make a static member of an object.  The second argument is the
00666    name.  The third argument is the type of the member.  The fourth
00667    argument is the physical name of the member (i.e., the name as a
00668    global variable).  The fifth argument is the visibility of the
00669    member.  */
00670 
00671 extern debug_field debug_make_static_member
00672   PARAMS ((PTR, const char *, debug_type, const char *,
00673            enum debug_visibility));
00674 
00675 /* Make a method.  The second argument is the name, and the third
00676    argument is a NULL terminated array of method variants.  Each
00677    method variant is a method with this name but with different
00678    argument types.  */
00679 
00680 extern debug_method debug_make_method
00681   PARAMS ((PTR, const char *, debug_method_variant *));
00682 
00683 /* Make a method variant.  The second argument is the physical name of
00684    the function.  The third argument is the type of the function,
00685    probably constructed by debug_make_method_type.  The fourth
00686    argument is the visibility.  The fifth argument is whether this is
00687    a const function.  The sixth argument is whether this is a volatile
00688    function.  The seventh argument is the index in the virtual
00689    function table, if any.  The eighth argument is the virtual
00690    function context.  */
00691 
00692 extern debug_method_variant debug_make_method_variant
00693   PARAMS ((PTR, const char *, debug_type, enum debug_visibility, boolean,
00694            boolean, bfd_vma, debug_type));
00695 
00696 /* Make a static method argument.  The arguments are the same as for
00697    debug_make_method_variant, except that the last two are omitted
00698    since a static method can not also be virtual.  */
00699 
00700 extern debug_method_variant debug_make_static_method_variant
00701   PARAMS ((PTR, const char *, debug_type, enum debug_visibility, boolean,
00702            boolean));
00703 
00704 /* Name a type.  This returns a new type with an attached name.  */
00705 
00706 extern debug_type debug_name_type PARAMS ((PTR, const char *, debug_type));
00707 
00708 /* Give a tag to a type, such as a struct or union.  This returns a
00709    new type with an attached tag.  */
00710 
00711 extern debug_type debug_tag_type PARAMS ((PTR, const char *, debug_type));
00712 
00713 /* Record the size of a given type.  */
00714 
00715 extern boolean debug_record_type_size PARAMS ((PTR, debug_type, unsigned int));
00716 
00717 /* Find a named type.  */
00718 
00719 extern debug_type debug_find_named_type PARAMS ((PTR, const char *));
00720 
00721 /* Find a tagged type.  */
00722 
00723 extern debug_type debug_find_tagged_type
00724   PARAMS ((PTR, const char *, enum debug_type_kind));
00725 
00726 /* Get the kind of a type.  */
00727 
00728 extern enum debug_type_kind debug_get_type_kind PARAMS ((PTR, debug_type));
00729 
00730 /* Get the name of a type.  */
00731 
00732 extern const char *debug_get_type_name PARAMS ((PTR, debug_type));
00733 
00734 /* Get the size of a type.  */
00735 
00736 extern bfd_vma debug_get_type_size PARAMS ((PTR, debug_type));
00737 
00738 /* Get the return type of a function or method type.  */
00739 
00740 extern debug_type debug_get_return_type PARAMS ((PTR, debug_type));
00741 
00742 /* Get the NULL terminated array of parameter types for a function or
00743    method type (actually, parameter types are not currently stored for
00744    function types).  This may be used to determine whether a method
00745    type is a stub method or not.  The last argument points to a
00746    boolean which is set to true if the function takes a variable
00747    number of arguments.  */
00748 
00749 extern const debug_type *debug_get_parameter_types PARAMS ((PTR,
00750                                                             debug_type,
00751                                                             boolean *));
00752 
00753 /* Get the target type of a pointer or reference or const or volatile
00754    type.  */
00755 
00756 extern debug_type debug_get_target_type PARAMS ((PTR, debug_type));
00757 
00758 /* Get the NULL terminated array of fields for a struct, union, or
00759    class.  */
00760 
00761 extern const debug_field *debug_get_fields PARAMS ((PTR, debug_type));
00762 
00763 /* Get the type of a field.  */
00764 
00765 extern debug_type debug_get_field_type PARAMS ((PTR, debug_field));
00766 
00767 /* Get the name of a field.  */
00768 
00769 extern const char *debug_get_field_name PARAMS ((PTR, debug_field));
00770 
00771 /* Get the bit position of a field within the containing structure.
00772    If the field is a static member, this will return (bfd_vma) -1.  */
00773 
00774 extern bfd_vma debug_get_field_bitpos PARAMS ((PTR, debug_field));
00775 
00776 /* Get the bit size of a field.  If the field is a static member, this
00777    will return (bfd_vma) -1.  */
00778 
00779 extern bfd_vma debug_get_field_bitsize PARAMS ((PTR, debug_field));
00780 
00781 /* Get the visibility of a field.  */
00782 
00783 extern enum debug_visibility debug_get_field_visibility
00784   PARAMS ((PTR, debug_field));
00785 
00786 /* Get the physical name of a field, if it is a static member.  If the
00787    field is not a static member, this will return NULL.  */
00788 
00789 extern const char *debug_get_field_physname PARAMS ((PTR, debug_field));
00790 
00791 /* Write out the recorded debugging information.  This takes a set of
00792    function pointers which are called to do the actual writing.  The
00793    first PTR is the debugging handle.  The second PTR is a handle
00794    which is passed to the functions.  */
00795 
00796 extern boolean debug_write PARAMS ((PTR, const struct debug_write_fns *, PTR));
00797 
00798 #endif /* DEBUG_H */

Generated on Thu Feb 24 10:22:30 2005 for MySQL by  doxygen 1.3.9.1