Commit Graph

625 Commits

Author SHA1 Message Date
Manman Ren
456e5e5521 Debug Info: In DIBuilder, the context field of a DICompositeType is updated
to use DIScopeRef.

A paired commit at clang is required due to changes to DIBuilder.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192256 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-09 00:17:04 +00:00
Manman Ren
b6f74f0668 Debug Info: In DIBuilder, the context fields of a static member and a
typedef are updated to use DIScopeRef.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192254 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-08 23:49:38 +00:00
Manman Ren
c1e2b2582c Debug Info: In DIBuilder, the derived-from field of DICompositeType
is updated to use DITypeRef.

A paired commit at clang is required due to changes to DIBuilder.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192251 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-08 23:28:51 +00:00
Manman Ren
78c2f9b8cf Debug Info: In DIBuilder, the derived-from field of DIDerivedType
is updated to use DITypeRef.

A paired commit at clang is required due to changes to DIBuilder.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192246 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-08 22:56:31 +00:00
Manman Ren
875857953f Debug Info: update testing to reflect r192018.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192224 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-08 20:06:43 +00:00
Adrian Prantl
d79f6f786a typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192158 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-08 02:30:54 +00:00
Adrian Prantl
a204ac9e90 typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192157 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-08 02:28:20 +00:00
Adrian Prantl
82c7414448 Reduce testcase from 1r92011.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192156 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-08 02:21:44 +00:00
Adrian Prantl
eacbfd1d51 Debug info: Don't crash in SelectionDAGISel when a vreg that is being
pointed to by a dbg_value belonging to a function argument is eliminated
during instruction selection.
rdar://problem/15094721.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192011 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-05 00:08:27 +00:00
Eric Christopher
371d95851a Use addFlag to add the enum class attribute.
This has the side effect of using DW_FORM_flag_present on dwarf4 and above.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191991 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-04 22:40:10 +00:00
Rafael Espindola
47e1c700bf Fix this test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191958 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-04 14:53:58 +00:00
David Blaikie
c32f2332b0 DebugInfo: Fix ordering of members after r191928
In the case (shown in the attached test) where a member function
definition was emitted into debug info the following could occur:

1) build the debug info for the member function definition
2) in (1), build the debug info for the member function declaration
3) construct and add the member function declaration DIE
4) add it to its context
5) build its context (the type it is a member of)
6) construct the members and add them to the type
7) except don't add member functions because "getOrCreateSubprogram"
adds the function to its parent anyway
8) except we're only partway through building this subprogram
declaration so it hasn't been added yet - but we returned the partially
constructed DIE (since it's already in the MDNode->DIE mapping to avoid
infinitely recursing trying to create the member function DIE)
9) once the type is constructed, add the member function to it
10) now the members are out of order (the member function being defined
is listed as the last member, even though it was declared as the first)

To avoid this, construct the context of the subprogram DIE before we
query to see if it exists. That way we never end up creating it before
creating its context and ending up in this situation.

Alternatively, the type construction that visits/builds all the members
could call something like getOrCreateSubprogram, but that doesn't ever
do the "add to context" step. Then the type building code would always
be responsible for adding members (and the subprogram "addToContextDIE"
would no-op because the context building would have added the subprogram
declaration to the type/context DIE already).

(the test cases updated were overly-sensitive to offsets or abbreviation
numbers. We don't have a nice way to make these tests more robust as yet
- multiline FileCheck matches would be required)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191939 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-04 01:39:59 +00:00
Richard Mitton
7c9659a3b2 Fixed a bug with section names containing special characters.
Changed the dwarf aranges code to not use getLabelEndName, as it turns out it's not reliable to call that given user-defined section names. Section names can have characters in that aren't representable as symbol names.

The dwarf-aranges test case has been updated to include a special character, to check this.

