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
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"
16 uintptr_t last_ebp = (*gregs)[R_FP];
18 uintptr_t last_ebp = (*gregs)[EBP];
19 +#elif TARGET_CPU_X86_64
20 + uintptr_t last_ebp = (*gregs)[EBP];
22 uintptr_t stack_bottom = lwp_lister->GetLwpStackBottom(last_ebp);
23 if (stack_bottom > last_ebp &&
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)
34 lwp->thread_context = context.location();
35 memset(context.get(), 0, sizeof(MDRawContextSPARC));
36 return WriteContext(context.get(), writer_args->sig_ctx);
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],
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);
52 lwp->thread_id = lsp->pr_lwpid;
53 lwp->thread_context = context.location();
54 memset(context.get(), 0, sizeof(MDRawContextSPARC));
56 +#elif TARGET_CPU_X86 || TARGET_CPU_X86_64
57 if (!WriteLwpStack(lwp_lister,
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) {
70 exception.get()->thread_context = context.location();
71 memset(context.get(), 0, sizeof(MDRawContextSPARC));
72 return WriteContext(context.get(), writer_args->sig_ctx);
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];
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,
88 writer_args->sig_ctx->uc_mcontext.gregs[REG_O6]
90 writer_args->sig_ctx->uc_mcontext.gregs[UESP]
91 +#elif TARGET_CPU_X86_64
92 + writer_args->sig_ctx->uc_mcontext.gregs[UESP]