Memory Diagnostics: GC Bookkeeping (#84454)
authorLee Culver <leculver@microsoft.com>
Mon, 17 Apr 2023 21:09:56 +0000 (14:09 -0700)
committerGitHub <noreply@github.com>
Mon, 17 Apr 2023 21:09:56 +0000 (14:09 -0700)
commitadd51b82baf268c3678bdd124480a46b89d72ce4
tree5b717e93651a83c29e97f20974f03ee6c9a82502
parent1212946a276b1356b982c005893a2dd9fbf98793
Memory Diagnostics: GC Bookkeeping (#84454)

* Add ISOSMemoryEnum and HandleTable enum

* Update comment

* Add GC Bookkeeping data to the dac

- bookkeeping_covered_start is now compiled into all versions of the GC, instead of just with USE_REGIONS.  This allows us to find the base address of the allocated memory for GC Bookkeeping.
- Added dac enumeration of GC Bookkeeping.

* Add assert

* Add support for free gc regions

* Don't require card_table_element_layout

* Fix issue with naming in request

* Remote DEFINE_MISSING_FIELD from dac

We should never have missing fields in the dac.  This is a leftover from
previous code.

* Whitespace fix

* Break if we loop

* Fix static_assert

* Segment fixes

When using segments, update bookkeeping_covered_start and card_table_info.size when we update the card table.

* Defensive coding

Check how many times we loop through memory to guard against heap corruption.

* free_region fixes

* Remove hardcoding of region list

* Fix gcc warnings

* Remove unneeded #define

* Add freeable_soh_segment/freeable_uoh_segment

* Add more card table checks

* Fix field definition issue

* Fix pointer issue

* Fix compile issue

* Rename bookkeeping_covered_start to bookkeeping_start

* Update src/coreclr/debug/daccess/daccess.cpp

Co-authored-by: Andrew Au <cshung@gmail.com>
* Code review feedback

* Remove unused parameter

* Add heap number

---------

Co-authored-by: Andrew Au <andrewau@microsoft.com>
Co-authored-by: Andrew Au <cshung@gmail.com>
16 files changed:
src/coreclr/debug/daccess/daccess.cpp
src/coreclr/debug/daccess/dacimpl.h
src/coreclr/debug/daccess/request.cpp
src/coreclr/debug/daccess/request_svr.cpp
src/coreclr/gc/dac_gcheap_fields.h
src/coreclr/gc/gc.cpp
src/coreclr/gc/gcinterface.dac.h
src/coreclr/gc/gcinterface.dacvars.def
src/coreclr/gc/gcpriv.h
src/coreclr/gc/handletableconstants.h [new file with mode: 0644]
src/coreclr/gc/handletablepriv.h
src/coreclr/gc/objecthandle.cpp
src/coreclr/inc/sospriv.idl
src/coreclr/pal/prebuilt/idl/sospriv_i.cpp
src/coreclr/pal/prebuilt/inc/sospriv.h
src/coreclr/vm/decodemd.cpp