This fixes pr17416.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191932 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-03 22:07:08 +00:00
Eric Christopher
45fae28db7 Make sure we emit a section for pubnames even if that section is
going to be empty. This is particularly important for the gnu
pubnames case since we're emitting a relocation to the section.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191915 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-03 17:41:20 +00:00
Alexey Samsonov
9d08d69fd4 Remove wild .debug_aranges entries generated from unimportant labels
r191052 added emitting .debug_aranges to Clang, but this
functionality is broken: it uses all MC labels added in DWARF Asm
printer, including the labels for build relocations between
different DWARF sections, like .Lsection_line or .Ldebug_loc0.

As a result, if any DIE .debug_info would contain "DW_AT_location=0x123"
attribute, .debug_aranges would also contain a range starting from 0x123,
breaking tools that rely on this section.

This patch fixes this by using only MC labels that corresponds to the
addresses in the user program.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191884 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-03 08:54:43 +00:00
Eric Christopher
451c71d67b Add the DW_AT_GNU_ranges_base attribute if we've emitted any ranges
into the debug_ranges section.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191721 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-01 00:43:36 +00:00
Eric Christopher
a6d841561b The DW_AT_GNU_pubnames/pubtypes attributes are actually form
SEC_OFFSET from the beginning of the section so go ahead and emit
a label at the beginning of each one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191710 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-30 23:14:16 +00:00
Eric Christopher
c839df0e4c Unify pubsection/gnu pubsection printing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191407 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-25 23:02:36 +00:00
David Blaikie
9ddf28d501 llvm-dwarfdump support for gnu_pubtypes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191329 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-24 19:50:00 +00:00
Eric Christopher
3d2c90f6dd Add namespaces to the list of items that we expose via pubnames.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191257 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-24 00:17:57 +00:00
Eric Christopher
7a6ae29cdb Regenerate testcase from source.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191256 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-24 00:17:54 +00:00
David Blaikie
cb21ba8e76 Make dwarfdump-type-units.test order-independent
The order in which the comdat type unit sections appear in the output is
unspecified and may vary from machine to machine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191253 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-24 00:13:23 +00:00
Eric Christopher
5a63474e2d Add more external types to the pubtypes table. Expand the asm
checking patch until we get full dumping support.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191239 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-23 23:15:58 +00:00
David Blaikie
438f5391b2 llvm-dwarfdump/libDebugInfo support for type units
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191234 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-23 22:44:47 +00:00
Eric Christopher
cdeaae4f75 Handle gnu pubtypes sections:
a) Make sure we are emitting the correct section in our section labels
when we begin the module.
b) Make sure we are emitting the correct pubtypes section in the
presence of gnu pubtypes.
c) For C++ struct, union, class, and enumeration types are default
external.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191225 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-23 20:55:35 +00:00
Richard Mitton
eb46def978 Fixed debug_aranges handling for common symbols.
The size of common symbols is now tracked correctly, so they can be listed in the arange section without needing knowledge of other following symbols.

.comm (and .lcomm) do not indicate to the system assembler any particular section to use, so we have to treat them as having no section.

