forked from msys2/MINGW-packages
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0008-Fix-building-client-library-and-upload-tools-for-Min.patch
123 lines (102 loc) · 4.27 KB
/
0008-Fix-building-client-library-and-upload-tools-for-Min.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
From 7091ed120d7d5e90211572e3ec4e0882a071979e Mon Sep 17 00:00:00 2001
From: Jon TURNEY <[email protected]>
Date: Wed, 19 Nov 2014 13:21:43 +0000
Subject: [PATCH 08/24] Fix building client library and upload tools for MinGW
This is the rest of https://breakpad.appspot.com/548002/, brought up to date
v2:
Refine MinGW changes in HTTPUpload::GetFileContents so it closes file after use
v3:
For consistency, write conditionals in terms of _MSC_VER, not __MINGW32__
v4:
Use fd rather than FILE * in HTTPUpload::GetFileContents
It appears that constructing a stdio_filebuf from a FILE * does a fflush(0),
which has been seen to occasionally fail EBADF (on at least W7 x64).
Both of these things seem like they might be bugs
Workaround for the moment by constructing stdio_filebuf from a fd instead.
v5:
Drop HTTPUpload::GetFileContents() changes as upstream now uses WideTOMBCP()
Drop changes to avoid stdext::checked_array_iterator, as upstream
Signed-off-by: Jon TURNEY <[email protected]>
---
Makefile.am | 2 --
src/client/windows/crash_generation/client_info.cc | 4 ++++
src/client/windows/crash_generation/crash_generation_server.cc | 7 +++++--
.../windows/tests/crash_generation_app/crash_generation_app.cc | 6 ++++++
4 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index d8917aa..ad62471 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -313,13 +313,11 @@ bin_PROGRAMS += \
src/processor/minidump_stackwalk
endif !DISABLE_PROCESSOR
-if !MINGW_HOST
if !DISABLE_TOOLS
bin_PROGRAMS += \
src/tools/common/symupload/minidump_upload \
src/tools/common/symupload/sym_upload
endif
-endif
if LINUX_HOST
bin_PROGRAMS += \
diff --git a/src/client/windows/crash_generation/client_info.cc b/src/client/windows/crash_generation/client_info.cc
index ed31263..30a48db 100644
--- a/src/client/windows/crash_generation/client_info.cc
+++ b/src/client/windows/crash_generation/client_info.cc
@@ -176,7 +176,11 @@ void ClientInfo::SetProcessUptime() {
// Convert it to a string.
wchar_t* value = custom_info_entries_.get()[custom_client_info_.count].value;
+#ifdef _MSC_VER
_i64tow_s(delay, value, CustomInfoEntry::kValueMaxLength, 10);
+#else
+ _i64tow(delay, value, 10);
+#endif
}
bool ClientInfo::PopulateCustomInfo() {
diff --git a/src/client/windows/crash_generation/crash_generation_server.cc b/src/client/windows/crash_generation/crash_generation_server.cc
index ae05243..81d6597 100644
--- a/src/client/windows/crash_generation/crash_generation_server.cc
+++ b/src/client/windows/crash_generation/crash_generation_server.cc
@@ -85,14 +85,17 @@ static bool IsClientRequestValid(const ProtocolMessage& msg) {
msg.assert_info != NULL);
}
-#ifdef _DEBUG
static bool CheckForIOIncomplete(bool success) {
+#ifdef _DEBUG
// We should never get an I/O incomplete since we should not execute this
// unless the operation has finished and the overlapped event is signaled. If
// we do get INCOMPLETE, we have a bug in our code.
return success ? false : (GetLastError() == ERROR_IO_INCOMPLETE);
-}
+#else
+ return true;
#endif
+}
+
CrashGenerationServer::CrashGenerationServer(
const std::wstring& pipe_name,
diff --git a/src/client/windows/tests/crash_generation_app/crash_generation_app.cc b/src/client/windows/tests/crash_generation_app/crash_generation_app.cc
index fa4e634..09a0aae 100644
--- a/src/client/windows/tests/crash_generation_app/crash_generation_app.cc
+++ b/src/client/windows/tests/crash_generation_app/crash_generation_app.cc
@@ -42,6 +42,10 @@
#include "client/windows/tests/crash_generation_app/abstract_class.h"
+#ifndef _MSC_VER
+#define swprintf_s swprintf
+#endif
+
namespace google_breakpad {
const int kMaxLoadString = 100;
@@ -480,9 +484,11 @@ int APIENTRY _tWinMain(HINSTANCE instance,
CustomClientInfo custom_info = {kCustomInfoEntries, kCustomInfoCount};
CrashServerStart();
+#ifdef _MSC_VER
// This is needed for CRT to not show dialog for invalid param
// failures and instead let the code handle it.
_CrtSetReportMode(_CRT_ASSERT, 0);
+#endif
handler = new ExceptionHandler(L"C:\\dumps\\",
NULL,
google_breakpad::ShowDumpResults,
--
2.1.1