{
HRESULT Status;
- ToRelease<ICorDebugFunction> iCorFunction;
- IfFailRet(pFrame->GetFunction(&iCorFunction));
- ToRelease<ICorDebugFunction2> iCorFunction2;
- IfFailRet(iCorFunction->QueryInterface(IID_ICorDebugFunction2, (LPVOID*) &iCorFunction2));
- BOOL JMCStatus;
- IfFailRet(iCorFunction2->GetJMCStatus(&JMCStatus));
-
- if (JMCStatus == FALSE)
- {
- stackFrame = StackFrame(threadId, level, "[External Code]");
- return S_OK;
- }
-
stackFrame = StackFrame(threadId, level, "");
ULONG32 ilOffset;
mdMethodDef methodToken;
IfFailRet(pFrame->GetFunctionToken(&methodToken));
+ ToRelease<ICorDebugFunction> pFunc;
+ IfFailRet(pFrame->GetFunction(&pFunc));
+
ToRelease<ICorDebugModule> pModule;
- IfFailRet(iCorFunction->GetModule(&pModule));
+ IfFailRet(pFunc->GetModule(&pModule));
ULONG32 nOffset = 0;
ToRelease<ICorDebugNativeFrame> pNativeFrame;
Assert.True(MIDebugger.IsEventReceived(filter), @"__FILE__:__LINE__"+"\n"+caller_trace);\r
}\r
\r
- public void WasExceptionBreakpointHitInExternalCode(string caller_trace, string excCategory, string excStage, string excName)\r
+ public void WasExceptionBreakpointHitInExternalCode(string caller_trace, string excCategory, string excStage, string excName, string extFrame)\r
{\r
Func<MIOutOfBandRecord, bool> filter = (record) => {\r
if (!IsStoppedEvent(record)) {\r
var frame = (MITuple)output["frame"];\r
var func = (MIConst)(frame["func"]);\r
\r
- if (func.CString == "[External Code]") {\r
+ if (func.CString == extFrame) {\r
return true;\r
}\r
\r
Context.Continue(@"__FILE__:__LINE__");\r
Context.WasBreakpointHit(@"__FILE__:__LINE__", "bp_test_2");\r
Context.Continue(@"__FILE__:__LINE__");\r
- Context.WasExceptionBreakpointHitInExternalCode(@"__FILE__:__LINE__", "clr", "throw", "System.Exception");\r
+ Context.WasExceptionBreakpointHitInExternalCode(@"__FILE__:__LINE__", "clr", "throw", "System.Exception", "MITestExceptionBreakpoint.outside_user_code.throw_Exception()");\r
Context.Continue(@"__FILE__:__LINE__");\r
Context.WasBreakpointHit(@"__FILE__:__LINE__", "bp_test_3");\r
Context.Continue(@"__FILE__:__LINE__");\r
- Context.WasExceptionBreakpointHitInExternalCode(@"__FILE__:__LINE__", "clr", "throw", "System.Exception");\r
+ Context.WasExceptionBreakpointHitInExternalCode(@"__FILE__:__LINE__", "clr", "throw", "System.Exception", "MITestExceptionBreakpoint.outside_user_code.throw_Exception_with_catch()");\r
\r
Context.DeleteExceptionBreakpoint(@"__FILE__:__LINE__", "21");\r
Context.AddExceptionBreakpoint(@"__FILE__:__LINE__", "throw", "System.NullReferenceException");\r
Context.Continue(@"__FILE__:__LINE__");\r
Context.WasBreakpointHit(@"__FILE__:__LINE__", "bp_test_5");\r
Context.Continue(@"__FILE__:__LINE__");\r
- Context.WasExceptionBreakpointHitInExternalCode(@"__FILE__:__LINE__", "clr", "throw", "System.NullReferenceException");\r
+ Context.WasExceptionBreakpointHitInExternalCode(@"__FILE__:__LINE__", "clr", "throw", "System.NullReferenceException", "MITestExceptionBreakpoint.outside_user_code.throw_Exception_NullReferenceException_with_catch()");\r
Context.Continue(@"__FILE__:__LINE__");\r
Context.WasBreakpointHit(@"__FILE__:__LINE__", "bp_test_6");\r
Context.Continue(@"__FILE__:__LINE__");\r
- Context.WasExceptionBreakpointHitInExternalCode(@"__FILE__:__LINE__", "clr", "throw", "System.NullReferenceException");\r
+ Context.WasExceptionBreakpointHitInExternalCode(@"__FILE__:__LINE__", "clr", "throw", "System.NullReferenceException", "MITestExceptionBreakpoint.outside_user_code.throw_NullReferenceException()");\r
\r
Context.DeleteExceptionBreakpoint(@"__FILE__:__LINE__", "22");\r
Context.AddExceptionBreakpoint(@"__FILE__:__LINE__", "user-unhandled", "*");\r
Context.Continue(@"__FILE__:__LINE__");\r
Context.WasBreakpointHit(@"__FILE__:__LINE__", "bp_test_11");\r
Context.Continue(@"__FILE__:__LINE__");\r
- Context.WasExceptionBreakpointHitInExternalCode(@"__FILE__:__LINE__", "clr", "throw", "System.Exception");\r
+ Context.WasExceptionBreakpointHitInExternalCode(@"__FILE__:__LINE__", "clr", "throw", "System.Exception", "MITestExceptionBreakpoint.outside_user_code.throw_Exception()");\r
Context.Continue(@"__FILE__:__LINE__");\r
Context.WasBreakpointHit(@"__FILE__:__LINE__", "bp_test_12");\r
Context.Continue(@"__FILE__:__LINE__");\r
- Context.WasExceptionBreakpointHitInExternalCode(@"__FILE__:__LINE__", "clr", "throw", "System.Exception");\r
+ Context.WasExceptionBreakpointHitInExternalCode(@"__FILE__:__LINE__", "clr", "throw", "System.Exception", "MITestExceptionBreakpoint.outside_user_code.throw_Exception_with_catch()");\r
Context.Continue(@"__FILE__:__LINE__");\r
Context.WasBreakpointHit(@"__FILE__:__LINE__", "bp_test_13");\r
Context.Continue(@"__FILE__:__LINE__");\r
Context.Continue(@"__FILE__:__LINE__");\r
Context.WasBreakpointHit(@"__FILE__:__LINE__", "bp_test_14");\r
Context.Continue(@"__FILE__:__LINE__");\r
- Context.WasExceptionBreakpointHitInExternalCode(@"__FILE__:__LINE__", "clr", "throw", "System.Exception");\r
+ Context.WasExceptionBreakpointHitInExternalCode(@"__FILE__:__LINE__", "clr", "throw", "System.Exception", "MITestExceptionBreakpoint.outside_user_code.throw_Exception()");\r
Context.Continue(@"__FILE__:__LINE__");\r
Context.WasBreakpointHit(@"__FILE__:__LINE__", "bp_test_15");\r
\r
throw new ResultNotSuccessException(@"__FILE__:__LINE__"+"\n"+caller_trace);\r
}\r
\r
- public void WasExceptionBreakpointHitInExternalCode(string caller_trace, string excCategory, string excMode, string excName)\r
+ public void WasExceptionBreakpointHitInExternalCode(string caller_trace, string excCategory, string excMode, string excName, string extFrame)\r
{\r
Func<string, bool> filter = (resJSON) => {\r
if (VSCodeDebugger.isResponseContainProperty(resJSON, "event", "stopped")\r
StackTraceResponse stackTraceResponse =\r
JsonConvert.DeserializeObject<StackTraceResponse>(ret.ResponseStr);\r
\r
- if (stackTraceResponse.body.stackFrames[0].name == "[External Code]")\r
+ if (stackTraceResponse.body.stackFrames[0].name == extFrame)\r
{\r
TestExceptionInfo(@"__FILE__:__LINE__"+"\n"+caller_trace, excCategory, excMode, excName);\r
return;\r
Context.Continue(@"__FILE__:__LINE__");\r
Context.WasBreakpointHit(@"__FILE__:__LINE__", "bp_test_2");\r
Context.Continue(@"__FILE__:__LINE__");\r
- Context.WasExceptionBreakpointHitInExternalCode(@"__FILE__:__LINE__", "CLR", "always", "System.Exception");\r
+ Context.WasExceptionBreakpointHitInExternalCode(@"__FILE__:__LINE__", "CLR", "always", "System.Exception", "VSCodeTestExceptionBreakpoint.outside_user_code.throw_Exception()");\r
Context.Continue(@"__FILE__:__LINE__");\r
Context.WasBreakpointHit(@"__FILE__:__LINE__", "bp_test_3");\r
Context.Continue(@"__FILE__:__LINE__");\r
- Context.WasExceptionBreakpointHitInExternalCode(@"__FILE__:__LINE__", "CLR", "always", "System.Exception");\r
+ Context.WasExceptionBreakpointHitInExternalCode(@"__FILE__:__LINE__", "CLR", "always", "System.Exception", "VSCodeTestExceptionBreakpoint.outside_user_code.throw_Exception_with_catch()");\r
\r
Context.ResetExceptionBreakpoints();\r
Context.AddExceptionBreakpointFilterAllWithOptions("");\r
Context.Continue(@"__FILE__:__LINE__");\r
Context.WasBreakpointHit(@"__FILE__:__LINE__", "bp_test_2");\r
Context.Continue(@"__FILE__:__LINE__");\r
- Context.WasExceptionBreakpointHitInExternalCode(@"__FILE__:__LINE__", "CLR", "always", "System.Exception");\r
+ Context.WasExceptionBreakpointHitInExternalCode(@"__FILE__:__LINE__", "CLR", "always", "System.Exception", "VSCodeTestExceptionBreakpoint.outside_user_code.throw_Exception()");\r
Context.Continue(@"__FILE__:__LINE__");\r
Context.WasBreakpointHit(@"__FILE__:__LINE__", "bp_test_3");\r
Context.Continue(@"__FILE__:__LINE__");\r
- Context.WasExceptionBreakpointHitInExternalCode(@"__FILE__:__LINE__", "CLR", "always", "System.Exception");\r
+ Context.WasExceptionBreakpointHitInExternalCode(@"__FILE__:__LINE__", "CLR", "always", "System.Exception", "VSCodeTestExceptionBreakpoint.outside_user_code.throw_Exception_with_catch()");\r
\r
Context.ResetExceptionBreakpoints();\r
Context.AddExceptionBreakpointFilterAllWithOptions("System.NullReferenceException");\r
Context.Continue(@"__FILE__:__LINE__");\r
Context.WasBreakpointHit(@"__FILE__:__LINE__", "bp_test_5");\r
Context.Continue(@"__FILE__:__LINE__");\r
- Context.WasExceptionBreakpointHitInExternalCode(@"__FILE__:__LINE__", "CLR", "always", "System.NullReferenceException");\r
+ Context.WasExceptionBreakpointHitInExternalCode(@"__FILE__:__LINE__", "CLR", "always", "System.NullReferenceException", "VSCodeTestExceptionBreakpoint.outside_user_code.throw_Exception_NullReferenceException_with_catch()");\r
Context.Continue(@"__FILE__:__LINE__");\r
Context.WasBreakpointHit(@"__FILE__:__LINE__", "bp_test_6");\r
Context.Continue(@"__FILE__:__LINE__");\r
- Context.WasExceptionBreakpointHitInExternalCode(@"__FILE__:__LINE__", "CLR", "always", "System.NullReferenceException");\r
+ Context.WasExceptionBreakpointHitInExternalCode(@"__FILE__:__LINE__", "CLR", "always", "System.NullReferenceException", "VSCodeTestExceptionBreakpoint.outside_user_code.throw_NullReferenceException()");\r
\r
Context.ResetExceptionBreakpoints();\r
Context.AddExceptionBreakpointFilterAllWithOptions("!System.Exception");\r
Context.Continue(@"__FILE__:__LINE__");\r
Context.WasBreakpointHit(@"__FILE__:__LINE__", "bp_test_5");\r
Context.Continue(@"__FILE__:__LINE__");\r
- Context.WasExceptionBreakpointHitInExternalCode(@"__FILE__:__LINE__", "CLR", "always", "System.NullReferenceException");\r
+ Context.WasExceptionBreakpointHitInExternalCode(@"__FILE__:__LINE__", "CLR", "always", "System.NullReferenceException", "VSCodeTestExceptionBreakpoint.outside_user_code.throw_Exception_NullReferenceException_with_catch()");\r
Context.Continue(@"__FILE__:__LINE__");\r
Context.WasBreakpointHit(@"__FILE__:__LINE__", "bp_test_6");\r
Context.Continue(@"__FILE__:__LINE__");\r
- Context.WasExceptionBreakpointHitInExternalCode(@"__FILE__:__LINE__", "CLR", "always", "System.NullReferenceException");\r
+ Context.WasExceptionBreakpointHitInExternalCode(@"__FILE__:__LINE__", "CLR", "always", "System.NullReferenceException", "VSCodeTestExceptionBreakpoint.outside_user_code.throw_NullReferenceException()");\r
\r
Context.ResetExceptionBreakpoints();\r
Context.AddExceptionBreakpointFilterUserUnhandled();\r
throw new ResultNotSuccessException(@"__FILE__:__LINE__"+"\n"+caller_trace);\r
}\r
\r
- public void WasExceptionBreakpointHitInExternalCode(string caller_trace, string excCategory, string excMode, string excName)\r
- {\r
- Func<string, bool> filter = (resJSON) => {\r
- if (VSCodeDebugger.isResponseContainProperty(resJSON, "event", "stopped")\r
- && VSCodeDebugger.isResponseContainProperty(resJSON, "reason", "exception")) {\r
- threadId = Convert.ToInt32(VSCodeDebugger.GetResponsePropertyValue(resJSON, "threadId"));\r
- return true;\r
- }\r
- return false;\r
- };\r
-\r
- Assert.True(VSCodeDebugger.IsEventReceived(filter), @"__FILE__:__LINE__"+"\n"+caller_trace);\r
-\r
- StackTraceRequest stackTraceRequest = new StackTraceRequest();\r
- stackTraceRequest.arguments.threadId = threadId;\r
- stackTraceRequest.arguments.startFrame = 0;\r
- stackTraceRequest.arguments.levels = 20;\r
- var ret = VSCodeDebugger.Request(stackTraceRequest);\r
- Assert.True(ret.Success, @"__FILE__:__LINE__"+"\n"+caller_trace);\r
-\r
- StackTraceResponse stackTraceResponse =\r
- JsonConvert.DeserializeObject<StackTraceResponse>(ret.ResponseStr);\r
-\r
- if (stackTraceResponse.body.stackFrames[0].name == "[External Code]")\r
- {\r
- TestExceptionInfo(@"__FILE__:__LINE__"+"\n"+caller_trace, excCategory, excMode, excName);\r
- return;\r
- }\r
-\r
- throw new ResultNotSuccessException(@"__FILE__:__LINE__"+"\n"+caller_trace);\r
- }\r
-\r
public Context(ControlInfo controlInfo, NetcoreDbgTestCore.DebuggerClient debuggerClient)\r
{\r
ControlInfo = controlInfo;\r