Test case update to account for this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191210 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-23 17:56:20 +00:00
NAKAMURA Takumi
023d90edb0 Initialize BSSSection explicitly in InitMachOMCObjectFileInfo() to appease msvc.
This can revert r191087.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191128 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-21 02:34:45 +00:00
Eric Christopher
9e0b08dd20 Move emission of the debug string table to early in the debug
info finalization to greatly reduce the number of fixups that the
assembler has to handle in order to improve compile time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191119 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-20 23:22:52 +00:00
NAKAMURA Takumi
d338788a49 llvm/test: Mark 3 tests as XFAIL:msvc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191087 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-20 12:57:34 +00:00
Benjamin Kramer
17111ad920 Move x86-dependent tests into the right directory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191082 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-20 10:56:40 +00:00
David Blaikie
5cfcb3677a DebugInfo: constrain gnu pubnames test further
Ensures that the pubnames entries actually refer to the intended
entities. This test could be more flexible if there was a way to do
multiline FileCheck matches with captures (in that way the test wouldn't
need to have hardcoded offset values and would thus be resilient to
changes in the layout of the DIEs in this CU).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191055 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 23:43:46 +00:00
Richard Mitton
5cc319a42a Added support for generate DWARF .debug_aranges sections automatically.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191052 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 23:21:01 +00:00
David Blaikie
994c37fcb0 DebugInfo: llvm-dwarfdump support for gnu_pubnames section
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191050 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 23:01:29 +00:00
David Blaikie
18a6ade6cd DebugInfo: Improve IR annotation comments for GNU pubthings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191043 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 22:19:37 +00:00
Adrian Prantl
0a4371a207 Debug info: Get rid of the VLA indirection hack in FastISel.
Use the DIVariable::isIndirect() flag set by the frontend instead of
guessing whether to set the machine location's indirection bit.
Paired commit with CFE.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190961 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-18 22:08:59 +00:00
Adrian Prantl
06b005f17a mention command line parameters
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190827 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-17 00:15:36 +00:00
Adrian Prantl
3d6ce062dc Be sure we run ARM tests only when an ARM backend is present.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190822 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-16 23:48:45 +00:00
Adrian Prantl
818833f279 Debug info: Fix PR16736 and rdar://problem/14990587.
A DBG_VALUE is register-indirect iff the first operand is a register
_and_ the second operand is an immediate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190821 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-16 23:29:03 +00:00
Eric Christopher
8f1a9299de Add initial support for handling gnu style pubnames accepted by some
versions of gold. This support is designed to allow gold to produce
gdb_index sections similar to the accelerator tables and consumable
by gdb.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190649 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-13 00:35:05 +00:00
NAKAMURA Takumi
c3c9b9b7a8 MCObjectFileInfo.cpp: Fix a couple of possible typo(s), s/DwarfPub/DwarfGnuPub/, in r190344.
XFAIL can be removed. (in r190374)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190386 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-10 06:01:56 +00:00
NAKAMURA Takumi
db0e461511 llvm/test/DebugInfo/dwarf-public-names.ll: Mark it as XFAIL for PECOFF targets, for now. Investigating.
FIXME: llvm-dwarfdump doesn't handle PECOFF.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190374 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-10 00:28:23 +00:00
Manman Ren
56736c18c1 Debug Info Testing: use null instead of an empty string in context field.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190284 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-09 00:12:17 +00:00
Manman Ren
1ed2e1fb92 Debug Info Testing: update context from empty string to null.
Context should be either null or MDNode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190267 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-08 03:11:54 +00:00
Manman Ren
0e85f6e391 Debug Info: Use identifier to reference DIType in containing type field of
a DISubprogram.
    
Verifier is updated accordingly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190229 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-07 00:04:05 +00:00
Manman Ren
1307103dff Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields.
Field 2 of DIType (Context), field 9 of DIDerivedType (TypeDerivedFrom),
field 12 of DICompositeType (ContainingType), fields 2, 7, 12 of DISubprogram
(Context, Type, ContainingType).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190205 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-06 21:03:58 +00:00
Manman Ren
e42279cda4 Debug Info: Use identifier to reference DIType in containing type field of
a DICompositeType.
    
Verifier is updated accordingly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190190 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-06 18:46:00 +00:00
Manman Ren
28da141d44 Debug Info Testing: Updated to use null instead of "i32 0" for containing-type
field of DICompositeType.

This will help the follow-on patch of using DITypeRef for containing-type field.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190187 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-06 18:13:59 +00:00
Manman Ren
bc66071baa Debug Info: Use identifier to reference DIType in base type field of
ptr_to_member.

We introduce a new class DITypeRef that represents a reference to a DIType.
It wraps around a Value*, which can be either an identifier in MDString
or an actual MDNode. The class has a helper function "resolve" that
finds the actual MDNode for a given DITypeRef.

We specialize getFieldAs to return a field that is a reference to a
DIType. To correctly access the base type field of ptr_to_member,
getClassType now calls getFieldAs<DITypeRef> to return a DITypeRef.

