Commit graph

155 commits

Author SHA1 Message Date
Elie Morisse
2cdae62b0e Debug info: attach entries to their scope, and never use the qualified name except for modules
Previously entries were made children of the compile unit, and both global and imported symbols were only accessible by using their mangled name, or since the latest commit by their qualified name.

This brings the DWARF output closer to GDC's.
2018-10-15 22:51:50 +02:00
Elie Morisse
841146644b Debug info: emit llvm::DIModule and llvm::DIImportedEntity for modules and imports
Matches GDC's DWARF output and enables access to global and imported symbols from GDB.
2018-10-15 22:48:03 +02:00
Martin Kinkelin
5c24f60cf9
Raise min LLVM version to 3.9 (#2872) 2018-10-15 22:31:59 +02:00
Martin Kinkelin
5d8b581025 Rename ExplicitByvalRewrite to IndirectByvalRewrite 2018-05-27 00:57:26 +02:00
Johan Engelen
5b775a7dc5
Fix compilation with LLVM trunk. (#2705) 2018-05-22 20:04:09 +02:00
Martin
114dfa4333 Handle new special enums in debuginfo emission
I.e., __c_(u)long and __c_long_double.

This fixes runnable/cppa.d.
2018-04-27 23:50:52 +02:00
Martin
df4f854dd5 Upgrade to D v2.079.0-beta.1 2018-02-20 02:04:41 +01:00
Martin Kinkelin
11dfc4b5d7
Get rid of dead code (arrayops + DtoCallFunction() overload) (#2500) 2018-01-14 00:02:42 +01:00
Martin
6e7249c574 DI: Use fully qualified names
Tested by dmd-testsuite's runnable/testpdb.
2017-10-22 23:12:30 +02:00
Martin
610a1c37e4 Handle multiple function definitions with same mangled name
By discarding (and warning about) all but the first definition.
compilable/test17352.d tests that the compiler accepts 2 distinct but
equivalent templated function instantiations (with an alias to a
different local of the same type and name) ending up with a common
mangled name.
See https://issues.dlang.org/show_bug.cgi?id=17352.
2017-09-23 22:11:34 +02:00
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