From d833525cfe3ac2086e3156a8b3193c05974d6316 Mon Sep 17 00:00:00 2001 From: Neil Fuller Date: Wed, 17 Aug 2016 11:39:26 +0100 Subject: [PATCH] Logging improvements for C++ / Java structure issues When C++ and Java structures are different sizes or arranged differently some log statements are useful but are hard to pick out because they merge with other log lines. Adding "\n" to the end of them makes it easier to read. Change-Id: Ia6d78e0832c7814bf1fef42bb3d8c056f83766bd Test: make build-art-host --- runtime/gc/collector/mark_sweep.cc | 4 ++-- runtime/mirror/class.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/gc/collector/mark_sweep.cc b/runtime/gc/collector/mark_sweep.cc index e27613703..1d15ee733 100644 --- a/runtime/gc/collector/mark_sweep.cc +++ b/runtime/gc/collector/mark_sweep.cc @@ -413,7 +413,7 @@ class MarkSweep::MarkObjectSlowPath { if (UNLIKELY(obj == nullptr || !IsAligned(obj) || (kIsDebugBuild && large_object_space != nullptr && !large_object_space->Contains(obj)))) { - LOG(INTERNAL_FATAL) << "Tried to mark " << obj << " not contained by any spaces"; + LOG(INTERNAL_FATAL) << "Tried to mark " << obj << " not contained by any spaces\n"; if (holder_ != nullptr) { size_t holder_size = holder_->SizeOf(); ArtField* field = holder_->FindFieldByOffset(offset_); @@ -442,7 +442,7 @@ class MarkSweep::MarkObjectSlowPath { for (size_t i = 0; i < holder_size / sizeof(uint32_t); ++i) { uint32_t* p = reinterpret_cast(holder_); LOG(INTERNAL_FATAL) << &p[i] << ": " << "holder+" << (i * sizeof(uint32_t)) << " = " - << std::hex << p[i]; + << std::hex << p[i] << "\n"; } } PrintFileToLog("/proc/self/maps", LogSeverity::INTERNAL_FATAL); diff --git a/runtime/mirror/class.cc b/runtime/mirror/class.cc index f948be79c..1cf9dd161 100644 --- a/runtime/mirror/class.cc +++ b/runtime/mirror/class.cc @@ -136,7 +136,7 @@ void Class::SetDexCache(DexCache* new_dex_cache) { void Class::SetClassSize(uint32_t new_class_size) { if (kIsDebugBuild && new_class_size < GetClassSize()) { DumpClass(LOG(INTERNAL_FATAL), kDumpClassFullDetail); - LOG(INTERNAL_FATAL) << new_class_size << " vs " << GetClassSize(); + LOG(INTERNAL_FATAL) << new_class_size << " vs " << GetClassSize() << "\n"; LOG(FATAL) << " class=" << PrettyTypeOf(this); } // Not called within a transaction. -- 2.11.0