Also add a typedef for DITypeIdentifierMap and a helper
generateDITypeIdentifierMap in DebugInfo.h. In DwarfDebug.cpp, we keep
a DITypeIdentifierMap and call generateDITypeIdentifierMap to actually
populate the map.

Verifier is updated accordingly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190081 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-05 18:48:31 +00:00
Eric Christopher
efc47ec528 Remove hack ensuring that darwin didn't produce dwarf > 3 for modules
without a limiting factor.

Update all testcases accordingly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190002 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 22:21:24 +00:00
Michael Gottesman
dc42d031fb Revert "Revert "Remove the darwin gdb option, that version of gdb is now dead and the rest of the compatibility should be done on a dwarf-N level.""
This reverts commit r189913.

Talked with Eric on IRC. I am going to XFAIL the failing test since it
is using what Eric described as "the member hack" which was needed on
that old GDB.

Sorry for the noise!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189914 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 04:39:38 +00:00
Michael Gottesman
14ce9f1d25 Revert "Remove the darwin gdb option, that version of gdb is now dead and the rest of the compatibility should be done on a dwarf-N level."
This reverts commit r189903.

This commit broke the phase 1 buildbot for a while.

http://lab.llvm.org:8013/builders/clang-x86_64-darwin11-nobootstrap-RAincremental/builds/6684

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189913 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 04:31:56 +00:00
Eric Christopher
0a69049b62 Remove the darwin gdb option, that version of gdb is now dead and
the rest of the compatibility should be done on a dwarf-N level.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189903 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 02:02:10 +00:00
Eric Christopher
bd18c8d090 Add the rest of the stock attributes to the attribute table.
This won't affect the kinds of hashes we test for as we actually
do hashing based on form and attribute. Change the fission-hash
testcase one last time to handle DW_AT_comp_dir.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189840 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-03 20:00:20 +00:00
Eric Christopher
2612354594 Don't bother emitting the pubtypes section on darwin since there aren't
any maintained consumers of it on that platform.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189631 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-30 00:40:17 +00:00
Eric Christopher
7ced4fa257 Add support for DW_FORM_dataN and DW_FORM_udata to the DIE hashing
algorithm. Update the split dwarf hashing testcase accordingly - this
should be the last time that the hash of an empty file changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189427 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-28 00:10:38 +00:00
Eric Christopher
7b2ee399d9 Use DW_FORM_sdata for signed constant values and udata on occasion
when we can. Migrate from using blocks when we're adding just a
single attribute and floating point values are an unsigned, not signed,
bag of bits.

Update all test cases accordingly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189419 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-27 23:49:04 +00:00
Eric Christopher
6e74bfc0e6 Move some debug testcases to the debug info directory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189418 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-27 23:48:57 +00:00
Eric Christopher
bf6f1f2a32 Add derived from source.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189301 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-27 00:46:28 +00:00
Eric Christopher
478a1189cb Add a testcase to ensure that the pubnames section uses an offset
off of the debug_info section even when split dwarf is enabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189300 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-27 00:36:19 +00:00
Eric Christopher
63ae7c9aec Treat the pubtypes section similarly to the pubnames section and emit
it by default under linux or when we're trying to keep compatibility
with old gdb versions.

Fix testcase for option name change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189289 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-26 23:24:35 +00:00
Manman Ren
6e3cd0ebe2 Debug Info: add an identifier field to DICompositeType.
DICompositeType will have an identifier field at position 14. For now, the
field is set to null in DIBuilder.
For DICompositeTypes where the template argument field (the 13th field)
was optional, modify DIBuilder to make sure the template argument field is set.
Now DICompositeType has 15 fields.

Update DIBuilder to use NULL instead of "i32 0" for null value of a MDNode.
Update verifier to check that DICompositeType has 15 fields and the last
field is null or a MDString.

