diff options
author | Thanos Doukoudakis <thanos.doukoudakis@isode.com> | 2017-10-16 11:53:42 (GMT) |
---|---|---|
committer | Kevin Smith <kevin.smith@isode.com> | 2017-10-19 09:22:57 (GMT) |
commit | eb07238e9c1a09a640dae06e8a433d7dba77f490 (patch) | |
tree | 51b618bbdf933bcca2b8deb915e131c48d80d5f7 /3rdParty/Breakpad/src/common/mac/macho_id.cc | |
parent | 80ef26c165a08d5251d7ee56e0bd07b86fc82f55 (diff) | |
download | swift-eb07238e9c1a09a640dae06e8a433d7dba77f490.zip swift-eb07238e9c1a09a640dae06e8a433d7dba77f490.tar.bz2 |
Upgrade Breakpad to latest
This commit will upgrade breakpad to version 1.0.86
(I9957f27cd134f862b9831e4b1d90f8a014eb37b6) from
https://chromium.googlesource.com/breakpad/breakpad
Added a script(BreakpadSwiftCleanup.sh) that remove files from Breakpad's
repository that are not used by Swift.
This commit also re-applies the changes that were introduced in commit
7f0fe603be200c09c74cf9cc295a972f3c3dbdfd, that change the minidump
filename format to include version and date
Test-Information:
https://travis-ci.org/google/breakpad/builds/283789304
https://ci.appveyor.com/project/vapier/breakpad/build/job/1bu73ysmcfpwg9e4
Tested by adding some code that forces a crash to the client on Windows 10
with VS2015. Verified the name and contents of the generated crash dump.
Change-Id: Ied9e74088e43137845edc09d070c2c27494aeade
Diffstat (limited to '3rdParty/Breakpad/src/common/mac/macho_id.cc')
-rw-r--r-- | 3rdParty/Breakpad/src/common/mac/macho_id.cc | 65 |
1 files changed, 34 insertions, 31 deletions
diff --git a/3rdParty/Breakpad/src/common/mac/macho_id.cc b/3rdParty/Breakpad/src/common/mac/macho_id.cc index abe1fab..c396ad8 100644 --- a/3rdParty/Breakpad/src/common/mac/macho_id.cc +++ b/3rdParty/Breakpad/src/common/mac/macho_id.cc @@ -35,13 +35,11 @@ -extern "C" { // necessary for Leopard - #include <fcntl.h> - #include <mach-o/loader.h> - #include <mach-o/swap.h> - #include <stdio.h> - #include <stdlib.h> - #include <string.h> - #include <sys/time.h> - #include <sys/types.h> - #include <unistd.h> -} + +#include <fcntl.h> +#include <mach-o/loader.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <sys/time.h> +#include <sys/types.h> +#include <unistd.h> @@ -63,3 +61,3 @@ MachoID::MachoID(const char *path) update_function_(NULL) { - strlcpy(path_, path, sizeof(path_)); + snprintf(path_, sizeof(path_), "%s", path); } @@ -72,3 +70,3 @@ MachoID::MachoID(const char *path, void *memory, size_t size) update_function_(NULL) { - strlcpy(path_, path, sizeof(path_)); + snprintf(path_, sizeof(path_), "%s", path); } @@ -127,3 +125,3 @@ void MachoID::UpdateCRC(unsigned char *bytes, size_t size) { void MachoID::UpdateMD5(unsigned char *bytes, size_t size) { - MD5Update(&md5_context_, bytes, size); + MD5Update(&md5_context_, bytes, static_cast<unsigned>(size)); } @@ -155,6 +153,8 @@ void MachoID::Update(MachoWalker *walker, off_t offset, size_t size) { -bool MachoID::UUIDCommand(int cpu_type, unsigned char bytes[16]) { +bool MachoID::UUIDCommand(cpu_type_t cpu_type, + cpu_subtype_t cpu_subtype, + unsigned char bytes[16]) { struct breakpad_uuid_command uuid_cmd; uuid_cmd.cmd = 0; - if (!WalkHeader(cpu_type, UUIDWalkerCB, &uuid_cmd)) + if (!WalkHeader(cpu_type, cpu_subtype, UUIDWalkerCB, &uuid_cmd)) return false; @@ -171,6 +171,8 @@ bool MachoID::UUIDCommand(int cpu_type, unsigned char bytes[16]) { -bool MachoID::IDCommand(int cpu_type, unsigned char identifier[16]) { +bool MachoID::IDCommand(cpu_type_t cpu_type, + cpu_subtype_t cpu_subtype, + unsigned char identifier[16]) { struct dylib_command dylib_cmd; dylib_cmd.cmd = 0; - if (!WalkHeader(cpu_type, IDWalkerCB, &dylib_cmd)) + if (!WalkHeader(cpu_type, cpu_subtype, IDWalkerCB, &dylib_cmd)) return false; @@ -212,3 +214,3 @@ bool MachoID::IDCommand(int cpu_type, unsigned char identifier[16]) { -uint32_t MachoID::Adler32(int cpu_type) { +uint32_t MachoID::Adler32(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype) { update_function_ = &MachoID::UpdateCRC; @@ -216,3 +218,3 @@ uint32_t MachoID::Adler32(int cpu_type) { - if (!WalkHeader(cpu_type, WalkerCB, this)) + if (!WalkHeader(cpu_type, cpu_subtype, WalkerCB, this)) return 0; @@ -222,3 +224,3 @@ uint32_t MachoID::Adler32(int cpu_type) { -bool MachoID::MD5(int cpu_type, unsigned char identifier[16]) { +bool MachoID::MD5(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype, unsigned char identifier[16]) { update_function_ = &MachoID::UpdateMD5; @@ -227,3 +229,3 @@ bool MachoID::MD5(int cpu_type, unsigned char identifier[16]) { - if (!WalkHeader(cpu_type, WalkerCB, this)) + if (!WalkHeader(cpu_type, cpu_subtype, WalkerCB, this)) return false; @@ -234,3 +236,4 @@ bool MachoID::MD5(int cpu_type, unsigned char identifier[16]) { -bool MachoID::WalkHeader(int cpu_type, +bool MachoID::WalkHeader(cpu_type_t cpu_type, + cpu_subtype_t cpu_subtype, MachoWalker::LoadCommandCallback callback, @@ -239,6 +242,6 @@ bool MachoID::WalkHeader(int cpu_type, MachoWalker walker(memory_, memory_size_, callback, context); - return walker.WalkHeader(cpu_type); + return walker.WalkHeader(cpu_type, cpu_subtype); } else { MachoWalker walker(path_, callback, context); - return walker.WalkHeader(cpu_type); + return walker.WalkHeader(cpu_type, cpu_subtype); } @@ -258,3 +261,3 @@ bool MachoID::WalkerCB(MachoWalker *walker, load_command *cmd, off_t offset, if (swap) - swap_segment_command(&seg, NXHostByteOrder()); + breakpad_swap_segment_command(&seg); @@ -275,3 +278,3 @@ bool MachoID::WalkerCB(MachoWalker *walker, load_command *cmd, off_t offset, if (swap) - swap_section(&sec, 1, NXHostByteOrder()); + breakpad_swap_section(&sec, 1); @@ -291,3 +294,3 @@ bool MachoID::WalkerCB(MachoWalker *walker, load_command *cmd, off_t offset, if (swap) - breakpad_swap_segment_command_64(&seg64, NXHostByteOrder()); + breakpad_swap_segment_command_64(&seg64); @@ -308,3 +311,3 @@ bool MachoID::WalkerCB(MachoWalker *walker, load_command *cmd, off_t offset, if (swap) - breakpad_swap_section_64(&sec64, 1, NXHostByteOrder()); + breakpad_swap_section_64(&sec64, 1); @@ -337,3 +340,3 @@ bool MachoID::UUIDWalkerCB(MachoWalker *walker, load_command *cmd, off_t offset, if (swap) - breakpad_swap_uuid_command(uuid_cmd, NXHostByteOrder()); + breakpad_swap_uuid_command(uuid_cmd); @@ -356,3 +359,3 @@ bool MachoID::IDWalkerCB(MachoWalker *walker, load_command *cmd, off_t offset, if (swap) - swap_dylib_command(dylib_cmd, NXHostByteOrder()); + breakpad_swap_dylib_command(dylib_cmd); |