forked from msys2/MINGW-packages
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0011-Default-debug_file-to-the-code_file-basename.patch
51 lines (43 loc) · 1.67 KB
/
0011-Default-debug_file-to-the-code_file-basename.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
From 864ff09e70cf42fa4e96969d665890ef73144eba Mon Sep 17 00:00:00 2001
From: Jon TURNEY <[email protected]>
Date: Fri, 7 Feb 2014 23:03:10 +0000
Subject: [PATCH 11/24] Default debug_file to the code_file basename
Strip any path from code_file, and use that as debug_file if one isn't recorded
in the codeview record.
The current implementation of 'ld --build-id' doesn't write a pdbfilename in the
codeview record, not least because we don't have such a thing.
The minidump processor requires both debug_file and debug_identifier (the
build-id) to locate the symbol file.
v2:
Correctly make debug-file a basename when code-file has a windows-style path
Fix by Ivan Gubarev
Signed-off-by: Jon TURNEY <[email protected]>
---
src/processor/minidump.cc | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/processor/minidump.cc b/src/processor/minidump.cc
index 1a79676..71c8456 100644
--- a/src/processor/minidump.cc
+++ b/src/processor/minidump.cc
@@ -1961,6 +1961,20 @@ string MinidumpModule::debug_file() const {
}
}
+ // Manufacture debug-file from code-file
+ if (file.empty()) {
+ file = code_file();
+
+ BPLOG(INFO) << "Generated debug_file '" << file << "' from code_file '" << *name_ << "'";
+ }
+
+ // This may be a windows-style pathname, so find the basename considering both
+ // forward and back-slashes.
+ const size_t last_slash_idx = file.find_last_of("\\/");
+ if (std::string::npos != last_slash_idx) {
+ file.erase(0, last_slash_idx + 1);
+ }
+
// Relatively common case
BPLOG_IF(INFO, file.empty()) << "MinidumpModule could not determine "
"debug_file for " << *name_;
--
2.1.1