Update testing cases to include an extra field for DICompositeType.
The identifier field will be used by type uniquing so a front end can
genearte a DICompositeType with a unique identifer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189282 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-26 22:39:55 +00:00
Bill Wendling
80075c482c Update to remove the no-frame-pointer-elim-non-leaf flag if it was set to 'false'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189068 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-22 21:28:54 +00:00
David Majnemer
d7d43dc435 DebugInfo: Do not use the DWARF Version for the .debug_pubnames or .debug_pubtypes version field
Summary:
LLVM would generate DWARF with version 3 in the .debug_pubname and
.debug_pubtypes version fields.  This would lead SGI dwarfdump to fail
parsing the DWARF with (in the instance of .debug_pubnames) would exit
with:
dwarfdump ERROR:  dwarf_get_globals: DW_DLE_PUBNAMES_VERSION_ERROR (123)

This fixes PR16950.

Reviewers: echristo, dblaikie

Reviewed By: echristo

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1454

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188869 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-21 06:13:34 +00:00
Eric Christopher
f04e4efcaa Turn on pubnames by default on linux.
Until gdb supports the new accelerator tables we should add the
pubnames section so that gdb_index can be generated from gold
at link time. On darwin we already emit the accelerator tables
and so don't need to worry about pubnames.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188708 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-19 21:07:38 +00:00
David Blaikie
a9b6979755 llvm-dwarfdump: Do not include address offsets for attributes, only for tags
This reduces the noise in diffs making it more likely that, at least for
LLVM revision-over-revision, diffs will actually yield usable results.

This is consistent with objdump's DWARF dumping behavior.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188650 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-19 03:36:23 +00:00
David Blaikie
2883fd4df4 DebugInfo: don't emit zero-length names for parameters
We check this in many/all other cases, just missed this one it seems.
Perhaps it'd be worth unifying this so we never emit zero-length
DW_AT_names.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188649 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-19 03:34:03 +00:00
Daniel Dunbar
24ec2e5a72 [tests] Cleanup initialization of test suffixes.
- Instead of setting the suffixes in a bunch of places, just set one master
   list in the top-level config. We now only modify the suffix list in a few
   suites that have one particular unique suffix (.ml, .mc, .yaml, .td, .py).

 - Aside from removing the need for a bunch of lit.local.cfg files, this enables
   4 tests that were inadvertently being skipped (one in
   Transforms/BranchFolding, a .s file each in DebugInfo/AArch64 and
   CodeGen/PowerPC, and one in CodeGen/SI which is now failing and has been
   XFAILED).

 - This commit also fixes a bunch of config files to use config.root instead of
   older copy-pasted code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188513 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-16 00:37:11 +00:00
Alexey Samsonov
6889483ca4 llvm-symbolizer: add support for .gnu_debuglink section
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188386 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-14 17:09:30 +00:00
Carlo Kok
46f0b6f10a Output DW_AT_stmt_list dwarf debug info as DW_FORM_sec_offset instead of DW_FORM_data4 as it is a section offset (fixes the coff/dwarf debug info statement locations)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188297 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-13 17:46:57 +00:00
Evgeniy Stepanov
15ab9f4aaa Pass DIEHash::collectAttributes output argument by-pointer instead of by-value.
Before this, collectAttributes() was operating on a local object.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188254 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-13 07:57:01 +00:00
Eric Christopher
0710bfa866 Add the start of DIE hashing for DWARF4 type units and split dwarf
CUs.

Currently only hashes the name of CUs and the names of any children,
but it's an obvious first step to show the framework. The testcase
should continue to be correct, however, as it's an empty TU.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188243 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-13 01:21:55 +00:00
Eric Christopher
b58bddf258 Add comment and source to testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188234 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-12 23:59:26 +00:00
Eric Christopher
f962c02b80 Move the addition of the dwo_id as late as possible after everything
has been finalized except for sizes and offsets. Update test accordingly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188199 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-12 20:27:48 +00:00
Eric Christopher
76ef79f410 For DW_TAG_template_type_parameter the actual passed in type could
be void and therefore not have a type entry. Only add the type if
it is non-void and provide a testcase.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187966 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-08 08:09:43 +00:00
Manman Ren
f40d578d7e Debug Info Finder|Verifier: handle DbgLoc attached to instructions.
Also remove checking of llvm.dbg.sp since it is not used in generating dwarf.

