>> This patch adds a new option, -gmlt, that produces level 1 debug info
>> plus line number tables and inlined subroutine information. (The option
>> is short for "minimum line tables," taken from a similar feature of
>> HP's compilers.)
>
> What is the difference between -gmlt and -g1?  And why can't this just
> be enabled for -g1?

With -g1, you don't get line number tables or any inlined subroutine
information. Here's the description of -g1 in the docs:

"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."

I considered just changing -g1 to do this, with the argument that
"enough for making backtraces" ought to include line numbers and
inlined function calls, but I wasn't familiar enough with existing
uses of -g1 to go with that alternative. I'm certainly willing to go
that route, though, if that's preferable.

If we do go with extending -g1, though. we want to be able to turn it
on in our build scripts, yet allow a later "-g" option in the user's
compiler options to enable full debug info. In this patch, I've made
sure that "-gmlt -g" is equivalent to "-g2", whereas "-g1 -g" is the
same as "-g1" by itself. (It's too much to train people to use "-g2"
instead of "-g" when they want full debug.)

-cary

Reply via email to