summaryrefslogtreecommitdiffstats
path: root/tests/debuginfo/type-names.cdb.js
diff options
context:
space:
mode:
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");
+}