summaryrefslogtreecommitdiff
path: root/src/debug
AgeCommit message (Collapse)AuthorFilesLines
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.
2016-04-27ARM, SOS: Fix fail to load libsos.so while debugging with lldbSaeHie Park1-1/+5
Related issue: #4428 With minor fix for ARM compile in SOS ARM: Fix ARM-Linux in SOS with lldb Fix ARM architecture type in SOS so that it works for ARM-Linux. Before this patch, lldb stops with architecture not supported. SOS ARM-Linux works with LLDB-3.8 and higher. Actual SOS commands for ARM may need testing and fixing.
2016-04-18enable build of cross target components.Rahul Kumar4-75/+7
Currently only enabled for arm64
2016-04-18Fix nidump to avoid crashing while working with Ready to Run imagesJohn Chen1-1/+1
[tfs-changeset: 1597064]
2016-04-14Fix possibility of deadlock in the SIGSEGV handlerJan Vorlicek2-32/+29
The SIGSEGV handler was transitively calling pthread_attr_get_np to get current stack limit no matter where the exception happened. The problem was that if the segmentation violation happened in a C runtime function, this could lead to deadlock since pthread_attr_get_np is not signal safe. The fix is to add callback that will figure out if the failing instruction was in managed code or in one of the jit helpers and if not, it would not attempt to handle the signal. I have also removed non signal safe calls from the signal handlers code path where we don't know yet whether the interrupted code was in a function that could collide with a function that we call from the signal handler or not. This includes TRACE and ASSERT calls that were calling string formatting functions.
2016-03-31Merge pull request #4021 from dotnet-bot/from-tfsJan Kotas3-13/+13
Merge changes from TFS
2016-03-30Fixed issue #3987 "Debugger fails to stop on entry due to stack walk failure"Mike McLaughlin2-0/+5
By initializing m_rgHijackFunction to NULL.
2016-03-30Getting SOS to work on ARm64:Rama Krishnan Raghupathy3-13/+13
This mainly involved DACizing the VM code. A bulk edit for changing RUNTIME_FUNCTION to T_RUNTIME_FUNCTION [tfs-changeset: 1591667]
2016-03-29Fix ReadMemory AV.Mike McLaughlin1-1/+41
Use simple probing to validate read/write memory with a try/catch and explicit h/w exception holder. Put probing in separate noinline and optnone function for optimized builds. Fix assert in exception code mapping in context.cpp by handling SIGSEGV subcode SI_KERNEL.
2016-03-24Delete legacy netcf compat support (final part)Jan Kotas5-160/+3
2016-03-17Merge pull request #3783 from mikem8361/fixsosbpMike McLaughlin1-0/+4
Fixed problem with bpmd not working sometimes.
2016-03-17Fixed problem with bpmd not working sometimes.Mike McLaughlin1-0/+4
Fix some too earlier SOS initialization problem. Now returns an error. The DAC interface (IXCLRDataProcess) was being created everytime an command was run and the JIT and GC notification tables where being reinitialized each time losing any JIT notifications needed to resolve a breakpoint. Only create the DAC interface instance once. It does need to be flushed each time sos is entered though. Enable the module load and unload and exception callbacks when the DAC instance is created. This is what windbg does on Windows (along with flushing the DAC each time the target is restarted). It simplifies the breakpoint code; it no longer needs to enable/disable these notification flags. Cleaned up places where the DAC instance (direct calls to LoadClrDebugDll) and not released properly.
2016-03-16Update code to use COMPlus_ instead of COMPLUS_ when referencing knobsManu2-5/+5