Skip to content

Commit

Permalink
🚧 Turn on destructors (currently broken)
Browse files Browse the repository at this point in the history
  • Loading branch information
kammce committed Jul 18, 2024
1 parent 8f29487 commit e3354bc
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 67 deletions.
34 changes: 17 additions & 17 deletions demos/applications/multi_levels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -46,13 +46,12 @@ int funct_group1_0();

using signature = int(void);

std::array<signature*, 2> functions = {
&funct_group0_0,
&funct_group1_0,
std::array<signature*, 9> 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,
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -2932,7 +2931,6 @@ int funct_group7_23()
return side_effect;
}

#if 0
int funct_group8_1();

int funct_group8_0()
Expand Down Expand Up @@ -3512,6 +3510,8 @@ int funct_group8_47()
return side_effect;
}

#if 0

int funct_group9_1();

int funct_group9_0()
Expand Down
50 changes: 1 addition & 49 deletions notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <application(resource_list&)+20>
pc 0x800107a 0x800107a <application(resource_list&)+54>
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 <application(resource_list&)+72>
pc 0x800108c 0x800108c <application(resource_list&)+72>
xpsr 0x1000000 16777216
msp 0x200027d0 0x200027d0
psp 0x922f3724 0x922f3724
primask 0x0 0
control 0x0 0
basepri 0x0 0
faultmask 0x0 0
- 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.
8 changes: 7 additions & 1 deletion src/arm_cortex/estell/exception.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,15 @@ personality_encoding operator&(personality_encoding const& p_encoding,
result = *as<int32_t>(ptr);
ptr += sizeof(int32_t);
break;
case personality_encoding::sleb128:
case personality_encoding::sdata8:
result = *as<int64_t>(ptr);
ptr += sizeof(int64_t);
break;
case personality_encoding::udata8:
result = *as<uint64_t>(ptr);
ptr += sizeof(uint64_t);
break;
case personality_encoding::sleb128:
default:
std::terminate();
break;
Expand Down

0 comments on commit e3354bc

Please sign in to comment.