[pkg-d-commits] [ldc] 45/149: druntime: Fix no stack trace on windows (#1976)

Matthias Klumpp mak at moszumanska.debian.org
Sun Apr 23 22:36:56 UTC 2017


This is an automated email from the git hooks/post-receive script.

mak pushed a commit to annotated tag v1.2.0
in repository ldc.

commit b5d1ae2ca114d17e04abd407e17b59cb67158ad0
Author: kinke <kinke at users.noreply.github.com>
Date:   Sun Jan 22 19:01:49 2017 +0100

    druntime: Fix no stack trace on windows (#1976)
---
 runtime/druntime                      |  2 +-
 tests/codegen/exception_stack_trace.d | 38 +++++++++++++++++++++++++++++++++++
 2 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/runtime/druntime b/runtime/druntime
index df6e85b..6d4cf2f 160000
--- a/runtime/druntime
+++ b/runtime/druntime
@@ -1 +1 @@
-Subproject commit df6e85ba928487070da890f130ae4f8924fa0195
+Subproject commit 6d4cf2f0ae1cd6bcd61d3bcaf792f189a3dfb743
diff --git a/tests/codegen/exception_stack_trace.d b/tests/codegen/exception_stack_trace.d
new file mode 100644
index 0000000..464aa60
--- /dev/null
+++ b/tests/codegen/exception_stack_trace.d
@@ -0,0 +1,38 @@
+// RUN: %ldc -g -disable-fp-elim -link-debuglib %s -of=%t%exe
+// RUN: %t%exe | FileCheck %s
+
+void bar()
+{
+    throw new Exception("lala");
+}
+
+void foo()
+{
+    bar();
+}
+
+void main()
+{
+    try
+    {
+        foo();
+    }
+    catch (Exception e)
+    {
+        import core.stdc.stdio;
+        auto s = e.toString();
+        printf("%.*s\n", s.length, s.ptr);
+    }
+}
+
+// CHECK:      object.Exception@{{.*}}exception_stack_trace.d(6): lala
+// CHECK-NEXT: ----------------
+/* Hiding all frames up to and including the first _d_throw_exception()
+ * one doesn't work reliably on all platforms, so don't enforce
+ * CHECK-*NEXT* for the bar() frame.
+ * On Win32, the bar() frame is missing altogether.
+ * So be very generous and only check for 2 consecutive lines containing
+ * 'exception_stack_trace' each (in function name and/or source file).
+ */
+// CHECK:      exception_stack_trace{{.*$}}
+// CHECK-NEXT: exception_stack_trace{{.*$}}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-d/ldc.git



More information about the pkg-d-commits mailing list