summaryrefslogtreecommitdiff
path: root/src/unwinder
AgeCommit message (Collapse)AuthorFilesLines
2019-09-24Fix OOPStackUnwinderX86::Unwind crash when Eip is invalidIgor Kulaychuk1-1/+1
2019-05-10Move EventProvider native layout to be driven by CMake configure (#24478)Jeremy Koritzinsky2-0/+2
* Generate eventpipe implementation as part of CMake configure. * Generate Etw provider as part of CMake configure. * First pass porting over lttng provider to cmake. * Fix up CMake Lttng provider generation. * Move Lttng provider into CMake tree. * Move dummy event provider to CMake * Move genEventing into the CMake tree. * Remove extraneous logging and unused python locator. * Clean up build.sh * Clean up genEventingTests.py * Add dependencies to enable more incremental builds (providers not fully incremental). * Convert to custom command and targets instead of at configure time. * Get each eventing target to incrementally build. * Fix incremental builds * Add missing dependencies on eventing headers. * PR Feedback. Mark all generated files as generated * Clean up eventprovider test CMakeLists
2019-02-24Fix comparison and narrowing errors reported by GCCAdeel1-1/+1
2019-02-22More GNUC Fixes (#22687)Sinan Kaya1-3/+3
* Replace __sync_swap with __atomic_exchange_n __sync_swap() is a clang specific function. * Remove multiline comment * Add paranthesis around sum src/md/hotdata/../inc/streamutil.h:73:34: warning: suggest parentheses around ‘+’ in operand of ‘&’ [-Wparentheses] UINT32 aligned = *totalBytes + 3 & ~3; * Define __int64 * Define windows types for tests * Remove undefined has_builtin defines and define alloca and inline for GNUC * Remove __clang__ where possible * Add implicit casting to help compiler find WCHAR* variant src/binder/assembly.cpp:294:73: error: no matching function for call to ‘SString::SString(SString)’ return (pAsmName == nullptr ? nullptr : pAsmName->GetSimpleName()); ^ In file included from src/inc/sstring.h:1082:0, from src/inc/ex.h:19, from src/inc/stgpool.h:28, from src/inc/../md/inc/metamodel.h:18, from src/inc/../md/inc/metamodelro.h:19, from src/inc/metadata.h:17, from src/binder/../vm/util.hpp:19, from src/binder/../vm/common.h:110, from src/binder/assembly.cpp:14: src/inc/sstring.inl:73:8: note: candidate: SString::SString(void*, COUNT_T) inline SString::SString(void *buffer, COUNT_T size) ^ src/inc/sstring.inl:73:8: note: candidate expects 2 arguments, 1 provided src/inc/sstring.inl:436:8: note: candidate: SString::SString(SString::tagLiteral, const WCHAR*, COUNT_T) inline SString::SString(tagLiteral dummytag, const WCHAR *literal, COUNT_T count) ^ src/inc/sstring.inl:436:8: note: candidate expects 3 arguments, 1 provided src/inc/sstring.inl:418:8: note: candidate: SString::SString(SString::tagLiteral, const WCHAR*) inline SString::SString(tagLiteral dummytag, const WCHAR *literal) ^ src/inc/sstring.inl:418:8: note: candidate expects 2 arguments, 1 provided src/inc/sstring.inl:401:8: note: candidate: SString::SString(SString::tagUTF8Literal, const UTF8*) inline SString::SString(tagUTF8Literal dummytag, const UTF8 *literal) ^ src/inc/sstring.inl:401:8: note: candidate expects 2 arguments, 1 provided src/inc/sstring.inl:382:8: note: candidate: SString::SString(SString::tagLiteral, const CHAR*) inline SString::SString(tagLiteral dummytag, const ASCII *literal) * Reorder DLLEXPORT and STDAPI GNUC wants extern "C" <attribute> format. * Abstract __FUNCSIG__ * Abstract __debugbreak() * Move common compiler options out of clang and add Wno-unused-value * Add paranthesis around || and && src/gc/gc.cpp:9084:38: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses] (!chosen_power2) && (i < free_space_count)); * Set Wno-delete-non-virtual-dtor for CXX files only * Don't warn on unterminated endif labels * Suppress unused functions * Use 0x syntax rather than h syntax on GNU asm files * Correct constructor call directly src/ToolBox/superpmi/superpmi-shared/logging.cpp:301:27: required from here src/inc/clr_std/string:58:9: error: cannot call constructor ‘std::basic_string<char>::basic_string’ directly this->basic_string::basic_string(_Ptr, c_len(_Ptr)); * Suppress NULL used in arithmetic warnings
2018-06-03Warnings cleanup (#18260)Robin Sue2-5/+0
* Cleanup all disabled warnings that do not trigger * Fix warning about line continuation in single line comment * Eliminiate all unreferenced local variables and reenable warning
2018-05-24Fix a variety of typos (#18096)John Doe1-2/+2
* absense -> absence * aboring -> aborting * absense -> absence * absoute -> absolute * absoute -> absolute * abstration -> abstraction * dwDesiredAcces -> dwDesiredAccess * accees -> access * accesed -> accessed * accessability -> accessibility * accessable -> accessible * accidentaly -> accidentally * accesible -> accessible * accommondate -> accommodate * accurancy -> accuracy * accuratley -> accurately * Achitecture -> Architecture * acompannying -> accompanying * acordingly -> accordingly
2018-02-17delete unused mirror files (#16423)Sergey Andreenko9-9/+0
2017-07-25typo (#13026)github-john-doe1-1/+1
2017-07-07[ARM/Linux] Enable DacStackWalkJonghyun Park1-9/+5
For ARM/Linux, DacUnwindStackFrame failed to unwind stack frame due to the mismatch between RUNTIME_FUNCTION and IMAGE_ARM_RUNTIME_FUNCTION_ENTRY. ClrStack SOS command currently does not work due to this bug. This commit fixes this mismatch and re-enables ClrStack SOS command.
2017-05-17[x86/Linux] Port 'DacUnwindStackFrame' (#11666)Jonghyun Park2-31/+59
* [x86/Linux] Implement 'DacUnwindStackFrame' * Update ContextPointers using ContextRecord * An attempt to fix x86/Windows build error
2017-04-24[x86/Linux] Remove unnecessary ResumeEsp field (#11167)Jonghyun Park1-15/+1
2017-04-10[x86/Linux] Set ResumeEsp as Caller Sp when unwond to native frame (#10838)Jonghyun Park1-1/+3
2017-04-04[x86/Linux] Correctly unwind esp frames (#10685)Jonghyun Park1-1/+1
2017-03-06[x86/Linux] Stack align aware unwinder (#9928)Jonghyun Park1-2/+13
2017-02-18[ARM64] Use PT_KNONVOLATILE... for crossSteve MacLean, Qualcomm Datacenter Technologies, Inc1-23/+23
In order to enable cross compilation support, ARM64 needs to use PT_KNONVOLATILE_CONTEXT_POINTERS
2017-02-17[ARM64/Unix] (#9500)Steve MacLean1-13/+36
* [Arm64/Unix] Update arm64 *.S files to match *.asm * [Arm64/Unix] Fix CONTEXTToNativeContext() * [Arm64/Unix] ThrowExceptionFromContextInternal * [Arm64/Unix] Preserve x8 argument register * [ARM64/Unix] Add CFI directives Add native unwind info * [Arm64/Unix] Fix RtlRestoreContext * [Arm64/Unix] Restore FP from CurrentContextPointers * [Arm64/Unix] fix pointer math * [Arm64/Unix] Fix CallDescrWorkerInternal personality * [Arm64/Unix] More Fp fixups * [Arm64/Unix] CallEHFunclet machine state Restore non-volatile machine state in CallEHFunclet * [Arm64/Unix] CallDescrWorkerInternal Use empty stack slot to save argument * [Arm64/Unix] RtlVirtualUnwind update pointers * [Arm64] LazyMachState fixes * [Arm64/Unix] disable USE_REDIRECT_FOR_GCSTRESS When FEATURE_PAL is enableds USE_REDIRECT_FOR_GCSTRESS is not supported * [Arm64] ClearRegDisplayArgumentAndScratchRegisters() * [Arm64] Remove unnecesary copy in TransitionFrame * [Arm64/Unix] Fix comment per review * [Arm64/Unix] move constants per review * [Arm64/Unix] Use ldp per review Also fix indentation * [Arm64/Unix] Fix indentation per review * [Arm64/Unix] Remove m_Unwound per review comments * [Arm64/Unix] Use PREPARE_EXTERNAL_VAR to access globals * [Arm64/Unix] Fix more whitespace per earlier review comments
2017-02-17[x86/Linux] Fix GetCallerSp (#9384)Jonghyun Park1-1/+3
* [x86/Linux] Fix GetCallerSp * Do NOT pop stack argument for TransitionFrame * Add ResumeEsp to CONTEXT
2017-02-02[x86/Linux] Set Establisher Frame Pointer as Caller SP (#9264)Jonghyun Park1-1/+4
2017-02-02[x86/Linux] Do NOT use pXXX fields (#9121)Jonghyun Park1-28/+12
* [x86/Linux] Do NOT use pXXX fields * Fix x86/Windows build error * Fix another x86/Windows build error * Fix typo * Do NOT trash EBP * Reflect the original semantics of EHContext::UpdateFrame * Unify ReadXXX/LocateXXX into GetXXXLocation, and RestoreXXX/TrashXXX into SetXXXLocation * Revert the order of pXXX fields * Revise cgenx86.cpp * Revert unnecessary changes * Remove direct accesses to CALLEE_SAVED_REGISTERS_TAG * Do NOT update pCurrentContext inside SetXXXLocation * Update RegPtr via offset * Unify REG_METHODS (and revise UpdateRegDisplay methods accordingly) * Revise per feedback * Fix x86/Windows build error
2017-01-24[x86/Linux] Fix EH Region Mismatch (#9043)Jonghyun Park1-0/+2
2017-01-23Rename Esp in x86 REGDISPLAY as SP (#9070)Jonghyun Park1-2/+2
* Rename Esp in x86 REGDISPLAY as SP * Fix x86/Windows build error
2017-01-18[x86/Linux] Port RtlVirtualUnwind (#8911)Jonghyun Park3-6/+242
* [x86/Linux] (Partially) port RtlVirtualUnwind * Rewrite x86 Unwinder using UnwindStackFrame * Extract UnwindStackFrame from EECodeManager * Port 'InlinedCallFrame::UpdateRegDisplay'
2016-12-26Remove files related to legacy build system (#8723)Robert6-140/+0
2016-08-23Initial commit to build Win32 Arm CoreCLRGaurav Khanna1-1/+2
2016-04-18enable build of cross target components.Rahul Kumar1-24/+0
Currently only enabled for arm64
2016-04-05Fix #1977: always create RBP chains on UnixBruce Forstall1-2/+62
The JIT will now always create RBP chains on Unix platforms. This includes in functions the use localloc. To do this, the VM is extended with a new Unix-only AMD64 unwind code: UWOP_SET_FPREG_LARGE. The existing unwind code which is used to establish a frame pointer, UWOP_SET_FPREG, requires that the frame pointer, when established, be no more than 240 bytes offset from the stack pointer. This doesn't work well for frames that use localloc. (Large frames without localloc are ok, because we don't report the frame pointer in the unwind info except for in functions with localloc or EnC.) The new unwind code has a 32-bit range. If used, UNWIND_INFO.FrameRegister must be set to the frame pointer register, and UNWIND_INFO.FrameOffset must be set to 15 (its maximum value). This code is followed by two UNWIND_CODEs that are combined to form its 32-bit offset. The high 4 bits must be zero. This offset is then scaled by 16. This result is used as the FP register offset from SP at the time the frame pointer is established.
2016-03-30Getting SOS to work on ARm64:Rama Krishnan Raghupathy4-8/+8
This mainly involved DACizing the VM code. A bulk edit for changing RUNTIME_FUNCTION to T_RUNTIME_FUNCTION [tfs-changeset: 1591667]
2016-01-31Stop defining WIN32 in Unix buildsJan Kotas1-4/+0
WIN32 was defined for 32-bit Unix builds in number of places which is incorrect. It caused build break in lldb header since they use WIN32 define for Windows-specific code.
2016-01-27Update license headersdotnet-bot11-44/+33
2016-01-21FIx the incremental build for WindowsJan Vorlicek3-3/+3
Conflicts: build.cmd src/dlls/clretwrc/CMakeLists.txt Cleanup
2015-12-15Build arm64 using private toolsetRahul Kumar1-20/+3
Successfully builds all binaries except sos.dll & x64 binaries
2015-08-31 The UPDATE_CONTEXT_POINTERS actually breaks lots of debuggers tests. The ↵Zhicheng Zhu1-19/+23
root problem is that when arm unwind the stack, we will call this function hr = RtlpUnwindFunctionFull(pContext->Pc - (ULONG)ImageBase, (ULONG)ImageBase, &Rfe, pContext, &DummyEstablisherFrame, &DummyHandlerRoutine, &DummyHandlerData, NULL); <-- UnwindParams This will set UnwindParams as NULL, and eventually passed to UPDATE_CONTEXT_POINTERS and UPDATE_FP_CONTEXT_POINTERS in RtlpPopRegisterMask. This will generate the AV. The fix is just simply checking the whether the Params is NULL or not. [tfs-changeset: 1520758]
2015-08-04Enable the Windows x86 buildMike Danes2-2/+10
This allows building the Windows x86 version of CoreCLR by using "x86" for the BuildArch parameter of build.cmd. Note that CMAKE_SYSTEM_PROCESSOR is no longer used in Windows builds to set IS_64BIT_BUILD. This change is enough to get CoreCLR to build but more changes are required for it to actually run correctly. In particular, the JIT compiler support for x86 is pretty limited at this point.
2015-08-03Fix build break on Windows ARMJan Kotas1-4/+4
[tfs-changeset: 1509827]
2015-07-31Merge pull request #1285 from benpye/linux-arm-stack-unwindingJan Vorlicek1-9/+67
Add unwinding for the ARM Linux platform
2015-07-31Modify unwinder to provide RtlVirtualUnwind.Ben Pye1-9/+67
Use PAL_VirtualUnwind on Linux ARM Add assembler annotation for unwinding
2015-07-30[aarch64] Address code review feedback and disable EmitGetThreadInlined on ↵Geoff Norton1-6/+6
PAL for now
2015-07-27[aarch64] Initial aarch64/linux bring upGeoff Norton3-7/+85
2015-07-24Add ARM target for CoreCLR on Linux.Ben Pye3-37/+71
c_runtime/vprintf/test1 is disabled as casting NULL to va_list is against the C specification. Fix SetFilePointer tests on 32 bit platforms. Define _FILE_OFFSET_BITS=64 so that we have long file support on 32 bit platforms. Implement context capture/restore for ARM. Link libgcc_s before libunwind on ARM so C++ exceptions work. Translate armasm to gas syntax. Specify Thumb, VFPv3, ARMv7 for the ARM target. Add ARM configuration to mscorlib build Implement GetLogicalProcessorCacheSizeFromOS in PAL. Set UNWIND_CONTEXT_IS_UCONTEXT_T from configure check.
2015-03-26Fix about 12 kinds of warnings over the codebaseJan Vorlicek1-2/+2
This change fixes: 1) Member initiazalization order in class constructor didn't correspond to the member order in some classes 2) Objects with vtables were copied via memcpy. While this is intentional, cast of the pointers to void* is required to silence clang warning 3) Switch case statements containing values of different enums 4) Casting int to pointer 5) Missing return value in methods with _ASSERTE 6) Class name classifier on methods in the .h 7) Invalid position of the DECLSPEC_ALIGN at few places - it had no effect 8) Invalid position of the 'used' attribute 9) Issue with comparing holders to NULL 10) Operator 'new' returning NULL without being marked with throw() or noexcept 11) Variables marked as 'extern' at the declaration / initialization place 12) Data structure declared as struct at one place and forward declared as class at another Some disabled warnings were no longer happening, so options to disable them were removed too
2015-03-06Add a fourth parameter to the DEFINE_DACVAR macro that is the actual fully ↵Mike McLaughlin1-3/+1
qualified name of the static/global. First pass at the global DAC table support for Linux. Explicitly build the table in the coreclr module instead of extract it from the pdb and put it in a resource. Fixed the SVR gc globals in the DAC table. They had to be seperated and initialized in gceesvr.cpp. Start on global pointer table. PAL functions to write and read the DAC table address between processes. The dac table is now copied from the coreclr process to the DAC/debugger process. The tables were not being built with exactly the same defines so they weren't the same size. Fixed a bug in the read memory implementation. Still assumes pid = 0. Changed the dacTable entries to be RVAs and renabled getting the corclr module base addres (m_globalBase). Added dac table address file cleanup on coreclr shutdown. Filled in the vtable entries in the global dac table. Changed some of the VPTR_* macros to be defined on the coreclr side (RS) to defined a constructor that is used to get the vtable in dactable.cpp. These changes required default constructors to be added to some of the classes. Changed getting the vtable address to not invoke the destructors since the constructor used didn't do anything (like initialize variables, etc.). Added a TODO comment about the debuggee pid not being available in the dac table address file name. Fixed Windows build. Created a couple of new VPTR_* macros that add a default constructor only if building coreclr (not DAC) on Linux. Comment on how these DAC table functions are temporary.
2015-02-15Merge remote-tracking branch 'upstream/master' into soscommand1Mike McLaughlin8-846/+1330
2015-02-13Modify the windows amd64 unwinder to work as jitted code unwinder on UnixJan Vorlicek8-846/+1330
Update the windows amd64 unwinder from its source to the latest version and add context pointers updating that was excluded before. Change methods of the OOPStackUnwinder and OOPStackUnwinderAMD64 to be static, since the base class has no data members and the unwinding is always using the processor specific subclass. Modify the code so that it is built in two flavors. The first one is the DAC flavor which is used by the debugger. The second one will be used for jitted code stack frames unwinding on non-Windows systems.
2015-02-12These changes are the beginning of the SOS for coreclr under lldb. It isn't ↵mikem83611-0/+5
finished or working yet. The sos plug in is broken into two modules: 1) The lldb plugin (sosplugin) module that is built with the lldb h and lib files. This module dynamically loads the sos module and finds the subcommand argument as a symbol export like windbg does for it's extensions. So "sos IP2MD 0x100000" loads sos, finds the export "IP2MD" and calls it with the rest of the command and a "IDebugClient" instance. This instance is a small subset of the the various dbgeng's API's implemented under lldb without any COM to keep things simple. OPEN ISSUE: This module's build depends on the lldb API includes and the lldb library. Need to figure out the best way to deal with the dependency on the lldb source. 2) The sos module (sos) module that is the strike source built under linux. Currently only the IP2MD command is built and the support/utility functions it needs. It dynamically loads the DAC (libmscordaccore.so) and queries the IXCLRDataProcess interface via the DAC's CLRDataCreateInstance export. OPEN ISSUE: Where and how to search for the sos/dac modules. Currently have a hard coded path to the binaries. It probably should be the directory the plug in (sosplugin) is loaded.
2015-02-03Move the windows unwinder code out of the debug folder.Jan Vorlicek28-0/+6385
It is a preparation for using the DAC unwinder code as an unwinder for the jitted code on Linux, because the jitter generates windows style unwind info. The unwinder is build as a static library and linked to mscordac. [tfs-changeset: 1409640]