Another 3 debug hooks

Neil Booth neil@daikokuya.demon.co.uk
Sun Jul 22 04:35:00 GMT 2001


Richard Henderson wrote:-

> Stabs info shouldn't care what order these things are in so 
> long as they are present somewhere; I would think that sdb
> info would be the same.  To be sure, I tested the following
> patchlet vs the gdb testsuite on i686-linux and as I expected,
> no regressions.

This causes a segfault in dbxout_symbol when it is passed an
incomplete type.  I believe types are output only when complete by
rest_of_type_compilation() instead.

Your original idea is to transfer what was done in varasm.c to the
toplev.c loop.  So should we change

> +/* Debug information for a global DECL.  Called from toplev.c after
> +   compilation proper has finished.  */
> +static void
> +dbxout_global_decl (decl)
> +     tree decl;
> +{
> +  dbxout_symbol (decl, 0);
>  }

to be instead

  /* Output global variables only here.  */
  if (TREE_CODE (decl) == VAR_DECL)
    dbxout_symbol (decl, 0);

That's my best guess; I'm not particularly familiar with the way the
compiler works here (though becoming more so all the time!).  Do we
need a DECL_RTL_SET_P() too?

I think the code for sdb I posted is OK on this point, since it
already checked for VAR_DECL anyway.  Dwarf and Dwarf2 are OK as they
never used varasm.c in the first place.

Neil.



More information about the Gcc-patches mailing list