[x86/Linux] Fix SIGSEGV on Debugger.Break() during debugging. tizen_6.0_hotfix accepted/tizen/6.5/unified/20211028.225403 accepted/tizen/unified/20210923.052934 submit/tizen/20210922.225908 submit/tizen_6.0_hotfix/20210922.230120 submit/tizen_6.5/20211028.163301 tizen_6.5.m2_release
authorMikhail Kurinnoi <m.kurinnoi@samsung.com>
Mon, 20 Sep 2021 15:20:04 +0000 (08:20 -0700)
committerAlexander Soldatov/Platform Lab /SRR/Staff Engineer/Samsung Electronics <soldatov.a@samsung.com>
Tue, 21 Sep 2021 17:15:46 +0000 (20:15 +0300)
SIGSEGV occur in src/vm/i386/cgenx86.cpp `HelperMethodFrame::UpdateRegDisplay()` at line `pRD->pCurrentContext->Eip = pRD->ControlPC = m_MachState.GetRetAddr();`, since `pRD->pCurrentContext` is NULL.
The point of issue - wrong code block compilation in DebuggerWalkStack() in case of Linux x86.

src/debug/ee/frameinfo.cpp

index 3efbddd..a4741df 100644 (file)
@@ -2097,7 +2097,7 @@ StackWalkAction DebuggerWalkStack(Thread *thread,
 #endif
             memset((void *)&data, 0, sizeof(data));
 
-#if defined(_TARGET_X86_)
+#if !defined(WIN64EXCEPTIONS)
             // @todo - this seems pointless. context->Eip will be 0; and when we copy it over to the DebuggerRD,
             // the context will be completely null.
             data.regDisplay.ControlPC = context->Eip;