[x86/Linux][SOS] Fix clrstack command of lldb sosplugin on x86 (dotnet/coreclr#13973)
authorKonstantin Baladurin <k.baladurin@partner.samsung.com>
Thu, 5 Oct 2017 08:31:44 +0000 (11:31 +0300)
committerJan Vorlicek <janvorli@microsoft.com>
Thu, 5 Oct 2017 08:31:44 +0000 (10:31 +0200)
commit7e2a8e0f490a539f77437d1ca3e14b613837132c
treee80e3f4d1237bc8cec60cafbeac08acd1f2a58af
parent07dbb51ede8b087328a294be9c2450764d8513b5
[x86/Linux][SOS] Fix clrstack command of lldb sosplugin on x86 (dotnet/coreclr#13973)

* [x86/Linux][SOS] Add support for x86 in GetContextFromFrame

It's need for 'clrstack -f' command of SOS plugin on x86.

* [x86/Linux] Fix RtlpGetFunctionEndAddress function

We should use PTR_UNWIND_INFO instead of PUNWIND_INFO for pointer to
UNWIND_INFO structure because it's pointer from other process and
we need to use DAC to read data using it.

* [x86/Linux][SOS] Define DEBUG_STACK_CONTEXT for x86

It's needed for 'clrstack -f' command in libsosplugin.

* [x86/Linux] Fix undefined references in libmscordbi.so on x86

Asm block like following:
__asm fnsave currentFPUState

where currentFPUState is structure works with MSVC but leads to
undefined reference currentFPUState in the binary with other
compilers. So rewrite such asm blocks for them.

This patch fixes error "Unable to load 'libmscordbi.so'" during
execution of 'clrstack -f' command of SOS plugin on x86.

* [x86/Linux] Fix calling convention inconsistency

WINAPI and STDAPI are defined as __cdecl but in some cases functions
with these attributes are called using stdcall calling convention.

It leads to crashes during execution of 'clrstack -i' command of
SOS plugin on x86.

Commit migrated from https://github.com/dotnet/coreclr/commit/de4daccc1ea52ddc1ae8ac9e48cde603c507b868
src/coreclr/src/ToolBox/SOS/Strike/strike.cpp
src/coreclr/src/ToolBox/SOS/lldbplugin/services.cpp
src/coreclr/src/debug/di/rsthread.cpp
src/coreclr/src/debug/di/valuehome.cpp
src/coreclr/src/debug/shim/debugshim.cpp
src/coreclr/src/dlls/mscordbi/mscordbi.cpp
src/coreclr/src/inc/clrnt.h