Commit graph

145 commits

Author SHA1 Message Date
Martin
8cc5ff6e79 Fix debuginfos for nested ref/out parameters (use llvm.dbg.declare)
llvm.dbg.value() apparently doesn't like GEP + deref, so use
llvm.dbg.declare() & GEP.
2017-09-09 22:02:14 +02:00
Martin
8371d173a9 MSVC x64: Declare params rewritten by ExplicitByvalRewrite as DI refs 2017-09-09 22:01:22 +02:00
Martin
8a5984b7d3 Use llvm.dbg.value for all non-special refs & fix nested refs DI 2017-09-09 22:01:22 +02:00
Martin
287e4b9b53 Cosmetics & improved comments wrt. llvm.dbg.value 2017-09-09 22:01:17 +02:00
Johan Engelen
7563930496 ref variables are not always function parameters: could be from a foreach statement, where it _is_ an alloca. 2017-08-27 21:47:33 +02:00
Johan Engelen
152416bd37 Attempt to use llvm.dbg.value instead for ref params. 2017-08-27 20:49:43 +02:00
Johan Engelen
bea0a37582 An attempt to fix runnable/gdb4149.d test: correct debuginfo for ref parameters. 2017-08-26 14:56:37 +02:00
Nicholas Wilson
f27109c8e8 New spirv and 6.0 compilation fixes (#2276)
Update to a new SPIRV-LLVM and fix compilation issues for LLVM6.0
2017-08-18 15:23:56 +08:00
Johan Engelen
cc35356d78 Mark intentional fall through as such. (#2218) 2017-07-20 20:22:43 +02:00
Johan Engelen
498f790915 Make the producer name in debuginfo more precise. (#2205) 2017-07-19 20:29:57 +02:00
Martin
1fb269f940 Drop support for LLVM < 3.7 2017-07-16 02:18:00 +02:00
Nicholas Wilson
c041205fe0 Dcompute fixes (#2195)
* Disable debug info for now Until I get it working.

* Don't recurse into uninstansiated templates

* Remove device only modules from objfiles.

* Remove typeid generation for dcompute.

* Dont generate typeinfo member functions

* Whitelist `__dcompute_reflect`
2017-07-13 11:28:09 +08:00
kinke
20084000b0 Merge pull request #2142 from kinke/archiver
Integrate LLD for MSVC targets; prepare for other targets
2017-06-04 04:02:22 +02:00
Martin
383c2d3a59 Range-ify usages of front-end Arrays 2017-06-04 00:29:44 +02:00
Elie Morisse
caa515a69b For classes DIBuilder::CreateCompositeType was producing DIType with wrong sizes.
Resulting in incorrect values in GDB.
2017-05-21 21:41:29 -03:00
Elie Morisse
3338bbf9c0 DIType for types involving classes were incorrect in some cases.
Static arrays of classes, pointers to class (and perhaps global class variables) ended up with a wrong DIType because of wrong CreateTypeDescription() calls for class types.

Ex.: Array!FuncDeclaration caused an infinite recursion crash in GDB, because for its « FuncDeclaration[SMALLARRAYCAP] smallarray » field DIBuilder::CreateSArrayType() had DIBuilder return a value type instead of a reference type for FuncDeclaration.
2017-05-21 21:41:25 -03:00
Johan Engelen
d61452c6a8 Add internal global option to enable outputting of source line info 2017-05-03 00:10:52 +02:00
Johan Engelen
c2b539c348 Fix LLVM 5.0 compilation 2017-03-14 23:45:56 +01:00
Martin
dca21939e1 Merge 2.072.2 front-end
The part needing most attention was ddmd.root.ctfloat, ddmd.target (incl.
gen/target.cpp) and ddmd.builtin. The front-end is now prepared for
elaborate compile-time floating-point types to allow for proper cross-
compilation.

This version still uses the host's `real` type for compile-time reals,
except for MSVC hosts, which still use 64-bit doubles (when compiled with
DMD host compiler too).

Some other changes:

* semantic*() of Statements extracted from statement.d to statementsem.d
* mangle() -> mangleToBuffer()
* Identifier::string -> toChars()
* Token::float80value => floatvalue
* Dsymbol::isAggregateMember() => isMember()
* BoolExp is no more
* ddmd.root.ctfloat: LDC-specific CTFE builtins
2017-01-29 15:48:03 +01:00
kinke
89e5d27415 Put debuginfo on GEP instead of on the alloca with an offset. (#1984)
For nested variables. Resolves issue #1933 at the expense of a debuginfo
regression wrt. captured this pointer, see PR #1963.

Also add DWARF deref for non-ref/out variables captured by reference.
2017-01-25 00:36:00 +01:00
Ivan Butygin
a26bfc1223 Refactor code to hide direct IrFunction->func usage and add convenient functions (#1911) 2017-01-17 22:40:32 +01:00
Johan Engelen
5e9914ad29 Fix LLVM trunk build. (#1936) 2016-12-22 17:59:03 +01:00
Remi Thebault
3b63effd3f Implement -gline-tables-only (PR #1861)
As per ldc-developers/ldc#1844 .
2016-11-12 20:16:41 +01:00
Rainer Schuetze
08e1c496dc fix build against current LLVM master @ 9b4e8286785f538e73d2e3eaa96f88c3d98b9960 2016-10-27 08:08:19 +02:00
Martin
6b6cafcd60 Win64 workaround: Emit slice and vector params as DI locals
This works for both cdb/Windbg and Visual Studio debuggers, otherwise the
DI values are garbage in both debuggers too.
2016-10-10 20:36:17 +02:00
Martin
8be1e3e719 Adapt emission of debuginfos for parameters
Emit all parameters (except for captured ones) as DI parameters.
2016-10-09 20:17:39 +02:00
kinke
4e5c9616e3 Merge pull request #1804 from rainers/cv10
CodeView: arguments passed by reference not shown
2016-10-08 23:00:43 +02:00
David Nadlinger
ba180bbde2 Merge pull request #1813 from rainers/cv11
DI: display typeof(null) as void*
2016-10-08 11:37:10 +01:00
Rainer Schuetze
9d1637f410 DI: display typeof(null) as void* 2016-10-08 10:03:07 +02:00
Nicholas Wilson
45a4f64ac1 [NFC] Refactor debuginfo emission check. (#1797) 2016-10-07 15:14:19 +02:00
Rainer Schuetze
4635446bd8 CodeView: arguments passed by reference not shown because of wrong size 2016-10-07 09:41:32 +02:00
Rainer Schuetze
3ed8f25ae2 Debuginfo: try harder to find a suitable filename is location is empty 2016-10-06 00:18:38 +02:00
Rainer Schuetze
5bcfb49b1b Enable gdb tests in dmd-testsuite (#1784)
Introduce a hidden `-dwarf-version=<uint>` switch to support old gdb versions
used by Travis. Older versions only supporting DWARF-2 and/or not supporting
TLS correctly are detected in dmd-testsuite's CMakefile.
2016-09-27 01:26:15 +02:00
Rainer Schuetze
fd80d5eada Merge pull request #1768 from rainers/cv6
CodeView: fix vector types void16 and void32
2016-09-25 10:42:21 +02:00
Rainer Schuetze
767f8614ca Debug info: fix vector types void16 and void32 2016-09-25 09:14:52 +02:00
Rainer Schuetze
2dec29b825 CodeView: fix display of dynamic array arguments (#1761) 2016-09-24 21:06:58 +02:00
Rainer Schuetze
daa404d523 Debuginfo: use inheritance information for base classes instead of listing base class members in derived classes 2016-09-23 08:37:41 +02:00
Johan Engelen
807e94011d Fix unused var warning.
(I chose this over `(void)...`.)
2016-09-15 21:07:28 +02:00
Johan Engelen
a561b6a496 Fix LLVM 4.0 build, there was another debuginfo change. 2016-09-14 11:07:58 +02:00
Johan Engelen
b71e8ee439 The type of DIFlag parameters changed from unsigned to DIFlags in LLVM 4.0. 2016-09-13 10:50:00 +02:00
Rainer Schuetze
c8eb07d720 CodeView: add support for imaginary and complex types 2016-09-02 09:18:06 +02:00
Rainer Schuetze
36dec7389d * DebugInfo fixes:
- byte,ubyte should be encoded as DW_ATE_signed_char/DW_ATE_unsigned_char, not DW_ATE_signed/DW_ATE_unsigned
- encode wchar,dchar as UTF
- do not declare struct/class definitions as FlagFwdDecl
- pass deco as unique identifier to UDTs
- dynamic arrays: use type name, don't leave it empty
- use proper type name for delegates
- add support for type "void" and "typeof(null)"
2016-08-30 08:17:39 +02:00
Martin
29152f5b94 Refactor DIBuilder
Incl. some subtle changes/fixes.
2016-07-22 22:34:31 +02:00
Martin
c9cb63fb54 Misc. debuginfo fixes
As LLVM's CodeView component now uses additional asserts, e.g.,
to make sure the size of a static array equals N * elementSize.
2016-07-22 15:01:55 +02:00
Elie Morisse
302d71a9de MSVC: Attach !dbg info to _d_eh_enter_catch, _d_enter_cleanup and _d_leave_cleanup calls. 2016-07-03 16:46:51 -03:00
Elie Morisse
7ac1216292 Nested variables debug info fixes.
- Fix the value of closure variables in the parent function. Previously the passed value was the GEP instruction into .frame, and that instruction corresponds to a register  so resulted in "DWARF-2 expression error: DW_OP_reg operations must be used either alone(...)" (also the address was incorrect anyway because the offset would get doubled by 'addr')

 - When emitting debug info for a parent function parameter that is accessed from a nested function, call DIBuilder.createAutoVariable instead of createParameterVariable. Two different variables for the same parameter index was triggering an assert in llvm::DbgVariable::addMMIEntry. This fixes the compilation of druntime and phobos when building against LLVM 3.8.
2016-06-30 14:13:51 -03:00
Elie Morisse
c3ee617d8a Fix LLVM >=3.8 debug info by assigning DISubprograms to their corresponding function. 2016-06-30 14:13:13 -03:00
Martin
6a6f6be2e3 MSVC: Don't truncate debug info names anymore
Newest LLVM takes care of this for us.
2016-03-16 19:45:35 +01:00
Rainer Schuetze
1131e6fc24 fix function name mangling for debug info 2016-03-13 17:31:22 +01:00
Rainer Schuetze
6f3adaea46 add debug info to thunks as a workaround for https://llvm.org/bugs/show_bug.cgi?id=26833 2016-03-13 17:29:44 +01:00