This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: RFA: abstract C++ ABI dependencies

    From: Jim Blandy <>
    Date: Tue, 24 Apr 2001 12:30:19 -0500 (EST)

    I'd like approval for these changes from the following people:

    - David Taylor (c-typeprint.c, c-valprint.c, eval.c, gdbtypes.c,
      typeprint.c, valops.c, value.h, values.c, valops.c)

    - Anthony Green (jv-typeprint.c)

cp-abi.h -- includes defs.h and value.h; this is contrary to the value
of the macro definition of cp_abi_h in

While I dislike having include files include other include files and I
don't wish to reopen that debate, I must ask -- why does cp-abi.h
include defs.h?

Every .c file linked in to gdb includes defs.h already (usually as
it's first include) or includes none of the gdb include files (e.g.,

So, why does cp-abi.h need to include defs.h explicitly?  Any *.c that
needs it should already be including it.

    2001-04-24  Jim Blandy  <>

	    (Changes from Daniel Berlin, with revisions by Jim Blandy.)

	    Abstract out operations specific to particular C++ ABI's, and
	    invoke them through a function table.  This removes the C++ ABI
	    dependencies scattered throughout the code, and allows us to
	    cleanly add support for new C++ ABI's.

	    * cp-abi.h, cp-abi.h, gnu-v2-abi.c, hpacc-abi.c: New files.

*NONE* of these files initialize the rtti_type field within the
cp_abi_ops structure; they all let it default to 0.

	    * c-typeprint.c, c-valprint.c, dbxread.c, eval.c, gdbtypes.c,
	    jv-typeprint.c, linespec.c, symtab.c, typeprint.c, valops.c:
	    #include "cp-abi.h".

For c-valprint.c, eval.c, typeprint.c, and valops.c, it is unclear to
me why you are including cp-abi.h.

	    Deleted.  These services are now provided by functions declared in
	    * value.h (value_rtti_type, value_virtual_fn_field): Same.
	    * values.c (value_virtual_fn_field): Same, for this definition.
	    * valops.c (value_rtti_type): Same.	
	    * c-typeprint.c (c_type_print_base): Use the functions from
	    "cp-abi.h", instead of the old macros, or hard-coded ABI-specific
	    * dbxread.c (record_minimal_symbol): Same.
	    * gdbtypes.c (get_destructor_fn_field, virtual_base_index,
	    virtual_base_index_skip_primaries): Same.
	    * jv-typeprint.c (java_type_print_base): Same.
	    * linespec.c (find_methods, decode_line_1): Same.
	    * symtab.c (gdb_mangle_name): Same.

	    * (SFILES): Add the new .c files mentioned above.
	    (cp_abi_h): New variable.

Your definition of cp_abi_h is simply cp-abi.h -- however, cp-abi.h
includes other header files -- OOPS!

	    (COMMON_OBS): Add gnu-v2-abi.o, hpacc-abi.o, and cp-abi.o.
	    (cp-abi.o, gnu-v2-abi.o, hpacc-abi.o): New targets.
	    (c-typeprint.o, c-valprint.o, dbxread.o, eval.o, gdbtypes.o,
	    jv-typeprint.o, symtab.o, linespec.o, typeprint.o, valops.o):
	    Add dependency on $(cp_abi_h).

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]