Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cDAC] Implement basic stackwalking #111759

Open
wants to merge 53 commits into
base: main
Choose a base branch
from

Conversation

max-charlamb
Copy link
Contributor

@max-charlamb max-charlamb commented Jan 23, 2025

Contributes to #110758

Implements bulk of the cDAC stackwalking mechanics.

  • IStackWalk contract

Supports amd64 and arm64 architectures. Tested on Windows targeting win-amd64 and linux-arm64 dumps.

Supports InlineCallFrames and SoftwareExceptionFrames.

Does not support and will be added in future PRs:

@max-charlamb max-charlamb marked this pull request as ready for review February 6, 2025 23:22
@max-charlamb max-charlamb changed the title [cDAC] Stackwalking [cDAC] Implement basic stackwalking Feb 6, 2025
@@ -23,6 +23,10 @@ struct CodeBlockHandle
TargetPointer GetMethodDesc(CodeBlockHandle codeInfoHandle);
// Get the instruction pointer address of the start of the code block
TargetCodePointer GetStartAddress(CodeBlockHandle codeInfoHandle);
// Gets the base address of the module containing the code block
TargetPointer GetModuleBaseAddress(CodeBlockHandle codeInfoHandle);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like this naming/meaning. Looking closer at this, this concept of "module" isn't used anywhere else in the documentation. Other parts of the documentation refer to modules as the IL concept, but in this case it refers to the concept of a module which is either a PE binary which holds R2R code, or a CodeHeap which may have code from many different IL modules within it. Possibly change the name here to something like "GetUnwindInfoBaseAddress" and document that it serves as the base pointer for the RUNTIME_FUNCTION found in the GetUnwindInfo api?

Copy link
Contributor Author

@max-charlamb max-charlamb Feb 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I renamed GetModuleBaseAddress -> GetUnwindInfoBaseAddress. It's documented as "returning the base address that the unwind info for a given CodeBlockHandle is relative to."

I changed all of cDAC to reference the base address using unwindInfoBase but left the pre-existing native references to moduleBase and imageBase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants