public void GetInfoTypesAndNamesWithMissingValues() { mockDebuggerStackFrame.GetVariables(true, false, false, false).Returns( new List <SbValue>()); var fields = FrameInfoFlags.FIF_FUNCNAME | FrameInfoFlags.FIF_FUNCNAME_ARGS | FrameInfoFlags.FIF_FUNCNAME_ARGS_TYPES | FrameInfoFlags.FIF_FUNCNAME_ARGS_NAMES | FrameInfoFlags.FIF_FUNCNAME_ARGS_VALUES; var info = stackFrame.GetInfo(fields); Assert.AreEqual(FrameInfoFlags.FIF_FUNCNAME, info.ValidFields & FrameInfoFlags.FIF_FUNCNAME); Assert.AreEqual( string.Format("{0}({1} {2}, {3} {4})", NAME, ARG1_TYPE_NAME, ARG1_NAME, ARG2_TYPE_NAME, ARG2_NAME), info.FuncName); }
public void SetUp() { mockTarget = Substitute.For <SbTarget>(); mockDebuggerStackFrame = CreateMockStackFrame(); var mockArgument1 = Substitute.For <SbValue>(); mockArgument1.GetValue().Returns(ARG1_VALUE); var mockArgument2 = Substitute.For <SbValue>(); mockArgument2.GetValue().Returns(ARG2_VALUE); var functionArguments = new List <SbValue>(); functionArguments.Add(mockArgument1); functionArguments.Add(mockArgument2); mockDebuggerStackFrame.GetVariables(true, false, false, false).Returns( functionArguments); mockDebuggerStackFrame.GetFunction().GetArgumentName(0).Returns(ARG1_NAME); mockDebuggerStackFrame.GetFunction().GetArgumentName(1).Returns(ARG2_NAME); var mockArgTypeList = Substitute.For <SbTypeList>(); mockArgTypeList.GetSize().Returns(2u); mockArgTypeList.GetTypeAtIndex(0u).GetName().Returns(ARG1_TYPE_NAME); mockArgTypeList.GetTypeAtIndex(1u).GetName().Returns(ARG2_TYPE_NAME); var mockFunctionType = Substitute.For <SbType>(); mockFunctionType.GetFunctionArgumentTypes().Returns(mockArgTypeList); mockDebuggerStackFrame.GetFunction().GetType().Returns(mockFunctionType); var optionsFactory = Substitute.For <ILldbExpressionOptionsFactory>(); var valueFactory = new RemoteValueImpl.Factory(optionsFactory); stackFrame = new RemoteFrameImpl.Factory(valueFactory, optionsFactory) .Create(mockDebuggerStackFrame); }
public List <RemoteValue> GetVariables(bool arguments, bool locals, bool statics, bool only_in_scope) => _sbFrame.GetVariables(arguments, locals, statics, only_in_scope).ConvertAll( v => _valueFactory.Create(v));