Improve debugging in RegionSpace::PoisonDeadObjectsInUnevacuatedRegion.
Test: art/test.py
Bug: 74064045
Bug: 67628039
Change-Id: Ibe78718740f26537f0b6cb6542bbf8d3e6e5b977
diff --git a/runtime/gc/space/region_space.cc b/runtime/gc/space/region_space.cc
index f97b976..0569092 100644
--- a/runtime/gc/space/region_space.cc
+++ b/runtime/gc/space/region_space.cc
@@ -16,6 +16,7 @@
#include "bump_pointer_space-inl.h"
#include "bump_pointer_space.h"
+#include "base/dumpable.h"
#include "gc/accounting/read_barrier_table.h"
#include "mirror/class-inl.h"
#include "mirror/object-inl.h"
@@ -465,7 +466,8 @@
// The live byte count of `r` should be different from -1, as this
// region should neither be a newly allocated region nor an
// evacuated region.
- DCHECK_NE(r->LiveBytes(), static_cast<size_t>(-1));
+ DCHECK_NE(r->LiveBytes(), static_cast<size_t>(-1))
+ << "Unexpected live bytes count of -1 in " << Dumpable<Region>(*r);
// Past-the-end address of the previously visited (live) object (or
// the beginning of the region, if `maybe_poison` has not run yet).