ruby-32: re-add architecure independent manifest support, remove unnecassary GNU_CPU...
[oi-userland.git] / components / encumbered / megasync / patches / 11-minidump_generator.cc.patch
blobc3677909c52b7b3489ab35cc5c5bb81e38f2f095
1 --- MEGAsync_ori/src/MEGASync/google_breakpad/client/solaris/handler/minidump_generator.cc Wed Jan 26 20:25:17 2022
2 +++ MEGAsync_patched/src/MEGASync/google_breakpad/client/solaris/handler/minidump_generator.cc Sat Mar 5 20:28:34 2022
3 @@ -38,9 +38,11 @@
4 #include <unistd.h>
6 #include <cstdlib>
7 +#include <cstring>
8 #include <ctime>
10 #include "client/solaris/handler/minidump_generator.h"
11 +#include "client/solaris/handler/solaris_lwp.h"
12 #include "client/minidump_file_writer-inl.h"
13 #include "common/solaris/file_id.h"
15 @@ -105,6 +107,8 @@
16 uintptr_t last_ebp = (*gregs)[R_FP];
17 #elif TARGET_CPU_X86
18 uintptr_t last_ebp = (*gregs)[EBP];
19 +#elif TARGET_CPU_X86_64
20 + uintptr_t last_ebp = (*gregs)[EBP];
21 #endif
22 uintptr_t stack_bottom = lwp_lister->GetLwpStackBottom(last_ebp);
23 if (stack_bottom > last_ebp &&
24 @@ -194,7 +198,7 @@
26 return true;
28 -#elif TARGET_CPU_X86
29 +#elif TARGET_CPU_X86 || TARGET_CPU_X86_64
30 bool WriteContext(MDRawContextX86 *context, prgregset_t regs,
31 prfpregset_t *fp_regs) {
32 if (!context || !regs)
33 @@ -250,7 +254,7 @@
34 lwp->thread_context = context.location();
35 memset(context.get(), 0, sizeof(MDRawContextSPARC));
36 return WriteContext(context.get(), writer_args->sig_ctx);
37 -#elif TARGET_CPU_X86
38 +#elif TARGET_CPU_X86 || TARGET_CPU_X86_64
39 UntypedMDRVA memory(minidump_writer);
40 if (!WriteLwpStack(writer_args->lwp_lister,
41 writer_args->sig_ctx->uc_mcontext.gregs[UESP],
42 @@ -264,7 +268,7 @@
43 lwp->thread_context = context.location();
44 memset(context.get(), 0, sizeof(MDRawContextX86));
45 return WriteContext(context.get(),
46 - (int *)&writer_args->sig_ctx->uc_mcontext.gregs,
47 + writer_args->sig_ctx->uc_mcontext.gregs,
48 &writer_args->sig_ctx->uc_mcontext.fpregs);
49 #endif
51 @@ -290,7 +294,7 @@
52 lwp->thread_id = lsp->pr_lwpid;
53 lwp->thread_context = context.location();
54 memset(context.get(), 0, sizeof(MDRawContextSPARC));
55 -#elif TARGET_CPU_X86
56 +#elif TARGET_CPU_X86 || TARGET_CPU_X86_64
57 if (!WriteLwpStack(lwp_lister,
58 (*gregs)[UESP],
59 &memory,
60 @@ -306,7 +310,7 @@
61 lwp->thread_context = context.location();
62 memset(context.get(), 0, sizeof(MDRawContextX86));
63 #endif /* TARGET_CPU_XXX */
64 - return WriteContext(context.get(), (int *)gregs, &fp_regs);
65 + return WriteContext(context.get(), (greg_t*)&gregs, &fp_regs);
68 bool WriteCPUInformation(MDRawSystemInfo *sys_info) {
69 @@ -605,7 +609,7 @@
70 exception.get()->thread_context = context.location();
71 memset(context.get(), 0, sizeof(MDRawContextSPARC));
72 return WriteContext(context.get(), writer_args->sig_ctx);
73 -#elif TARGET_CPU_X86
74 +#elif TARGET_CPU_X86 || TARGET_CPU_X86_64
75 if (writer_args->sig_ctx != NULL) {
76 exception.get()->exception_record.exception_address =
77 writer_args->sig_ctx->uc_mcontext.gregs[EIP];
78 @@ -620,7 +624,7 @@
79 exception.get()->thread_context = context.location();
80 memset(context.get(), 0, sizeof(MDRawContextX86));
81 return WriteContext(context.get(),
82 - (int *)&writer_args->sig_ctx->uc_mcontext.gregs,
83 + writer_args->sig_ctx->uc_mcontext.gregs,
84 NULL);
85 #endif
87 @@ -702,6 +706,8 @@
88 writer_args->sig_ctx->uc_mcontext.gregs[REG_O6]
89 #elif TARGET_CPU_X86
90 writer_args->sig_ctx->uc_mcontext.gregs[UESP]
91 +#elif TARGET_CPU_X86_64
92 + writer_args->sig_ctx->uc_mcontext.gregs[UESP]
93 #endif