Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3aac3620 authored by Christopher Ferris's avatar Christopher Ferris
Browse files

Remove log spam.

When dumping, the code checks if a thread is running as a guest.
If it's not, the code always logs an error message if the header
data structure cannot be read. Don't print an error message in
this case.

Test: Crash and no longer see "failed to get the guest state header"
Test: message.
Change-Id: I6971b57b218a4f653682cfdc82118dc576d9e331
parent 097b607a
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -470,14 +470,12 @@ static bool GetGuestRegistersFromCrashedProcess([[maybe_unused]] pid_t tid,
  }

  NativeBridgeGuestStateHeader header;
  if (!process_memory->ReadFully(header_ptr, &header, sizeof(NativeBridgeGuestStateHeader))) {
    PLOG(ERROR) << "failed to get the guest state header for thread " << tid;
    return false;
  }
  if (header.signature != NATIVE_BRIDGE_GUEST_STATE_SIGNATURE) {
  if (!process_memory->ReadFully(header_ptr, &header, sizeof(NativeBridgeGuestStateHeader)) ||
      header.signature != NATIVE_BRIDGE_GUEST_STATE_SIGNATURE) {
    // Return when ptr points to unmapped memory or no valid guest state.
    return false;
  }

  auto guest_state_data_copy = std::make_unique<unsigned char[]>(header.guest_state_data_size);
  if (!process_memory->ReadFully(reinterpret_cast<uintptr_t>(header.guest_state_data),
                                 guest_state_data_copy.get(), header.guest_state_data_size)) {