]> git.lizzy.rs Git - rust.git/blob - tests/debuginfo/type-names.cdb.js
Rollup merge of #107807 - GuillaumeGomez:fix-small-debug-typo, r=notriddle
[rust.git] / tests / debuginfo / type-names.cdb.js
1 // Helper functions for running the type-names.rs test under CDB
2
3 // CDB exposes an "object model" via JavaScript that allows you to inspect debugging info - in this
4 // case we want to ask the object model for the return and parameter types for a local variable
5 // that is a function pointer to make sure that we are emitting the function pointer type in such a
6 // way that CDB understands how to parse it.
7
8 "use strict";
9
10 function getFunctionDetails(name)
11 {
12     var localVariable = host.currentThread.Stack.Frames[0].LocalVariables[name];
13     var functionPointerType = localVariable.targetType.genericArguments[0];
14     var functionType = functionPointerType.baseType;
15     host.diagnostics.debugLog("Return Type: ", functionType.functionReturnType, "\n");
16     host.diagnostics.debugLog("Parameter Types: ", functionType.functionParameterTypes, "\n");
17 }