conan-recipes/recipes/breakpad/all/patches/0013-Use-a-default-debug-id-of-all-zeros-when-no-CV-recor.patch

70 lines
2.4 KiB
Diff
Raw Normal View History

2020-10-19 08:52:36 +11:00
From 8beaee224cf0c2379d3f684123533b6e01006bbb Mon Sep 17 00:00:00 2001
From: Jon Turney <jon.turney@dronecode.org.uk>
Date: Sat, 22 Feb 2014 15:59:22 +0000
Subject: [PATCH 13/19] Use a default debug-id of all zeros when no CV record
is present
This lets us do something slightly useful with current binaries
which are produced without a CV record, but there is no guarantee
that the actually match.
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
---
src/common/pecoff/pecoff_file_id.cc | 8 ++++++++
src/processor/minidump.cc | 8 ++++++++
2 files changed, 16 insertions(+)
diff --git a/src/common/pecoff/pecoff_file_id.cc b/src/common/pecoff/pecoff_file_id.cc
index 47c2763f..04563c86 100644
--- a/src/common/pecoff/pecoff_file_id.cc
+++ b/src/common/pecoff/pecoff_file_id.cc
@@ -32,6 +32,7 @@
#include "common/pecoff/pecoff_file_id.h"
+#include <string.h>
#include "common/pecoff/pecoffutils.h"
namespace google_breakpad {
@@ -73,11 +74,18 @@ bool PeCoffFileID::PeCoffFileIdentifierFromMappedFile(const void* base,
age))
return true;
+#if 1
+ // XXX: Fallback to a default debug_identifier.
+ memset(identifier, 0, kMDGUIDSize);
+ *age = 0;
+ return true;
+#else
// Fall back on hashing the first page of the text section.
// (This is of questionable value as the Windows Minidump writer doesn't have
// this feature)
return HashPeCoffTextSection(reinterpret_cast<const uint8_t *>(base),
identifier);
+#endif
}
} // namespace google_breakpad
diff --git a/src/processor/minidump.cc b/src/processor/minidump.cc
index f802210e..1b08ba3f 100644
--- a/src/processor/minidump.cc
+++ b/src/processor/minidump.cc
@@ -2248,6 +2248,14 @@ string MinidumpModule::debug_identifier() const {
// TODO(mmentovai): on the Mac, provide fallbacks as in code_identifier().
+ // XXX: PE generated with gcc don't currently have CV records, so the Windows
+ // minidumper can't record any identifier information, so there's no useful
+ // identifier for us to match with. Fallback to a default debug_identifier.
+ if (identifier.empty())
+ {
+ identifier = "000000000000000000000000000000000";
+ }
+
// Relatively common case
BPLOG_IF(INFO, identifier.empty()) << "MinidumpModule could not determine "
"debug_identifier for " << *name_;
--
2.28.0