diff options
author | Lioncash <mathew1800@gmail.com> | 2019-07-13 03:48:46 +0200 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2019-07-13 03:48:49 +0200 |
commit | 093e5440e202931402129acabcb73426079552a8 (patch) | |
tree | e9ba19e06844fb3bf17c5bb7d32d4246baa5b74a /src/core | |
parent | Merge pull request #2725 from ogniK5377/mult-audbuffer (diff) | |
download | yuzu-093e5440e202931402129acabcb73426079552a8.tar yuzu-093e5440e202931402129acabcb73426079552a8.tar.gz yuzu-093e5440e202931402129acabcb73426079552a8.tar.bz2 yuzu-093e5440e202931402129acabcb73426079552a8.tar.lz yuzu-093e5440e202931402129acabcb73426079552a8.tar.xz yuzu-093e5440e202931402129acabcb73426079552a8.tar.zst yuzu-093e5440e202931402129acabcb73426079552a8.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/arm/unicorn/arm_unicorn.cpp | 9 | ||||
-rw-r--r-- | src/core/core.h | 4 |
2 files changed, 6 insertions, 7 deletions
diff --git a/src/core/arm/unicorn/arm_unicorn.cpp b/src/core/arm/unicorn/arm_unicorn.cpp index b0ee7821a..97d5c2a8a 100644 --- a/src/core/arm/unicorn/arm_unicorn.cpp +++ b/src/core/arm/unicorn/arm_unicorn.cpp @@ -50,11 +50,14 @@ static void CodeHook(uc_engine* uc, uint64_t address, uint32_t size, void* user_ static bool UnmappedMemoryHook(uc_engine* uc, uc_mem_type type, u64 addr, int size, u64 value, void* user_data) { + auto* const system = static_cast<System*>(user_data); + ARM_Interface::ThreadContext ctx{}; - Core::CurrentArmInterface().SaveContext(ctx); + system->CurrentArmInterface().SaveContext(ctx); ASSERT_MSG(false, "Attempted to read from unmapped memory: 0x{:X}, pc=0x{:X}, lr=0x{:X}", addr, ctx.pc, ctx.cpu_registers[30]); - return {}; + + return false; } ARM_Unicorn::ARM_Unicorn(System& system) : system{system} { @@ -65,7 +68,7 @@ ARM_Unicorn::ARM_Unicorn(System& system) : system{system} { uc_hook hook{}; CHECKED(uc_hook_add(uc, &hook, UC_HOOK_INTR, (void*)InterruptHook, this, 0, -1)); - CHECKED(uc_hook_add(uc, &hook, UC_HOOK_MEM_INVALID, (void*)UnmappedMemoryHook, this, 0, -1)); + CHECKED(uc_hook_add(uc, &hook, UC_HOOK_MEM_INVALID, (void*)UnmappedMemoryHook, &system, 0, -1)); if (GDBStub::IsServerEnabled()) { CHECKED(uc_hook_add(uc, &hook, UC_HOOK_CODE, (void*)CodeHook, this, 0, -1)); last_bkpt_hit = false; diff --git a/src/core/core.h b/src/core/core.h index 11e73278e..8ebb385ac 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -327,10 +327,6 @@ private: static System s_instance; }; -inline ARM_Interface& CurrentArmInterface() { - return System::GetInstance().CurrentArmInterface(); -} - inline Kernel::Process* CurrentProcess() { return System::GetInstance().CurrentProcess(); } |