Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
|
|
* add typeID APIs
* add variable home API
|
|
|
|
to retrieve gcHeapType, which failed on crash dumps.
|
|
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
|
|
|
|
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
|
|
|
|
Move the GC behind an interface and use that interface in the VM
|
|
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
|
|
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.
|
|
|
|
|
|
* 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.
|
|
ARM64: Fix for ARM64TODO
|
|
|
|
For helper method frame DAC doesn't read register pointers. So set them to NULL to not use "wrong" data.
|
|
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.
|
|
NULL to not user "wrong" data.
Moved context pointers NULL assignment to gmsamd64.cpp
Squash commits
|
|
[tfs-changeset: 1619712]
|
|
[tfs-changeset: 1619335]
|
|
Instruction emulation for Break Points
Debugger::FuncEvalSetup
NativeWalker
ExceptionHijack
Exception intercept
Managed Return Value
|
|
GCInfo: Support versioning.
|
|
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.
|
|
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.
|
|
The transport pipe closes during shudown where blocked/deadlocked with the pending read on the transport thread.
|
|
Fix impossible condition
|
|
- 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
|
|
Remove unused header
Use proper exception-handling macroses
Fix build issues
Squash commits
|
|
* 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.
|
|
|
|
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.
|
|
Add support for System.Private.CoreLib to be core library
|
|
NATIVE_DLL_SEARCH_DIRECTORIES has higher priority.
|
|
|
|
The FEATURE_HOSTED_BINDER is always on so remove it from all the sources.
|
|
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.
|
|
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.
|
|
Currently only enabled for arm64
|
|
[tfs-changeset: 1597064]
|
|
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.
|
|
Merge changes from TFS
|
|
By initializing m_rgHijackFunction to NULL.
|
|
This mainly involved DACizing the VM code.
A bulk edit for changing RUNTIME_FUNCTION to T_RUNTIME_FUNCTION
[tfs-changeset: 1591667]
|
|
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.
|
|
|
|
Fixed problem with bpmd not working sometimes.
|
|
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.
|
|
|