From 2cb8541462e3cc31e9a4ffe63f430168c0c747d1 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Sat, 20 Oct 2018 19:07:52 -0300 Subject: Print stack trace on invalid memory accesses (#461) * Print stack trace on invalid memory accesses * Rebased, change code region base address for 39-bits address space, print stack trace on break and undefined instructions too --- ChocolArm64/Memory/AMemory.cs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ChocolArm64/Memory') diff --git a/ChocolArm64/Memory/AMemory.cs b/ChocolArm64/Memory/AMemory.cs index bb6a2b54..2854871e 100644 --- a/ChocolArm64/Memory/AMemory.cs +++ b/ChocolArm64/Memory/AMemory.cs @@ -1,3 +1,4 @@ +using ChocolArm64.Events; using ChocolArm64.Exceptions; using ChocolArm64.State; using System; @@ -51,6 +52,8 @@ namespace ChocolArm64.Memory private byte*** PageTable; + public event EventHandler InvalidAccess; + public AMemory(IntPtr Ram) { Monitors = new Dictionary(); @@ -512,6 +515,8 @@ Unmapped: return (byte*)Ptr + (Position & PageMask); } + InvalidAccess?.Invoke(this, new AInvalidAccessEventArgs(Position)); + throw new VmmPageFaultException(Position); } @@ -560,6 +565,8 @@ Unmapped: return (byte*)Ptr + (Position & PageMask); } + InvalidAccess?.Invoke(this, new AInvalidAccessEventArgs(Position)); + throw new VmmPageFaultException(Position); } -- cgit v1.2.3