summaryrefslogtreecommitdiff
path: root/src/debug
AgeCommit message (Collapse)AuthorFilesLines
2016-11-29Disable CER feature as it is not used (#8218)John Chen2-0/+9
Use FEATURE_CER to scope CER code, and disable CER feature in CoreCLR.
2016-11-28[x86/Linux] Fix error variable 'td' is uninitialized (#8299)SaeHie Park1-1/+1
Fix compile error for x86/Linux - make compiler happy with initialize variable 'td' with 0.0
2016-11-26Fix building CoreCLR with Clang 3.9 (#8311)Jan Vorlicek7-6/+12
There were few constructs that Clang 3.9 didn't like due to its strict C++ standard conformance rules.
2016-11-22[x86/Linux] fix and add for x86 cmake configuration (#8219)SaeHie Park2-3/+71
This patch will add x86 part for cross build - add x86 in build-rootfs and related cross files - add x86 parts in CMakeLists.txt to pass configuration - add required source files to pass configuration
2016-11-21Remove unsafe banned functions (#8162)Jan Vorlicek1-4/+6
This change removes _snwprintf, _snprintf and _vsnwprintf usage from CoreCLR and their implementations from PAL. PAL exposes their secure variants instead and CoreCLR now uses those instead. I have also removed the StringCchPrintfA/W, StringCchVPrintfA/W, StringCbVPrintfA/W, StringCbPrintfA/W, StringCbPrintfExA/W, StringCchVPrintfExA/W, StringCbVPrintfExA/W and StringCchPrintfExA/W replaced their usage by the secure variants of the sprintf functions, since they were used at only few places and implementing all of the variants using the secure sprintf variants would be a hassle. I also needed to fix a missing support for size modifiers for %p formatting character and for wide characters / strings in the secure sprintf functions that was revealed by the PAL tests. I have also removed a bunch of PAL tests that were using %n formatting character which was not implemented since it is considered unsafe and translated PAL tests that were using the removed functions to use the safe variants of those.
2016-11-07Reduce variable scopeDmitry-Me1-2/+1
2016-11-02Fix race condition (#7928)Dmitry-Me1-7/+7
2016-11-02Check pointer before dereferencing it (#7930)Dmitry-Me1-2/+2
2016-11-01Fix build break 814276: FEATURE_SPAN_OF_T disabled in runtime but enabled in DACJohn Chen1-0/+6
[tfs-changeset: 1636322]
2016-10-27Fix exception.StackTrace race condition. Issue #12467. (#7856)Mike McLaughlin1-20/+23
2016-10-21Initialize member variable (#7737)Dmitry-Me1-1/+1
2016-10-19Remove misleading check (#7654)Dmitry-Me1-7/+6
2016-10-17Fix broken #elif (#7656)Dmitry-Me1-1/+1
2016-10-16Don't return pointer to already deleted object (#3483)Dmitry-Me1-0/+1
2016-10-14NullReferenceException APIs (#7338)Sven Boemer7-28/+621
* add typeID APIs * add variable home API
2016-10-14Clarify code with unobvious precedence (#1624)Dmitry-Me1-1/+6
2016-10-02Fix a bug where the DAC read four more bytes than necessary (#7430)Sean Gillespie1-16/+4
to retrieve gcHeapType, which failed on crash dumps.
2016-09-22Fix Unable to step through Visual Studio remote debugger with coreclr ↵Mike McLaughlin2-0/+33
executables on Nano Server (#7317) Needed to add back a dummy version of ICorDebugLegacyNetCFHostCallbackInvoker_PrivateWindowsPhoneOnly interface so VS doesn't get the QI failure and stop working by not calling the "Continue" method. Issue #7316
2016-09-22[GDB/JIT] Add support for lldb step-over command on managed code (#7273)Dmitri-Botcharnikov1-0/+3
2016-09-14Implement GcInfo v2 for X86Swaroop Sridhar1-3/+5
This commit includes the following changes: 1) Thread GcInfo version through X86 specific APIs 2) Add ReturnKind and ReversePinvokeOffset fields to InfoHdr structure GcInfo v1 and v2 use the same InfoHdr structures, because: InfoHdrSmall: ReturnKind is encoded within previously unused bits. InfoHdr: revPInvokeOffset will never be written to the image, since ReversePinvokeOffset==INVALID_REV_PINVOKE_OFFSET for V1. 3) Update the Pre-computed header table to include bits for the above [The default setting of ReturnKind=RT_Scalar is used for all entries in the table. Optimizing this table based in most frequent usage scenarios is to be done separately] 4) Change the GC encoder/decoder to handle the above two fields 5) Use the ReturnKind in the GCInfo from thread-suspension code. GcInfo version is changed for CoreCLR X86 only, not for Desktop JIT Fixes #4379
2016-09-09Only reference IGCHeap::gcHeapType when FEATURE_SVR_GC is definedSean Gillespie1-0/+8
2016-09-08Merge pull request #6764 from swgillespie/gc-interface-3Sean Gillespie5-46/+54
Move the GC behind an interface and use that interface in the VM
2016-09-08Introduce an interface separating the GC and the VM,Sean Gillespie5-46/+54
modifying the VM to utilize this interface. Introduce an interface separating the GC and the rest of the VM Remove static members of both IGCHeap and IGCHeapInternal and move the management of the singular GC heap to the VM. Rename uses of IGCHeap in the VM to GCHeapHolder, as well as other misc. renames throughout the VM and GC. Split each interface function into categories, document them, use consistent formatting across the interface Undo some accidental find/replace collateral damage Remove all ifdefs from the GC interface Deduplicate function declarations between IGCHeap and IGCHeapInternal, expose AllocAlign8 through the interface and the reference to alloc_context to repair the ARM build Paper cut: false -> nullptr Repair the ARM and x86 builds Rename GCHeapHolder -> GCHeapUtilities and address documentation feedback Rebase against master Rename gcholder.h/cpp -> gcheaputilities.h/cpp Fix an uninitialized field on alloc_context causing test failures on clang Rename the include guard for gcheaputilities.h Un-breaks SOS by making the following changes: 1) Instructs the DAC to look for IGCHeap::gcHeapType by name, instead of assuming that it exists near g_pGCHeap, 2) Eliminate all virtual calls on IGCHeap in the DAC, since we cannot dispatch on an object in another process, 3) Because of 2, expose the number of generations past the GC interface using a static variable on IGCHeap that the DAC can read directly. repair the Windows build
2016-08-31Fix funceval of a function returning 16 byte value type. (#6997)Mike McLaughlin3-28/+27
On Linux and OS X, structs less or equal to 16 bytes (instead of 8 bytes on Windows) are enregistered. Only 8 bytes is being passed back to debugger during a funceval of a property or method that returns a 16 byte value type. To fix this, the 16 byte return value (which is only used for enregistered structures of that size on xplat) needed to be plumbed from CallTargetWorker through the MethodDescCallSite macros to the func eval code. The func eval code needed to also deal with 16 byte results. NUMBER_RETURNVALUE_SLOTS is the number of ARG_SLOTs that will contain the maximum enregistered return value. CordbEval:m_result is now ARG_SLOT[NUMBER_RETURNVALUE_SLOTS]. CallTargetWorker is now passed a pointer and the count of bytes to/of the return value buffer. Minor fix to SOS SymbolReader function.
2016-08-24Some minor changes.Gaurav Khanna1-1/+1
2016-08-23Initial commit to build Win32 Arm CoreCLRGaurav Khanna1-18/+38
2016-08-19Create SOS SymbolReader managed project and change SOS to use it. (#6783)Mike McLaughlin2-5/+62
* Change SOS to use wrapper class that is now in System.Diagnostics.StackTrace. The portable PDB helper code for SOS source/line support has been moved from System.Diagnostics.Debug.SymbolReader to a new managed SOS project in the coreclr repo called SOS.NETCore. The public APIs have now been made internal. Plumb through the loaded PE address to the managed SymbolReader functions so it can be used as a key. Fixed a stack trashing/overflow when a unresolved managed breakpoint is resolved because one of the module name buffers was too small (MAX_PATH_FNAME). Changed it (and others) to MAXLONGPATH. SOS now works with Portable PDBs on Windows. New dac private get module data request. Used to get the necessary info for portable PDBs. SOS now supports in-memory PE's on xplat and Windows. Needed to get and plumb though the in-memory PE layout where it is file based or loaded. Better Windows GetLineByILOffset support. Uses the SymbolReader and now works with in-memory PEs. Misc code formatting and general cleanup. * Code review feedback.
2016-08-10Merge pull request #6606 from rahku/arm64todoRahul Kumar1-1/+1
ARM64: Fix for ARM64TODO
2016-08-10ARM64: Fix for ARM64TODORahul Kumar1-1/+1
2016-08-08Merge pull request #6582 from alsemenn/fixrefregSasha Semennikov1-2/+5
For helper method frame DAC doesn't read register pointers. So set them to NULL to not use "wrong" data.
2016-08-05Implement GcInfo v2Swaroop Sridhar1-2/+4
Ref #4379 This change implements GcInfo version 2 for all platforms that use the GcInfo library (all architectures other than X86). Changes are: 1) Defines ReturnKind enumeration for all platforms 2) Change the GcInfo encoder library to encode the ReturnKind and ReversePInvokeFrame slot 3) Change the CM's GcInfo decoder to encode the ReturnKind and ReversePInvokeFrame slot for GCINFO_VERSION 2 4) Some corrections to GCINFO_MEASUREments 5) Changes to RYU Jit to provide the correct information to the encoder 6) Changes to the VM to use the ReturnKind information while hijacking a thread - If ReturnKind is available from GcInfo, new hijack routines are used - Otherwise, fall back to old method (for compatibility) 7) Rework and simplify the thread hijack routines by scanning HijackFrames directly for gcroots 8) Supporting code to implement the above features. Returning Structs in multiple registers Hijacking for StructInRegs is currently only implemented for Unix SystemV ABI Multi-reg struct returns. However, the hijack-workers that use ReturnKind are ready to handle other platforms (ex: ARM/ARM64 Windows) once the corresponding HijackTripThread() assembly routines are defined. The New feature flag: FEATURE_MULTIREG_RETURN is set for platforms where a struct value can be returned in multiple registers [ex: Windows/Unix ARM/ARM64, Unix-AMD64] FEATURE_UNIX_AMD64_STRUCT_PASSING is a specific kind of FEATURE_MULTIREG_RETURN specified by SystemV ABI for AMD64 Compatibility with other JITs - All new GCInfo generated by RYU Jit is in GcInfo version 2 - All Ngen images must be regenerated with the new GcInfo version. - Ready-to-run images with old GcInfo will continue to work. - Jit64/X64 uses the GcInfo library, so it generates GcInfo version 2. However, it doesn't (yet) provide the data to encode the correct ReturnKind Similar is the case for ARM32 code running on JIT32, and any other JITs that may be using GcInfo library but not yet modified to use the new API. So, compatibility is achived using RT_Unset flag. When ReturnKind is RT_Unset, it means that the JIT did not set the ReturnKind in the GCInfo, and therefore the VM cannot rely on it, and must use other mechanisms (similar to GcInfo ver 1) to determine the Return type's GC information. Implement GC root scanning for Hijack-frames This change implements GCScanRoots() method for Hijacke-frames based on the ReturnKind information available from the GcInfo. If the exact ReturnKind is not available in the GcInfo, the thread-suspension logic will compute the ReturnKind based on the method-signature. As a result of this change, several hijack-helpers in the VM are cleaned up. There's only one implementation of HijackWorker() to handle all returnKinds. This change also simplifies the thread-hijack logic by using a single assembly helper OnHijackTripThread() in most cases. The only other helper used is for X86 floating point return values for save/restoring the top of the FP stack. ARM64 Only GcIndfo v2 is reliably supported for ARM64 platform. The changes to thread-hijack mechanism fixes #6494 for ARM64. No measurable change in JIT throughput, performance or native-image size from this change.
2016-08-05For helper method frame DAC doesn't read register pointers. So set them to ↵Sasha Semennikov1-2/+5
NULL to not user "wrong" data. Moved context pointers NULL assignment to gmsamd64.cpp Squash commits
2016-07-28Fix for build issue #807024, assemble debug helpers for ARM64.Joel Hendrix1-0/+1
[tfs-changeset: 1619712]
2016-07-25Addressing arm64 build break due to old compilerRama Krishnan Raghupathy1-1/+2
[tfs-changeset: 1619335]
2016-07-25Arm64: DebuggerRama Krishnan Raghupathy20-49/+719
Instruction emulation for Break Points Debugger::FuncEvalSetup NativeWalker ExceptionHijack Exception intercept Managed Return Value
2016-07-20Merge pull request #6325 from swaroop-sridhar/R2RverSwaroop Sridhar4-10/+12
GCInfo: Support versioning.
2016-07-20GCInfo: Support versioning.Swaroop Sridhar4-10/+12
This change enables the VM to support multiple versions GCInfo concurrently. This is necessary in light of upcoming work to add ReturnType and other modifications to the GCInfo format -- so that existing ReadyToRun images will continue to run correctly. The version# is not stored in the GcInfo structure -- because it is wasteful to store the version once for every method. Instead, it is tracked per range-section of generated/loaded methods. The GCInfo version is computed as: 1) The current GCINFO_VERSION for JITted and Ngened images 2) A function of the Ready-to-run major version stored in READYTORUN_HEADER for ready-to-run images. ReadyToRunJitManager::JitTokenToGCInfoVersion() provides the GcInfo version for any Method. Currently, there's only one version of GCInfo. An abstraction GCInfoToken is added to the GcInfo interface, which tracks the {GcInfo, Version} pair in-memory. Several GcInfo APIs are modified to use GCInfoToken in place of GcInfo pointers. Notes: 1) SOS GcDump: The GCDump API has separate dump routines for Header and the pointer-liveness information (DumpGCTable and DumpGCHeader) each of which advance a pointer to the GCInfo block. These APIs are not changed to recieve a GCInfoToken in place of the GcInfo block pointer. Instead, they recieve the GcInfo version at the time of construction. 2) Some routines that are specific to x86 gcInfo (ex: crackMethodInfoHdr) are not yet updated to use versioning, since the development plan is to update the Non-x86 GcInfo structure first. 3) The x86 specific structs defining GcInfo headers are moved to GcInfoTypes.h, along with the non-x86 GcInfo type definitions.
2016-07-20Fix is_blittable partial specializations (#6357)joemmett1-2/+2
The is_blittable partial specializations were defined using "class", privately inheriting from std::true_type. This means the ::value member variable will be inaccessible to most users of these types. Thus the type ``std::enable_if<is_blittable<T>::value>::type'' will always result in a substitution failure with a compiler that respects accessibility in SFINAE. This commit changes "class" to "struct" for these partial specializations so they inherit publicly from std::true_type.
2016-06-30Fix the hang in the debugger tests repo on OS X. (#6079)Mike McLaughlin1-12/+0
The transport pipe closes during shudown where blocked/deadlocked with the pending read on the transport thread.
2016-06-22Merge pull request #3484 from Dmitry-Me/fixBrokenConditionAditya Mandaleeka1-1/+1
Fix impossible condition
2016-06-13Refactor MethodTable::ContainsStackPtr (#5754)Jan Kotas1-2/+1
- Rename ContainsStackPtr to IsByRefLike. It is the term used for this kind of types in ECMA spec. - Change the check to be based on flag instead of hard coded list of types - Remove redundant unused method of the same name on EEClass
2016-06-08Reduce memory leak for issue #1379Sasha Semennikov2-20/+27
Remove unused header Use proper exception-handling macroses Fix build issues Squash commits
2016-05-27Fix the named semaphore leak on OSX (and Linux) (#5269)Mike McLaughlin4-40/+13
* Change the dbgshim launch handshake back. The debugger side now creates the name semaphores like before and the transport pipe existence determines that coreclr is ready. Changed when the transport pipes are created: synchronously on the main thread. Correctly set and check the HAVE_PROCFS_* defines. * Code review feedback.
2016-05-24Improve vtbl matching loop in DacGetVtNameW. (#5179)Dmitri-Botcharnikov1-0/+1
2016-05-18Port from tfs: onload exception debugger crash fix (#4868)sbomer3-1/+35
The ExceptionHijackPersonalityRoutine was retrieving a context from a particular stack frame, but the calling conventions for the function executing in that frame allow it to overwrite the context. This was causing the debugger to crash for exceptions thrown from the onload method in winforms on x64. The fix is to instead retrieve the context from the previous stack frame, whose layout is set up explicitly in ExceptionHijack.
2016-05-17Merge pull request #4874 from gkhanna79/SPC_S1AlexGhiondea1-3/+4
Add support for System.Private.CoreLib to be core library
2016-05-16Enable DefaultDllImportSearchPathsAttribute in CoreCLR Windows. Host ↵Yi Zhang (CLR)1-2/+0
NATIVE_DLL_SEARCH_DIRECTORIES has higher priority.
2016-05-16Initial change to support System.Private.CoreLib.dll as Core Library.Gaurav Khanna1-3/+4
2016-05-07Remove FEATURE_HOSTED_BINDER definition (#4838)Jan Vorlicek1-2/+2
The FEATURE_HOSTED_BINDER is always on so remove it from all the sources.
2016-04-29Fix issue #4298 "SIGSEGV_libcoreclr.so!Debugger::GetArgCount"Mike McLaughlin7-15/+60
The fix is to remove the call to TerminateDebugger in the EE shutdown path. The reason was to clean up the transport pipe files but that still happens in coreclr_uninitialize called by the host. Also added code to clean up the transport named pipes and semaphores on the debugger side when it detects that the target process has terminated before it sends the ExitProcess notification. Plumbed the cleanup call from dbi's ExitProcess code through the native pipe line to the transport and then to pipe code. Add PAL_CleanupTargetProcess for the "continue" named semaphore cleanup. Found and fixed a minor race in dbgshim register runtime startup.