mirror of
https://github.com/chromium/crashpad.git
synced 2024-12-31 01:43:03 +08:00
a0f5dc62a4
Some annotations will exist at a broader scope than per-module, which is the only place that annotations can currently be stored. The product name and version are not under the control of any module, but are established when the first Crashpad client establishes a handler. These annotations will be stored in a minidump’s MinidumpCrashpadInfo structure, which applies to the entire minidump. Within the snapshot interface, this data is carried within the “process” snapshot because it is the top-level structure in that family. Note that the data may not correspond directly with a process, however. TEST=minidump_test MinidumpCrashpadInfoWriter.* R=rsesek@chromium.org Review URL: https://codereview.chromium.org/924673003
92 lines
2.5 KiB
C++
92 lines
2.5 KiB
C++
// Copyright 2014 The Crashpad Authors. All rights reserved.
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
#include "snapshot/exception_snapshot.h"
|
|
#include "snapshot/system_snapshot.h"
|
|
#include "snapshot/test/test_process_snapshot.h"
|
|
|
|
namespace crashpad {
|
|
namespace test {
|
|
|
|
TestProcessSnapshot::TestProcessSnapshot()
|
|
: process_id_(0),
|
|
parent_process_id_(0),
|
|
snapshot_time_(),
|
|
process_start_time_(),
|
|
process_cpu_user_time_(),
|
|
process_cpu_system_time_(),
|
|
annotations_simple_map_(),
|
|
system_(),
|
|
threads_(),
|
|
modules_(),
|
|
exception_() {
|
|
}
|
|
|
|
TestProcessSnapshot::~TestProcessSnapshot() {
|
|
}
|
|
|
|
pid_t TestProcessSnapshot::ProcessID() const {
|
|
return process_id_;
|
|
}
|
|
|
|
pid_t TestProcessSnapshot::ParentProcessID() const {
|
|
return parent_process_id_;
|
|
}
|
|
|
|
void TestProcessSnapshot::SnapshotTime(timeval* snapshot_time) const {
|
|
*snapshot_time = snapshot_time_;
|
|
}
|
|
|
|
void TestProcessSnapshot::ProcessStartTime(timeval* start_time) const {
|
|
*start_time = process_start_time_;
|
|
}
|
|
|
|
void TestProcessSnapshot::ProcessCPUTimes(timeval* user_time,
|
|
timeval* system_time) const {
|
|
*user_time = process_cpu_user_time_;
|
|
*system_time = process_cpu_system_time_;
|
|
}
|
|
|
|
const std::map<std::string, std::string>&
|
|
TestProcessSnapshot::AnnotationsSimpleMap() const {
|
|
return annotations_simple_map_;
|
|
}
|
|
|
|
const SystemSnapshot* TestProcessSnapshot::System() const {
|
|
return system_.get();
|
|
}
|
|
|
|
std::vector<const ThreadSnapshot*> TestProcessSnapshot::Threads() const {
|
|
std::vector<const ThreadSnapshot*> threads;
|
|
for (const ThreadSnapshot* thread : threads_) {
|
|
threads.push_back(thread);
|
|
}
|
|
return threads;
|
|
}
|
|
|
|
std::vector<const ModuleSnapshot*> TestProcessSnapshot::Modules() const {
|
|
std::vector<const ModuleSnapshot*> modules;
|
|
for (const ModuleSnapshot* module : modules_) {
|
|
modules.push_back(module);
|
|
}
|
|
return modules;
|
|
}
|
|
|
|
const ExceptionSnapshot* TestProcessSnapshot::Exception() const {
|
|
return exception_.get();
|
|
}
|
|
|
|
} // namespace test
|
|
} // namespace crashpad
|