[cfe-dev] Should -g1 mean -gline-tables-only?
David Blaikie
dblaikie at gmail.com
Fri Oct 17 11:39:15 PDT 2014
On Fri, Oct 17, 2014 at 11:32 AM, Hal Finkel <hfinkel at anl.gov> wrote:
> ----- Original Message -----
> > From: "David Blaikie" <dblaikie at gmail.com>
> > To: "Hal Finkel" <hfinkel at anl.gov>
> > Cc: "cfe-dev at cs.uiuc.edu Developers" <cfe-dev at cs.uiuc.edu>, "Eric
> Christopher" <echristo at google.com>
> > Sent: Friday, October 17, 2014 12:49:09 PM
> > Subject: Re: Should -g1 mean -gline-tables-only?
> >
> > On Fri, Oct 17, 2014 at 10:37 AM, Hal Finkel < hfinkel at anl.gov >
> > wrote:
> >
> >
> > Hi,
> >
> > Debugging flags are not my area of expertise, but GCC's manual says
> > about -g1:
> >
> > [from GCC's man page]
> > 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.
> >
> >
> >
> > Sounds similar, apart from the "and external variables" part.
> >
> > It'd be interesting to actually look at the output - I Suspect it
> > might be a bit more verbose than Clang's (or GCC's) -gmlt, maybe
> > including namespaces, mangled function names, whatever else.
> >
> > I think maybe Google's GCC branch has -gmlt, but maybe it's not in
> > GCC proper? I don't really know/understand.
> >
> >
> > [end from GCC's man page]
> >
> > and IBM's manual for xlc says about -g1:
> >
> > [from IBM's man page]
> > Generates minimal read-only debugging information about line numbers
> > and source file names. No program state is preserved.
> >
> >
> > Sounds about right. Be interesting to know if that's just the line
> > table itself, or the inlining info that Clang's
> > -gmlt/-gline-tables-only produces as well (yeah, -gline-tables-only
> > is a bit of a half truth).
>
> How could I tell? (I believe we have some kind of dwarf-dumping utility,
> but I don't know for what to look).
>
llvm-dwarfdump is a utility for dumping DWARF debug information. Running it
on an object file built with xlc's -g1 and see if there are many DW_TAGs in
the debug_info section (ones describing each function, etc). If the only
thing of note is the line table (debug_line section) then it's probably not
producing the inlining info that we do in -gmlt. *shrug*
Anyway, it sounds like xlc's -g1 might be a bit less than Clang's -gmlt and
GCC's -g1 might be a bit more than Clang's -gmlt. So if those are both
valid interpretations of -g1, Clang's -gmlt should fit right in ;)
- David
>
> Thanks again,
> Hal
>
> >
> >
> > [end from IBM's man page]
> >
> > this sounds to me a lot like what -gline-tables-only does. Is there a
> > reason we don't alias -g1 to -gline-tables-only? Currently, the code
> > in Clang::ConstructJob treats it just like -g.
> >
> > Thanks again,
> > Hal
> >
> > --
> > Hal Finkel
> > Assistant Computational Scientist
> > Leadership Computing Facility
> > Argonne National Laboratory
> >
> >
>
> --
> Hal Finkel
> Assistant Computational Scientist
> Leadership Computing Facility
> Argonne National Laboratory
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20141017/8297f865/attachment.html>
More information about the cfe-dev
mailing list