-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[cdac] Implement
IXCLRDataTask::CreateStackWalk
(#109350)
- Add `ClrDataStackWalk` to cDAC as its implementation of `IXCLRDataStackWalk` - Currently delegates everything to legacy implementation - Implement `IXCLRDataTask::CreateStackWalk` - Checks that the thread has been started - Gets the result from the legacy DAC and passes it to the cDAC `ClrDataStackWalk` - Switch `ISOSDacInterface.GetModule` to use `out IXCLRDataModule?` instead of `void**`
- Loading branch information
1 parent
95bae2b
commit a72cfb0
Showing
6 changed files
with
127 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
src/native/managed/cdacreader/src/Legacy/ClrDataStackWalk.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
using System.Runtime.InteropServices.Marshalling; | ||
|
||
namespace Microsoft.Diagnostics.DataContractReader.Legacy; | ||
|
||
[GeneratedComClass] | ||
internal sealed unsafe partial class ClrDataStackWalk : IXCLRDataStackWalk | ||
{ | ||
private readonly TargetPointer _threadAddr; | ||
private readonly uint _flags; | ||
private readonly Target _target; | ||
private readonly IXCLRDataStackWalk? _legacyImpl; | ||
|
||
public ClrDataStackWalk(TargetPointer threadAddr, uint flags, Target target, IXCLRDataStackWalk? legacyImpl) | ||
{ | ||
_threadAddr = threadAddr; | ||
_flags = flags; | ||
_target = target; | ||
_legacyImpl = legacyImpl; | ||
} | ||
|
||
int IXCLRDataStackWalk.GetContext(uint contextFlags, uint contextBufSize, uint* contextSize, [MarshalUsing(CountElementName = "contextBufSize"), Out] byte[] contextBuf) | ||
=> _legacyImpl is not null ? _legacyImpl.GetContext(contextFlags, contextBufSize, contextSize, contextBuf) : HResults.E_NOTIMPL; | ||
int IXCLRDataStackWalk.GetFrame(void** frame) | ||
=> _legacyImpl is not null ? _legacyImpl.GetFrame(frame) : HResults.E_NOTIMPL; | ||
int IXCLRDataStackWalk.GetFrameType(uint* simpleType, uint* detailedType) | ||
=> _legacyImpl is not null ? _legacyImpl.GetFrameType(simpleType, detailedType) : HResults.E_NOTIMPL; | ||
int IXCLRDataStackWalk.GetStackSizeSkipped(ulong* stackSizeSkipped) | ||
=> _legacyImpl is not null ? _legacyImpl.GetStackSizeSkipped(stackSizeSkipped) : HResults.E_NOTIMPL; | ||
int IXCLRDataStackWalk.Next() | ||
=> _legacyImpl is not null ? _legacyImpl.Next() : HResults.E_NOTIMPL; | ||
int IXCLRDataStackWalk.Request(uint reqCode, uint inBufferSize, byte* inBuffer, uint outBufferSize, byte* outBuffer) | ||
=> _legacyImpl is not null ? _legacyImpl.Request(reqCode, inBufferSize, inBuffer, outBufferSize, outBuffer) : HResults.E_NOTIMPL; | ||
int IXCLRDataStackWalk.SetContext(uint contextSize, [In, MarshalUsing(CountElementName = "contextSize")] byte[] context) | ||
=> _legacyImpl is not null ? _legacyImpl.SetContext(contextSize, context) : HResults.E_NOTIMPL; | ||
int IXCLRDataStackWalk.SetContext2(uint flags, uint contextSize, [In, MarshalUsing(CountElementName = "contextSize")] byte[] context) | ||
=> _legacyImpl is not null ? _legacyImpl.SetContext2(flags, contextSize, context) : HResults.E_NOTIMPL; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters