1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
llvm-mirror/test/DebugInfo
Adrian Prantl f625c157a1 PR32382: Fix emitting complex DWARF expressions.
The DWARF specification knows 3 kinds of non-empty simple location
descriptions:
1. Register location descriptions
  - describe a variable in a register
  - consist of only a DW_OP_reg
2. Memory location descriptions
  - describe the address of a variable
3. Implicit location descriptions
  - describe the value of a variable
  - end with DW_OP_stack_value & friends

The existing DwarfExpression code is pretty much ignorant of these
restrictions. This used to not matter because we only emitted very
short expressions that we happened to get right by accident.  This
patch makes DwarfExpression aware of the rules defined by the DWARF
standard and now chooses the right kind of location description for
each expression being emitted.

This would have been an NFC commit (for the existing testsuite) if not
for the way that clang describes captured block variables. Based on
how the previous code in LLVM emitted locations, DW_OP_deref
operations that should have come at the end of the expression are put
at its beginning. Fixing this means changing the semantics of
DIExpression, so this patch bumps the version number of DIExpression
and implements a bitcode upgrade.

There are two major changes in this patch:

I had to fix the semantics of dbg.declare for describing function
arguments. After this patch a dbg.declare always takes the *address*
of a variable as the first argument, even if the argument is not an
alloca.

When lowering a DBG_VALUE, the decision of whether to emit a register
location description or a memory location description depends on the
MachineLocation — register machine locations may get promoted to
memory locations based on their DIExpression. (Future) optimization
passes that want to salvage implicit debug location for variables may
do so by appending a DW_OP_stack_value. For example:
  DBG_VALUE, [RBP-8]                        --> DW_OP_fbreg -8
  DBG_VALUE, RAX                            --> DW_OP_reg0 +0
  DBG_VALUE, RAX, DIExpression(DW_OP_deref) --> DW_OP_reg0 +0

All testcases that were modified were regenerated from clang. I also
added source-based testcases for each of these to the debuginfo-tests
repository over the last week to make sure that no synchronized bugs
slip in. The debuginfo-tests compile from source and run the debugger.

https://bugs.llvm.org/show_bug.cgi?id=32382
<rdar://problem/31205000>

Differential Revision: https://reviews.llvm.org/D31439

llvm-svn: 300522
2017-04-18 01:21:53 +00:00
..
AArch64 LiveDebugValues: Assume calls never clobber SP. 2017-03-03 01:08:25 +00:00
AMDGPU AMDGPU: Test handling of R_AMDGPU_ABS64 in RelocVisitor 2017-04-17 18:12:45 +00:00
ARM PR32382: Fix emitting complex DWARF expressions. 2017-04-18 01:21:53 +00:00
COFF [codeview] Don't assert when the user violates the ODR 2017-03-24 23:28:42 +00:00
Generic PR32382: Fix emitting complex DWARF expressions. 2017-04-18 01:21:53 +00:00
Inputs [DWARF] Print leading zeros in type signature 2017-03-01 19:43:29 +00:00
Lanai [lanai] Add Lanai backend. 2016-03-28 13:09:54 +00:00
Mips [MC] Set SHT_MIPS_DWARF section type for all .debug_* sections on MIPS 2017-03-10 08:22:20 +00:00
MIR Don't compose DWARF expressions with multiple subregisters. 2017-03-22 01:16:01 +00:00
PDB [llvm-pdbdump] More advanced class definition dumping. 2017-04-12 23:18:21 +00:00
PowerPC Change how we handle section symbols on ELF. 2017-02-02 21:26:06 +00:00
Sparc [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
SystemZ [SystemZ] Save/restore r6 and r7 if function contains landing pad. 2016-06-28 14:13:11 +00:00
WebAssembly [WebAssembly] Convert the remaining unit tests to the new wasm-object-file target. 2017-02-28 23:37:04 +00:00
X86 PR32382: Fix emitting complex DWARF expressions. 2017-04-18 01:21:53 +00:00
arm-relocs.test
debuglineinfo-macho.test
debuglineinfo.test
debugmacinfo.test Fix several accidental DOS line endings in source files 2016-01-03 17:22:03 +00:00
dwarfdump-64-bit-dwarf.test
dwarfdump-accel.test Synchronize LLVM and clang's ObjCDeclSpec::ObjCPropertyAttributeKind. 2016-07-14 00:41:18 +00:00
dwarfdump-debug-frame-simple.test
dwarfdump-debug-loc-simple.test
dwarfdump-dump-flags.test [dwarfdump] Ignore scattered relocations for mach-o. 2015-07-31 20:22:50 +00:00
dwarfdump-dump-gdbindex.test Revert r282238 "Revert r282235 "[llvm-dwarfdump] - Teach dwarfdump to dump gdb-index section."" 2016-09-23 11:01:53 +00:00
dwarfdump-dwp.test dwarfdump: Correctly indentify the indicies for DWP records 2015-12-03 18:41:59 +00:00
dwarfdump-header.test [DWARF] Print leading zeros in type signature 2017-03-01 19:43:29 +00:00
dwarfdump-implicit-const.test DebugInfo: support for DW_FORM_implicit_const 2017-01-10 21:18:26 +00:00
dwarfdump-invalid.test
dwarfdump-line-dwo.test
dwarfdump-macho-relocs.test [dwarfdump] Do not apply relocations in mach-o files if there is no LoadedObjectInfo. 2015-08-23 04:44:21 +00:00
dwarfdump-macho-universal.test Don't use test inputs from other directories. 2015-08-03 11:59:45 +00:00
dwarfdump-objc.test Synchronize LLVM and clang's ObjCDeclSpec::ObjCPropertyAttributeKind. 2016-07-14 00:41:18 +00:00
dwarfdump-pubnames.test
dwarfdump-ranges.test
dwarfdump-type-units.test dwarfdump: -summarize-types: print a short summary (unqualified type name, hash, length) of type units rather than dumping contents 2016-10-18 21:09:48 +00:00
dwarfdump-zlib.test Recommit r270547 ([llvm-dwarfdump] - Teach dwarfdump to decompress debug sections in zlib style.) 2016-05-24 12:48:46 +00:00
dwo.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
llvm-symbolizer-split-dwarf-empty.test Use %T instead of cd'ing to Output directly. 2016-04-23 11:01:36 +00:00
llvm-symbolizer-zlib.test Recommit r270547 ([llvm-dwarfdump] - Teach dwarfdump to decompress debug sections in zlib style.) 2016-05-24 12:48:46 +00:00
llvm-symbolizer.test llvm-symbolizer: prefer .dwo contents over fission-gmlt-like-data when .dwo file is present 2016-04-22 21:32:59 +00:00
macro_link.ll [Debug Info] Added a LIT test that covers the fix committed in rL277290. 2016-08-11 07:22:53 +00:00
member-pointers.o
missing-abstract-variable.o
skeletoncu.ll Unxfail passing tests on Hexagon 2016-08-19 15:07:58 +00:00
strip-DIGlobalVariable.ll Teach llvm::StripDebugInfo() about global variable !dbg attachments. 2016-10-10 17:53:33 +00:00
strip-loop-metadata.ll Improve DebugInfo/strip-loop-metadata.ll test 2017-03-31 17:51:12 +00:00