Skip to content

Commit

Permalink
[release/8.0] Properly handle debugger-enumerating interior pointers …
Browse files Browse the repository at this point in the history
…and enregistered refs (#92360)

* Fix issue with enregistered values

* Fix assert and enregistered ref reporting

* Fix issue from merge

---------

Co-authored-by: Lee Culver <leculver@microsoft.com>
Co-authored-by: Juan Sebastian Hoyos Ayala <juan.hoyos@microsoft.com>
Co-authored-by: Juan Hoyos <19413848+hoyosjs@users.noreply.github.com>
  • Loading branch information
4 people committed Sep 21, 2023
1 parent 8ae598e commit 1757497
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/coreclr/debug/daccess/dacdbiimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7788,8 +7788,9 @@ HRESULT DacStackReferenceWalker::Next(ULONG count, DacGcReference stackRefs[], U
stackRefs[i].i64ExtraData = 0;

const SOSStackRefData &sosStackRef = mList.Get(i);
if (sosStackRef.Flags & GC_CALL_INTERIOR)
if (sosStackRef.Flags & GC_CALL_INTERIOR || sosStackRef.Address == 0)
{
// Direct pointer case - interior pointer, Frame ref, or enregistered var.
stackRefs[i].pObject = CLRDATA_ADDRESS_TO_TADDR(sosStackRef.Object) | 1;
}
else
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/debug/di/rsclass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ HRESULT CordbClass::GetStaticFieldValue(mdFieldDef fieldDef,
IMetaDataImport * pImport = NULL;
EX_TRY
{
RSLockHolder lockHolder(GetProcess()->GetProcessLock());
pImport = GetModule()->GetMetaDataImporter(); // throws

// Validate the token.
Expand Down Expand Up @@ -1191,4 +1192,3 @@ HRESULT CordbClass::SearchFieldInfo(
// Well, the field doesn't even belong to this class...
ThrowHR(E_INVALIDARG);
}

0 comments on commit 1757497

Please sign in to comment.