Current state of Finder:
DebugInfoFinder tries to list all debug info MDNodes used in a module. To
list debug info MDNodes used by an instruction, DebugInfoFinder provides
processDeclare, processValue and processLocation to handle DbgDeclareInst,
DbgValueInst and DbgLoc attached to instructions. processModule will go
through all DICompileUnits in llvm.dbg.cu and list debug info MDNodes
used by the CUs.

TODO:
1> Finder has a list of CUs, SPs, Types, Scopes and global variables. We
need to add a list of variables that are used by DbgDeclareInst and
DbgValueInst.
2> MDString fields should be null or isa<MDString> and MDNode fields should be
null or isa<MDNode>. We currently use empty string or int 0 to represent null.
3> Go though Verify functions and make sure that they check field types.
4> Clean up existing testing cases to remove llvm.dbg.sp and make sure each
testing case has a llvm.dbg.cu.

Re-apply r187609 with fix to pass ocaml binding. vmcore.ml generates a debug
location with scope being metadata !{}, in verifier we treat this as a null
scope.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187812 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-06 19:38:43 +00:00
Carlo Kok
fdabd9f391 Bugfix for making the DWARF debug strings and labels to code emitted as secrel32 instead of long opcodes (only for coff). This makes them debuggable with GDB (with fix for 64bits msvc)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187656 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-02 16:14:15 +00:00
NAKAMURA Takumi
ee1d7db74b Revert r187597, "Bugfix for making the DWARF debug strings and labels to code emitted as secrel32 instead of long opcodes (only for coff). This makes them debuggable with GDB."
It broke x86_64-win32 builder in llvm/test/DebugInfo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187642 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-02 03:46:05 +00:00
Eric Christopher
be9f508aec Temporarily revert "Debug Info Finder|Verifier: handle DbgLoc attached to
instructions." in an attempt to bring back some bots.

This reverts commit r187609.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187638 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-02 00:49:44 +00:00
Carlo Kok
cfe855d658 fix for LLVM debug info on llvm-mips-linux where the label name uses % instead of L as a prefix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187623 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-01 22:15:34 +00:00
Carlo Kok
e18804ecd0 ARM/Hexagon testcases can't compile x86 only testcase. Reverting change to testcase & fixing check for all.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187610 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-01 20:53:57 +00:00
Manman Ren
f589eef864 Debug Info Finder|Verifier: handle DbgLoc attached to instructions.
Also remove checking of llvm.dbg.sp since it is not used in generating dwarf.

Current state of Finder:
DebugInfoFinder tries to list all debug info MDNodes used in a module. To
list debug info MDNodes used by an instruction, DebugInfoFinder provides
processDeclare, processValue and processLocation to handle DbgDeclareInst,
DbgValueInst and DbgLoc attached to instructions. processModule will go
through all DICompileUnits in llvm.dbg.cu and list debug info MDNodes
used by the CUs.

