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

Provide APIs to get a pointer/value out of a heap given a heap index #36

Closed
jkoritzinsky opened this issue Aug 23, 2023 · 2 comments · Fixed by #38
Closed

Provide APIs to get a pointer/value out of a heap given a heap index #36

jkoritzinsky opened this issue Aug 23, 2023 · 2 comments · Fixed by #38
Assignees
Labels
enhancement New feature or request

Comments

@jkoritzinsky
Copy link
Collaborator

Today, DNMD does not provide an operation to get a value from a heap at a given index. DNMD only provides an API to read a heap value from a column that points into a heap. This works for most scenarios, but the direct "read from the heap at this index" is needed for a few scenarios:

  • The Mono embedding API surface exposes this operation (get a pointer to the offset into a heap)
  • The Document table's Name column's format specifies offsets into the blob heap for blobs to be read to form the path to the document.
  • The ImportScope table's Imports column's format specifies offsets into the blob heap for the alias and target-namespace data in the blob.

As the DNMD API exists today, these operations cannot be implemented.

@jkoritzinsky jkoritzinsky added the enhancement New feature or request label Aug 23, 2023
@jkoritzinsky
Copy link
Collaborator Author

We discussed offline and came to the following conclusion:

  • The Mono embedding API surface concern is not interesting unless we must keep the existing API surface (at which point we have a few options, such as including a private header just for Mono that we don't ship if we ever integrate into the runtimes)
  • We can provide specialized functions/structs for the known annoying blobs (Document.Name, ImportScope.Imports) to handle them internally without exposing this API.

@jkoritzinsky jkoritzinsky self-assigned this Aug 24, 2023
@jkoritzinsky
Copy link
Collaborator Author

We will face a similar problem for all Portable PDB blobs that use compressed/uncompressed integers (as we don't expose the API to parse them).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
1 participant