summaryrefslogtreecommitdiffstats
path: root/tests/debuginfo/type-names.cdb.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
commit64d98f8ee037282c35007b64c2649055c56af1db (patch)
tree5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /tests/debuginfo/type-names.cdb.js
parentAdding debian version 1.67.1+dfsg1-1. (diff)
downloadrustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz
rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/debuginfo/type-names.cdb.js')
-rw-r--r--tests/debuginfo/type-names.cdb.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/debuginfo/type-names.cdb.js b/tests/debuginfo/type-names.cdb.js
new file mode 100644
index 000000000..8f8b20bfa
--- /dev/null
+++ b/tests/debuginfo/type-names.cdb.js
@@ -0,0 +1,17 @@
+// Helper functions for running the type-names.rs test under CDB
+
+// CDB exposes an "object model" via JavaScript that allows you to inspect debugging info - in this
+// case we want to ask the object model for the return and parameter types for a local variable
+// that is a function pointer to make sure that we are emitting the function pointer type in such a
+// way that CDB understands how to parse it.
+
+"use strict";
+
+function getFunctionDetails(name)
+{
+ var localVariable = host.currentThread.Stack.Frames[0].LocalVariables[name];
+ var functionPointerType = localVariable.targetType.genericArguments[0];
+ var functionType = functionPointerType.baseType;
+ host.diagnostics.debugLog("Return Type: ", functionType.functionReturnType, "\n");
+ host.diagnostics.debugLog("Parameter Types: ", functionType.functionParameterTypes, "\n");
+}