diff --git a/Resources/Tests/PLCrashAsyncCompactUnwindEncodingTests/test.c b/Resources/Tests/PLCrashAsyncCompactUnwindEncodingTests/test.c index bd6a7f2..11c7324 100644 --- a/Resources/Tests/PLCrashAsyncCompactUnwindEncodingTests/test.c +++ b/Resources/Tests/PLCrashAsyncCompactUnwindEncodingTests/test.c @@ -1,7 +1,10 @@ #include #include -#define IMAGE_BASE 0x0 +// Keep in sync with PLCrashAsyncCompactUnwindEncodingTests +#define BASE_PC 0 +#define PC_COMPACT_COMMON (BASE_PC+1) + struct unwind_sect_compressed_page { struct unwind_info_compressed_second_level_page_header header; @@ -16,17 +19,18 @@ struct unwind_sect_regular_page { struct unwind_sect { struct unwind_info_section_header hdr; struct unwind_info_section_header_index_entry entries[3]; + + uint32_t common_encodings[1]; struct unwind_sect_regular_page regular_page_1; - struct unwind_sect_compressed_page compressed_page_1; }; struct unwind_sect data __attribute__((section("__TEXT,__unwind_info"))) = { .hdr = { .version = 1, - .commonEncodingsArraySectionOffset = 0, - .commonEncodingsArrayCount = 0, + .commonEncodingsArraySectionOffset = offsetof(struct unwind_sect, common_encodings), + .commonEncodingsArrayCount = 1, .personalityArraySectionOffset = 0, .personalityArrayCount = 0, .indexSectionOffset = offsetof(struct unwind_sect, entries), @@ -35,15 +39,19 @@ struct unwind_sect data __attribute__((section("__TEXT,__unwind_info"))) = { .entries = { { - .functionOffset = 0, + .functionOffset = BASE_PC, .secondLevelPagesSectionOffset = offsetof(struct unwind_sect, regular_page_1) }, { - .functionOffset = 1, + .functionOffset = PC_COMPACT_COMMON, .secondLevelPagesSectionOffset = offsetof(struct unwind_sect, compressed_page_1) }, { } // empty/ignored entry }, + + .common_encodings = { + 0x0, // PC_COMPACT_COMMON + }, .regular_page_1 = { .header = { @@ -56,6 +64,8 @@ struct unwind_sect data __attribute__((section("__TEXT,__unwind_info"))) = { } }, +#define COMPRESSED(foff, enc_index) ((foff & 0x00FFFFFF) | (enc_index << 24)) + .compressed_page_1 = { .header = { .kind = UNWIND_SECOND_LEVEL_COMPRESSED, @@ -63,7 +73,7 @@ struct unwind_sect data __attribute__((section("__TEXT,__unwind_info"))) = { .entryCount = 1 }, .entries = { - 0x0 + COMPRESSED(0, 0) }, }, }; diff --git a/Resources/Tests/PLCrashAsyncCompactUnwindEncodingTests/test.ios b/Resources/Tests/PLCrashAsyncCompactUnwindEncodingTests/test.ios index cbb0710..b8b0ffe 100755 Binary files a/Resources/Tests/PLCrashAsyncCompactUnwindEncodingTests/test.ios and b/Resources/Tests/PLCrashAsyncCompactUnwindEncodingTests/test.ios differ diff --git a/Resources/Tests/PLCrashAsyncCompactUnwindEncodingTests/test.macosx b/Resources/Tests/PLCrashAsyncCompactUnwindEncodingTests/test.macosx index 4dd396f..d2fc333 100755 Binary files a/Resources/Tests/PLCrashAsyncCompactUnwindEncodingTests/test.macosx and b/Resources/Tests/PLCrashAsyncCompactUnwindEncodingTests/test.macosx differ diff --git a/Resources/Tests/PLCrashAsyncCompactUnwindEncodingTests/test.sim b/Resources/Tests/PLCrashAsyncCompactUnwindEncodingTests/test.sim index 9765d00..c969cd0 100755 Binary files a/Resources/Tests/PLCrashAsyncCompactUnwindEncodingTests/test.sim and b/Resources/Tests/PLCrashAsyncCompactUnwindEncodingTests/test.sim differ diff --git a/Source/PLCrashAsyncCompactUnwindEncodingTests.m b/Source/PLCrashAsyncCompactUnwindEncodingTests.m index 2b5beb3..8a9cd55 100644 --- a/Source/PLCrashAsyncCompactUnwindEncodingTests.m +++ b/Source/PLCrashAsyncCompactUnwindEncodingTests.m @@ -50,7 +50,7 @@ #define BASE_PC 0 /** PC to use for the compact-common test */ -#define PC_COMPACT_COMMON 1 +#define PC_COMPACT_COMMON (BASE_PC+1) /** * @internal