From e3354bc7c5349b59f1a93fc1d4564d108a755d0d Mon Sep 17 00:00:00 2001 From: Khalil Estell Date: Thu, 18 Jul 2024 15:34:08 -0700 Subject: [PATCH] :construction: Turn on destructors (currently broken) --- demos/applications/multi_levels.cpp | 34 ++++++++++---------- notes.md | 50 +---------------------------- src/arm_cortex/estell/exception.cpp | 8 ++++- 3 files changed, 25 insertions(+), 67 deletions(-) diff --git a/demos/applications/multi_levels.cpp b/demos/applications/multi_levels.cpp index 2b01412..16149bc 100644 --- a/demos/applications/multi_levels.cpp +++ b/demos/applications/multi_levels.cpp @@ -20,13 +20,13 @@ struct my_error_t int funct_group0_0(); int funct_group1_0(); -// int funct_group2_0(); -// int funct_group3_0(); -// int funct_group4_0(); -// int funct_group5_0(); -// int funct_group6_0(); -// int funct_group7_0(); -// int funct_group8_0(); +int funct_group2_0(); +int funct_group3_0(); +int funct_group4_0(); +int funct_group5_0(); +int funct_group6_0(); +int funct_group7_0(); +int funct_group8_0(); // int funct_group9_0(); // int funct_group10_0(); // int funct_group11_0(); @@ -46,13 +46,12 @@ int funct_group1_0(); using signature = int(void); -std::array functions = { - &funct_group0_0, - &funct_group1_0, +std::array functions = { + &funct_group0_0, &funct_group1_0, &funct_group2_0, + &funct_group3_0, &funct_group4_0, &funct_group5_0, + &funct_group6_0, &funct_group7_0, &funct_group8_0, #if 0 - funct_group2_0, funct_group3_0, - funct_group4_0, funct_group5_0, funct_group6_0, funct_group7_0, - funct_group8_0, funct_group9_0, funct_group10_0, funct_group11_0, + funct_group9_0, funct_group10_0, funct_group11_0, funct_group12_0, funct_group13_0, funct_group14_0, funct_group15_0, funct_group16_0, funct_group17_0, funct_group18_0, funct_group19_0, @@ -82,7 +81,7 @@ void application(resource_list& p_resources) } } -#if 0 +#if 1 for (std::size_t i = 0; i < functions.size(); i++) { bool was_caught = false; try { @@ -149,9 +148,9 @@ class class_1 class_1& operator=(class_1&) = delete; class_1(class_1&&) noexcept = default; class_1& operator=(class_1&&) noexcept = default; -#if 1 +#if 0 ~class_1() = default; -#elif +#else ~class_1() { side_effect = side_effect & ~(1 << m_channel); @@ -2932,7 +2931,6 @@ int funct_group7_23() return side_effect; } -#if 0 int funct_group8_1(); int funct_group8_0() @@ -3512,6 +3510,8 @@ int funct_group8_47() return side_effect; } +#if 0 + int funct_group9_1(); int funct_group9_0() diff --git a/notes.md b/notes.md index 2a01f71..955f09f 100644 --- a/notes.md +++ b/notes.md @@ -7,52 +7,4 @@ - Reduce the instructions for `restore_cpu_state` - Remove shift variable in `read_uleb128` -info registers -r0 0x7fffffff 2147483647 -r1 0x0 0 -r2 0x20000348 536871752 -r3 0x80012f5 134222581 -r4 0x20000348 536871752 -r5 0x20000118 536871192 -r6 0x20000278 536871544 -r7 0x20000358 536871768 -r8 0x7e 126 -r9 0x0 0 -r10 0x0 0 -r11 0x0 0 -r12 0x0 0 -sp 0x200027d0 0x200027d0 -lr 0x8001059 0x8001059 -pc 0x800107a 0x800107a -xpsr 0x61000000 1627389952 -msp 0x200027d0 0x200027d0 -psp 0x922f3724 0x922f3724 -primask 0x0 0 -control 0x0 0 -basepri 0x0 0 -faultmask 0x0 0 - -(gdb) info registers -r0 0x200001cc 536871372 -r1 0x1 1 -r2 0x8001085 134221957 -r3 0x20000188 536871304 -r4 0x20000348 536871752 -r5 0x20000118 536871192 -r6 0x0 0 -r7 0x0 0 -r8 0x7e 126 -r9 0x0 0 -r10 0x0 0 -r11 0x0 0 -r12 0x0 0 -sp 0x200027d0 0x200027d0 -lr 0x800108d 0x800108d -pc 0x800108c 0x800108c -xpsr 0x1000000 16777216 -msp 0x200027d0 0x200027d0 -psp 0x922f3724 0x922f3724 -primask 0x0 0 -control 0x0 0 -basepri 0x0 0 -faultmask 0x0 0 \ No newline at end of file +- I've turned destructors back on and we are terminating. Looks like the encoding byte has 0x15 which we don't support. 0x5 for the encoding type is not present. So we need to figure out what that is. Its either us reading the wrong data OR a new format we need to handle. \ No newline at end of file diff --git a/src/arm_cortex/estell/exception.cpp b/src/arm_cortex/estell/exception.cpp index 63a9182..d201691 100644 --- a/src/arm_cortex/estell/exception.cpp +++ b/src/arm_cortex/estell/exception.cpp @@ -251,9 +251,15 @@ personality_encoding operator&(personality_encoding const& p_encoding, result = *as(ptr); ptr += sizeof(int32_t); break; - case personality_encoding::sleb128: case personality_encoding::sdata8: + result = *as(ptr); + ptr += sizeof(int64_t); + break; case personality_encoding::udata8: + result = *as(ptr); + ptr += sizeof(uint64_t); + break; + case personality_encoding::sleb128: default: std::terminate(); break;