mirror of
https://github.com/chromium/crashpad.git
synced 2025-03-09 22:26:06 +00:00
handler: Reuse existing annotations SimpleStringDictionary if present
Bug: crashpad:143 Change-Id: I75a77adacd83febb7c363598bbc6d19c184b773d Reviewed-on: https://chromium-review.googlesource.com/468167 Reviewed-by: Scott Graham <scottmg@chromium.org>
This commit is contained in:
parent
8f07f7481a
commit
b409540163
@ -96,10 +96,19 @@ struct CrashpadInfo {
|
||||
//! SimpleStringDictionary object. It is the caller’s responsibility to
|
||||
//! ensure that this pointer remains valid while it is in effect for a
|
||||
//! CrashpadInfo object.
|
||||
//!
|
||||
//! \sa simple_annotations()
|
||||
void set_simple_annotations(SimpleStringDictionary* simple_annotations) {
|
||||
simple_annotations_ = simple_annotations;
|
||||
}
|
||||
|
||||
//! \return The simple annotations dictionary.
|
||||
//!
|
||||
//! \sa set_simple_annotations()
|
||||
SimpleStringDictionary* simple_annotations() const {
|
||||
return simple_annotations_;
|
||||
}
|
||||
|
||||
//! \brief Enables or disables Crashpad handler processing.
|
||||
//!
|
||||
//! When handling an exception, the Crashpad handler will scan all modules in
|
||||
|
@ -627,12 +627,21 @@ int HandlerMain(int argc, char* argv[]) {
|
||||
if (!options.monitor_self_annotations.empty()) {
|
||||
// Establish these annotations even if --monitor-self is not present, in
|
||||
// case something such as generate_dump wants to try to access them later.
|
||||
SimpleStringDictionary* module_annotations = new SimpleStringDictionary();
|
||||
//
|
||||
// If the handler is part of a multi-purpose executable, simple annotations
|
||||
// may already be present for this module. If they are, use them.
|
||||
CrashpadInfo* crashpad_info = CrashpadInfo::GetCrashpadInfo();
|
||||
SimpleStringDictionary* module_annotations =
|
||||
crashpad_info->simple_annotations();
|
||||
if (!module_annotations) {
|
||||
module_annotations = new SimpleStringDictionary();
|
||||
crashpad_info->set_simple_annotations(module_annotations);
|
||||
}
|
||||
|
||||
for (const auto& iterator : options.monitor_self_annotations) {
|
||||
module_annotations->SetKeyValue(iterator.first.c_str(),
|
||||
iterator.second.c_str());
|
||||
}
|
||||
CrashpadInfo::GetCrashpadInfo()->set_simple_annotations(module_annotations);
|
||||
}
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
|
Loading…
x
Reference in New Issue
Block a user