diff options
author | Konstantin Baladurin <k.baladurin@partner.samsung.com> | 2017-10-05 11:31:44 +0300 |
---|---|---|
committer | Jan Vorlicek <janvorli@microsoft.com> | 2017-10-05 10:31:44 +0200 |
commit | de4daccc1ea52ddc1ae8ac9e48cde603c507b868 (patch) | |
tree | c8bf3f40f838811fd4410123fc3e869dc4475cde /src/debug/di/rsthread.cpp | |
parent | d0baa73f54eb0f7eba1364e207c02afa984760cb (diff) | |
download | coreclr-de4daccc1ea52ddc1ae8ac9e48cde603c507b868.tar.gz coreclr-de4daccc1ea52ddc1ae8ac9e48cde603c507b868.tar.bz2 coreclr-de4daccc1ea52ddc1ae8ac9e48cde603c507b868.zip |
[x86/Linux][SOS] Fix clrstack command of lldb sosplugin on x86 (#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.
Diffstat (limited to 'src/debug/di/rsthread.cpp')
-rw-r--r-- | src/debug/di/rsthread.cpp | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/src/debug/di/rsthread.cpp b/src/debug/di/rsthread.cpp index 02fae00b0f..aa85de83d8 100644 --- a/src/debug/di/rsthread.cpp +++ b/src/debug/di/rsthread.cpp @@ -1471,7 +1471,15 @@ void CordbThread::Get32bitFPRegisters(CONTEXT * pContext) FLOATING_SAVE_AREA currentFPUState; +#ifdef _MSC_VER __asm fnsave currentFPUState // save the current FPU state. +#else + __asm__ __volatile__ + ( + " fnsave %0\n" \ + : "=m"(currentFPUState) + ); +#endif floatarea.StatusWord &= 0xFF00; // remove any error codes. floatarea.ControlWord |= 0x3F; // mask all exceptions. @@ -1482,12 +1490,22 @@ void CordbThread::Get32bitFPRegisters(CONTEXT * pContext) // @dbgtodo Microsoft crossplat: the conversion from a series of bytes to a floating // point value will need to be done with an explicit conversion routine to unpack // the IEEE format and compute the real number value represented. - + +#ifdef _MSC_VER __asm { fninit frstor floatarea ;; reload the threads FPU state. } +#else + __asm__ + ( + " fninit\n" \ + " frstor %0\n" \ + : /* no outputs */ + : "m"(floatarea) + ); +#endif unsigned int i; @@ -1498,11 +1516,21 @@ void CordbThread::Get32bitFPRegisters(CONTEXT * pContext) m_floatValues[i] = td; } +#ifdef _MSC_VER __asm { fninit frstor currentFPUState ;; restore our saved FPU state. } +#else + __asm__ + ( + " fninit\n" \ + " frstor %0\n" \ + : /* no outputs */ + : "m"(currentFPUState) + ); +#endif m_fFloatStateValid = true; m_floatStackTop = floatStackTop; |