This repository has been archived by the owner on Sep 7, 2021. It is now read-only.
forked from desktop-app/patches
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcrashpad.diff
107 lines (105 loc) · 5.38 KB
/
crashpad.diff
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
diff --git a/client/capture_context_mac_test.cc b/client/capture_context_mac_test.cc
index 436ac5ad..8e14fb9c 100644
--- a/client/capture_context_mac_test.cc
+++ b/client/capture_context_mac_test.cc
@@ -34,11 +34,11 @@ namespace {
// gtest assertions.
void SanityCheckContext(const NativeCPUContext& context) {
#if defined(ARCH_CPU_X86)
- ASSERT_EQ(x86_THREAD_STATE32, context.tsh.flavor);
- ASSERT_EQ(implicit_cast<int>(x86_THREAD_STATE32_COUNT), context.tsh.count);
+ ASSERT_EQ(implicit_cast<thread_state_flavor_t>(x86_THREAD_STATE32), implicit_cast<thread_state_flavor_t>(context.tsh.flavor));
+ ASSERT_EQ(implicit_cast<uint32_t>(x86_THREAD_STATE32_COUNT), implicit_cast<uint32_t>(context.tsh.count));
#elif defined(ARCH_CPU_X86_64)
- ASSERT_EQ(x86_THREAD_STATE64, context.tsh.flavor);
- ASSERT_EQ(implicit_cast<int>(x86_THREAD_STATE64_COUNT), context.tsh.count);
+ ASSERT_EQ(implicit_cast<thread_state_flavor_t>(x86_THREAD_STATE64), implicit_cast<thread_state_flavor_t>(context.tsh.flavor));
+ ASSERT_EQ(implicit_cast<uint32_t>(x86_THREAD_STATE64_COUNT), implicit_cast<uint32_t>(context.tsh.count));
#endif
#if defined(ARCH_CPU_X86_FAMILY)
diff --git a/client/simulate_crash_mac.cc b/client/simulate_crash_mac.cc
index 7e279015..27864388 100644
--- a/client/simulate_crash_mac.cc
+++ b/client/simulate_crash_mac.cc
@@ -177,12 +177,12 @@ bool DeliverException(thread_t thread,
void SimulateCrash(const NativeCPUContext& cpu_context) {
#if defined(ARCH_CPU_X86)
- DCHECK_EQ(cpu_context.tsh.flavor,
+ DCHECK_EQ(implicit_cast<thread_state_flavor_t>(cpu_context.tsh.flavor),
implicit_cast<thread_state_flavor_t>(x86_THREAD_STATE32));
DCHECK_EQ(implicit_cast<mach_msg_type_number_t>(cpu_context.tsh.count),
x86_THREAD_STATE32_COUNT);
#elif defined(ARCH_CPU_X86_64)
- DCHECK_EQ(cpu_context.tsh.flavor,
+ DCHECK_EQ(implicit_cast<thread_state_flavor_t>(cpu_context.tsh.flavor),
implicit_cast<thread_state_flavor_t>(x86_THREAD_STATE64));
DCHECK_EQ(implicit_cast<mach_msg_type_number_t>(cpu_context.tsh.count),
x86_THREAD_STATE64_COUNT);
diff --git a/client/simulate_crash_mac_test.cc b/client/simulate_crash_mac_test.cc
index 87c5f845..ca813e4c 100644
--- a/client/simulate_crash_mac_test.cc
+++ b/client/simulate_crash_mac_test.cc
@@ -130,12 +130,12 @@ class TestSimulateCrashMac final : public MachMultiprocess,
reinterpret_cast<const x86_thread_state*>(old_state);
switch (state->tsh.flavor) {
case x86_THREAD_STATE32:
- EXPECT_EQ(implicit_cast<int>(x86_THREAD_STATE32_COUNT),
- state->tsh.count);
+ EXPECT_EQ(implicit_cast<uint32_t>(x86_THREAD_STATE32_COUNT),
+ implicit_cast<uint32_t>(state->tsh.count));
break;
case x86_THREAD_STATE64:
- EXPECT_EQ(implicit_cast<int>(x86_THREAD_STATE64_COUNT),
- state->tsh.count);
+ EXPECT_EQ(implicit_cast<uint32_t>(x86_THREAD_STATE64_COUNT),
+ implicit_cast<uint32_t>(state->tsh.count));
break;
default:
ADD_FAILURE() << "unexpected tsh.flavor " << state->tsh.flavor;
@@ -149,12 +149,12 @@ class TestSimulateCrashMac final : public MachMultiprocess,
reinterpret_cast<const x86_float_state*>(old_state);
switch (state->fsh.flavor) {
case x86_FLOAT_STATE32:
- EXPECT_EQ(implicit_cast<int>(x86_FLOAT_STATE32_COUNT),
- state->fsh.count);
+ EXPECT_EQ(implicit_cast<uint32_t>(x86_FLOAT_STATE32_COUNT),
+ implicit_cast<uint32_t>(state->fsh.count));
break;
case x86_FLOAT_STATE64:
- EXPECT_EQ(implicit_cast<int>(x86_FLOAT_STATE64_COUNT),
- state->fsh.count);
+ EXPECT_EQ(implicit_cast<uint32_t>(x86_FLOAT_STATE64_COUNT),
+ implicit_cast<uint32_t>(state->fsh.count));
break;
default:
ADD_FAILURE() << "unexpected fsh.flavor " << state->fsh.flavor;
@@ -168,12 +168,12 @@ class TestSimulateCrashMac final : public MachMultiprocess,
reinterpret_cast<const x86_debug_state*>(old_state);
switch (state->dsh.flavor) {
case x86_DEBUG_STATE32:
- EXPECT_EQ(implicit_cast<int>(x86_DEBUG_STATE32_COUNT),
- state->dsh.count);
+ EXPECT_EQ(implicit_cast<uint32_t>(x86_DEBUG_STATE32_COUNT),
+ implicit_cast<uint32_t>(state->dsh.count));
break;
case x86_DEBUG_STATE64:
- EXPECT_EQ(implicit_cast<int>(x86_DEBUG_STATE64_COUNT),
- state->dsh.count);
+ EXPECT_EQ(implicit_cast<uint32_t>(x86_DEBUG_STATE64_COUNT),
+ implicit_cast<uint32_t>(state->dsh.count));
break;
default:
ADD_FAILURE() << "unexpected dsh.flavor " << state->dsh.flavor;
diff --git a/crashpad.gyp b/crashpad.gyp
index 42fe0a26..d8af1bf1 100644
--- a/crashpad.gyp
+++ b/crashpad.gyp
@@ -25,7 +25,7 @@
'minidump/minidump.gyp:*',
'minidump/minidump_test.gyp:*',
'snapshot/snapshot.gyp:*',
- 'snapshot/snapshot_test.gyp:*',
+# 'snapshot/snapshot_test.gyp:*',
'test/test.gyp:*',
'test/test_test.gyp:*',
'tools/tools.gyp:*',