[PATCH] Emit DWARF info for all code section in an assembly file

Oliver Stannard oliver.stannard at arm.com
Wed Feb 5 02:56:02 PST 2014


Review on Phabricator: http://llvm-reviews.chandlerc.com/D2697

Oliver

-----Original Message-----
From: llvm-commits-bounces at cs.uiuc.edu
[mailto:llvm-commits-bounces at cs.uiuc.edu] On Behalf Of Keith Walker
Sent: 05 February 2014 09:59
To: 'Eric Christopher'; Adrian Prantl
Cc: llvm-commits at cs.uiuc.edu
Subject: RE: [PATCH] Emit DWARF info for all code section in an assembly
file



> -----Original Message-----
> From: llvm-commits-bounces at cs.uiuc.edu [mailto:llvm-commits-
> 
> On Tue, Feb 4, 2014 at 10:26 AM, Adrian Prantl <aprantl at apple.com>
> wrote:
> > Hi Oliver,
> >
> > generally, Doxygen comments for the new functions never hurt.
> >
> > One question:
> > It looks like we're hardcoding a version here:
> >
> > -  // The 2 byte DWARF version, which is 2.
> > -  MCOS->EmitIntValue(2, 2);
> > +  // The 2 byte DWARF version, which is 3.
> > +  MCOS->EmitIntValue(3, 2);
> >
> > Shouldn't this be somehow derived from the version attribute in the
> module?
> > E.g., clang -gdwarf-2 will result in a Module attribute like
> >
> >   !0 = metadata !{i32 2, metadata !"Dwarf Version", i32 2},
> >
> > and then for example, we should never emit anything that needs Dwarf3
> features.
> 
> No metadata in an assembly file :)
> 
> That said it should be controlled by command line option if you don't
> mind Oliver. -gdwarf-N.

This change uses the .debug_ranges section, which was introduced in DWARF-3,
in order to describe the situation when code for a compilation unit
(assembler file) is split into non-contiguous address ranges (sections
containing instructions).

Therefore this approach does not work for DWARF-2 which doesn't support
.debug_ranges.

I see 3 possible options:

1.   Produce an warning or error if using -gdwarf-2 and there are
non-contiguous address ranges being produced.
2.   Rather than using .debug_ranges, produce multiple compilation unit
entries each one describing the code for a separate section.
3.   Just don't support -gdwarf-2 at all ... does anyone know if there are
any toolchains which require DWARF-2 that need to be supported?

Keith




_______________________________________________
llvm-commits mailing list
llvm-commits at cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits







More information about the llvm-commits mailing list