|
18 | 18 | #include "PThreadMutex.h"
|
19 | 19 | #include "SysSignal.h"
|
20 | 20 | #include <cerrno>
|
| 21 | +#include <inttypes.h> |
21 | 22 | #include <sys/ptrace.h>
|
22 | 23 | #include <sys/types.h>
|
23 |
| -#include <inttypes.h> |
24 | 24 |
|
25 |
| -static void AppendExceptionData( |
26 |
| - std::vector<mach_exception_data_type_t> &out, |
27 |
| - mach_exception_data_t Data, mach_msg_type_number_t Count) { |
| 25 | +static void AppendExceptionData(std::vector<mach_exception_data_type_t> &out, |
| 26 | + mach_exception_data_t Data, |
| 27 | + mach_msg_type_number_t Count) { |
28 | 28 | mach_exception_data_type_t Buf;
|
29 | 29 | for (mach_msg_type_number_t i = 0; i < Count; ++i) {
|
30 | 30 | // The input Data we receive need not be aligned correctly.
|
31 | 31 | // Perform an unaligned copy by pretending we're dealing with
|
32 | 32 | // a char* buffer. This is required to work around UBSAN/ASAN
|
33 | 33 | // "misaligned address" errors.
|
34 |
| - auto * src = reinterpret_cast<char*>(&Buf); |
35 |
| - auto * dst = reinterpret_cast<char*>(Data + i); |
| 34 | + auto *src = reinterpret_cast<char *>(&Buf); |
| 35 | + auto *dst = reinterpret_cast<char *>(Data + i); |
36 | 36 | memcpy(dst, src, sizeof(mach_exception_data_type_t));
|
37 | 37 | out.push_back(Buf);
|
38 | 38 | }
|
@@ -115,7 +115,8 @@ catch_mach_exception_raise(mach_port_t exc_port, mach_port_t thread_port,
|
115 | 115 | std::vector<mach_exception_data_type_t> exc_datas;
|
116 | 116 | AppendExceptionData(exc_datas, exc_data, exc_data_count);
|
117 | 117 | DNBLogThreaded("::%s ( exc_port = 0x%4.4x, thd_port = 0x%4.4x, tsk_port = "
|
118 |
| - "0x%4.4x, exc_type = %d ( %s ), exc_data[%d] = { 0x%" PRIx64 ", " |
| 118 | + "0x%4.4x, exc_type = %d ( %s ), exc_data[%d] = { 0x%" PRIx64 |
| 119 | + ", " |
119 | 120 | "0x%" PRIx64 " })",
|
120 | 121 | __FUNCTION__, exc_port, thread_port, task_port, exc_type,
|
121 | 122 | MachException::Name(exc_type), exc_data_count,
|
|
0 commit comments