mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-11-03 23:28:48 +00:00 
			
		
		
		
	arm_dynarmic: Pass breakpoints to gdbstub
Allow gdbstub to handle execution breakpoints
This commit is contained in:
		
							parent
							
								
									7c97e8df62
								
							
						
					
					
						commit
						b4d9d9661a
					
				
					 2 changed files with 18 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -12,6 +12,7 @@
 | 
			
		|||
#include "core/arm/dyncom/arm_dyncom_interpreter.h"
 | 
			
		||||
#include "core/core.h"
 | 
			
		||||
#include "core/core_timing.h"
 | 
			
		||||
#include "core/gdbstub/gdbstub.h"
 | 
			
		||||
#include "core/hle/kernel/svc.h"
 | 
			
		||||
#include "core/memory.h"
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -125,6 +126,22 @@ public:
 | 
			
		|||
    }
 | 
			
		||||
 | 
			
		||||
    void ExceptionRaised(VAddr pc, Dynarmic::A32::Exception exception) override {
 | 
			
		||||
        switch (exception) {
 | 
			
		||||
        case Dynarmic::A32::Exception::UndefinedInstruction:
 | 
			
		||||
        case Dynarmic::A32::Exception::UnpredictableInstruction:
 | 
			
		||||
            break;
 | 
			
		||||
        case Dynarmic::A32::Exception::Breakpoint:
 | 
			
		||||
            if (GDBStub::IsConnected()) {
 | 
			
		||||
                parent.jit->HaltExecution();
 | 
			
		||||
                parent.SetPC(pc);
 | 
			
		||||
                Kernel::Thread* thread = Kernel::GetCurrentThread();
 | 
			
		||||
                parent.SaveContext(thread->context);
 | 
			
		||||
                GDBStub::Break();
 | 
			
		||||
                GDBStub::SendTrap(thread, 5);
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
            break;
 | 
			
		||||
        }
 | 
			
		||||
        ASSERT_MSG(false, "ExceptionRaised(exception = {}, pc = {:08X}, code = {:08X})",
 | 
			
		||||
                   static_cast<std::size_t>(exception), pc, MemoryReadCode(pc));
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue