about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorVadim Chugunov <vadimcn@gmail.com>2016-08-24 19:34:31 -0700
committerVadim Chugunov <vadimcn@gmail.com>2016-08-25 00:40:42 -0700
commitcf6461168f5a784c996ffd6618d23f33113d2819 (patch)
tree8bd9a633f4f1ac054d316c0b1d0d4bc7dfbf9569 /src/rustllvm/RustWrapper.cpp
parente9bc1bac8c7664fb1b487879b3fbd56221f6a721 (diff)
downloadrust-cf6461168f5a784c996ffd6618d23f33113d2819.tar.gz
rust-cf6461168f5a784c996ffd6618d23f33113d2819.zip
Fix debug line info for macro expansions.
Macro expansions produce code tagged with debug locations that are completely different from the surrounding expressions.  This wrecks havoc on debugger's ability the step over source lines.

In order to have a good line stepping behavior in debugger, we overwrite debug locations of macro expansions with that of the outermost expansion site.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
-rw-r--r--src/rustllvm/RustWrapper.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp
index 0da25e7ac57..82fb2b0918f 100644
--- a/src/rustllvm/RustWrapper.cpp
+++ b/src/rustllvm/RustWrapper.cpp
@@ -521,6 +521,15 @@ extern "C" LLVMRustMetadataRef LLVMRustDIBuilderCreateLexicalBlock(
         ));
 }
 
+extern "C" LLVMRustMetadataRef LLVMRustDIBuilderCreateLexicalBlockFile(
+    LLVMRustDIBuilderRef Builder,
+    LLVMRustMetadataRef Scope,
+    LLVMRustMetadataRef File) {
+    return wrap(Builder->createLexicalBlockFile(
+        unwrapDI<DIDescriptor>(Scope),
+        unwrapDI<DIFile>(File)));
+}
+
 extern "C" LLVMRustMetadataRef LLVMRustDIBuilderCreateStaticVariable(
     LLVMRustDIBuilderRef Builder,
     LLVMRustMetadataRef Context,