fuchsia: Small fixes in system and process snapshot hit on generate_dump

- Implement ProcessID().
- Return empty ProcessStartTime() and ProcessCPUTimes() as there's
  nothing available.
- Return the Threads that were collected in Initialize().
- Return empty MachineDescription() plus upstream bug link.

Bug: crashpad:196
Change-Id: I77b33c18ed3844464bb5b9f238406191c221b17e
Reviewed-on: https://chromium-review.googlesource.com/1005889
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
This commit is contained in:
Scott Graham 2018-04-10 16:02:00 -07:00 committed by Commit Bot
parent f5f0aa4a8e
commit a4f4d6a736
2 changed files with 16 additions and 7 deletions

View File

@ -14,7 +14,10 @@
#include "snapshot/fuchsia/process_snapshot_fuchsia.h"
#include <zircon/process.h>
#include "base/logging.h"
#include "util/fuchsia/koid_utilities.h"
namespace crashpad {
@ -82,8 +85,7 @@ void ProcessSnapshotFuchsia::GetCrashpadOptions(
pid_t ProcessSnapshotFuchsia::ProcessID() const {
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
NOTREACHED(); // TODO(scottmg): https://crashpad.chromium.org/bug/196
return 0;
return GetKoidForHandle(zx_process_self());
}
pid_t ProcessSnapshotFuchsia::ParentProcessID() const {
@ -99,13 +101,16 @@ void ProcessSnapshotFuchsia::SnapshotTime(timeval* snapshot_time) const {
void ProcessSnapshotFuchsia::ProcessStartTime(timeval* start_time) const {
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
NOTREACHED(); // TODO(scottmg): https://crashpad.chromium.org/bug/196
// TODO(scottmg): https://crashpad.chromium.org/bug/196. Nothing available.
*start_time = timeval{};
}
void ProcessSnapshotFuchsia::ProcessCPUTimes(timeval* user_time,
timeval* system_time) const {
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
NOTREACHED(); // TODO(scottmg): https://crashpad.chromium.org/bug/196
// TODO(scottmg): https://crashpad.chromium.org/bug/196. Nothing available.
*user_time = timeval{};
*system_time = timeval{};
}
void ProcessSnapshotFuchsia::ReportID(UUID* report_id) const {
@ -132,8 +137,11 @@ const SystemSnapshot* ProcessSnapshotFuchsia::System() const {
std::vector<const ThreadSnapshot*> ProcessSnapshotFuchsia::Threads() const {
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
NOTREACHED(); // TODO(scottmg): https://crashpad.chromium.org/bug/196
return std::vector<const ThreadSnapshot*>();
std::vector<const ThreadSnapshot*> threads;
for (const auto& thread : threads_) {
threads.push_back(thread.get());
}
return threads;
}
std::vector<const ModuleSnapshot*> ProcessSnapshotFuchsia::Modules() const {

View File

@ -174,7 +174,8 @@ std::string SystemSnapshotFuchsia::OSVersionFull() const {
std::string SystemSnapshotFuchsia::MachineDescription() const {
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
NOTREACHED(); // TODO(scottmg): https://crashpad.chromium.org/bug/196.
// TODO(scottmg): https://crashpad.chromium.org/bug/196. Not yet available,
// upstream ZX-1775.
return std::string();
}