Re: [RFC/RFA] Deal with -g1 generated DWARF2 debug info

Jim Blandy
2005-12-04T22:00:26Z

On 12/4/05, Daniel Jacobowitz <drow@false.org> wrote:
> I don't see why we care what the prototype for malloc in the debugging
> information is. We know the type of malloc. A system which uses a
> different type for malloc won't work here anyway.

You mean, just ignore malloc's type altogether, and unconditionally
construct our own type?

I'd prefer that over Mark's patch, but this isn't great. If malloc
has a bogus type, I think we should at least complain. On
free-standing systems that might be real information.

The central issue here is that the compiler is emitting incorrect
debug info. The GCC manual says of -g1:

Level 1 produces minimal information, enough for making backtraces
in parts of the program that you don't plan to debug. This
includes descriptions of functions and external variables, but no
information about local variables and no line numbers.

Nothing there about reducing all return types to 'void'.