TODO:
1> Finder has a list of CUs, SPs, Types, Scopes and global variables. We
need to add a list of variables that are used by DbgDeclareInst and
DbgValueInst.
2> MDString fields should be null or isa<MDString> and MDNode fields should be
null or isa<MDNode>. We currently use empty string or int 0 to represent null.
3> Go though Verify functions and make sure that they check field types.
4> Clean up existing testing cases to remove llvm.dbg.sp and make sure each
testing case has a llvm.dbg.cu.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187609 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-01 20:52:39 +00:00
David Blaikie
c8b93557da DebugInfo: Emit definitions for types with no members.
The absence of members was a poor/incorrect proxy for "is definition".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187607 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-01 20:30:22 +00:00
Carlo Kok
70cf72e092 change the inlinefnlocalvar testcase so it uses a triple that's not coff (doesn't seem to matter for the testcase itself, what it tests isn't triple specific), as coff has a slightly different way of emitting what it checks for.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187604 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-01 20:17:37 +00:00
Carlo Kok
5b25082ddb Bugfix for making the DWARF debug strings and labels to code emitted as secrel32 instead of long opcodes (only for coff). This makes them debuggable with GDB.
fixes Bug 16249 - LLVM generates broken debug info on Windows 

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187597 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-01 18:38:14 +00:00
Eric Christopher
3466fb11b7 Move file to X86 and add a triple to fix darwin bots for now.
The problem is due to the section name being explicitly mentioned in
the IR and differing between the two platforms.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187394 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-30 00:20:06 +00:00
Eric Christopher
86aa03d5f9 Fix a truly egregious thinko in anonymous namespace check,
update testcase to make sure we generate debug info for walrus
by adding a non-trivial constructor and verify that we don't
emit an ODR signature for the type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187393 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-29 23:53:08 +00:00
Eric Christopher
944aa2b784 Make sure we don't emit an ODR hash for types with no name and make
sure the comments for each testcase are a bit easier to distinguish.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187392 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-29 23:53:05 +00:00
Eric Christopher
407ec1422a Clarify comments for types contained in anonymous namespaces and
odr hashes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187391 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-29 23:53:01 +00:00
Manman Ren
096880b590 Debug Info: enable verifier for testing cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187375 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-29 20:18:19 +00:00
Manman Ren
d513b4033f Debug Info: update testing cases to pass verifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187362 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-29 18:12:58 +00:00
Benjamin Kramer
1faea8f086 DwarfDebug: MD5 is always little endian, bswap on big endian platforms.
This makes LLVM emit the same signature regardless of host and target endianess.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187304 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-27 14:14:43 +00:00
Manman Ren
2d69cc4bae Debug Info Verifier: verify SPs in llvm.dbg.sp.
Also always add DIType, DISubprogram and DIGlobalVariable to the list
in DebugInfoFinder without checking them, so we can verify them later
on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187285 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-27 01:26:08 +00:00
Rafael Espindola
e7e612f22f next batch of -disable-debug-info-verifier
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187260 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-26 22:31:26 +00:00
Manman Ren
ce0a12399c Debug Info Verifier: enable verification of DICompileUnit.
We used to call Verify before adding DICompileUnit to the list, and now we
remove the check and always add DICompileUnit to the list in DebugInfoFinder,
so we can verify them later on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187237 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-26 20:04:30 +00:00
Eric Christopher
2dd272f896 Move this to the X86 directory, unfortunately the hashes are not
endian independent.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187222 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-26 17:35:47 +00:00
Eric Christopher
3dee575b8d Add preliminary support for hashing DIEs and breaking them into
type units.

Initially this support is used in the computation of an ODR checker
for C++. For now we're attaching it to the DIE, but in the future
it will be attached to the type unit.

This also starts breaking out types into the separation for type
units, but without actually splitting the DIEs.

In preparation for hashing the DIEs this adds a DIEString type
that contains a StringRef with the string contained at the label.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187213 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-26 17:02:41 +00:00
Manman Ren
cb420a4bc0 Debug Info: improve the verifier to check field types.
Make sure the context field of DIType is MDNode.
Fix testing cases to make them pass the verifier.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187150 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-25 19:33:30 +00:00
Rafael Espindola
f204228b78 Current batch of -disable-debug-info-verifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187130 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-25 17:16:05 +00:00
Manman Ren
27ce44d3b4 Debug Info: improve the verifier to check field types.
Make sure the context and type fields are MDNodes. We will generate
verification errors if those fields are non-empty strings.
Fix testing cases to make them pass the verifier.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187106 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-25 06:43:01 +00:00
Bill Wendling
f245ae5a4a Replace the "NoFramePointerElimNonLeaf" target option with a function attribute.
There's no need to specify a flag to omit frame pointer elimination on non-leaf
nodes...(Honestly, I can't parse that option out.) Use the function attribute
stuff instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187093 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-25 00:34:29 +00:00