From 936b047b124ffd59644c63ef69c427edc2703918 Mon Sep 17 00:00:00 2001 From: Matthew Parlane Date: Tue, 8 Jan 2013 20:56:26 +1300 Subject: [PATCH] Fixed bug on entry that caused first step to trigger two stops at start. --- Source/Core/Core/Src/Core.cpp | 3 ++- Source/Core/Core/Src/PowerPC/GDBStub.cpp | 9 +++++++-- Source/Core/Core/Src/PowerPC/GDBStub.h | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Source/Core/Core/Src/Core.cpp b/Source/Core/Core/Src/Core.cpp index f864b35328..34db612513 100644 --- a/Source/Core/Core/Src/Core.cpp +++ b/Source/Core/Core/Src/Core.cpp @@ -330,7 +330,8 @@ void CpuThread() if(_CoreParameter.iGDBPort > 0) { gdb_init(_CoreParameter.iGDBPort); - gdb_handle_exception(); + // break at next instruction (the first instruction) + gdb_break(); } #endif diff --git a/Source/Core/Core/Src/PowerPC/GDBStub.cpp b/Source/Core/Core/Src/PowerPC/GDBStub.cpp index 745287e575..d7dfc46a56 100644 --- a/Source/Core/Core/Src/PowerPC/GDBStub.cpp +++ b/Source/Core/Core/Src/PowerPC/GDBStub.cpp @@ -633,18 +633,23 @@ static void gdb_write_mem() gdb_reply("OK"); } -static void gdb_step() +// forces a break on next instruction check +void gdb_break() { step_break = 1; send_signal = 1; } +static void gdb_step() +{ + gdb_break(); +} + static void gdb_continue() { send_signal = 1; } - bool gdb_add_bp(u32 type, u32 addr, u32 len) { gdb_bp_t *bp; diff --git a/Source/Core/Core/Src/PowerPC/GDBStub.h b/Source/Core/Core/Src/PowerPC/GDBStub.h index cf01d22c8b..300f74bf91 100644 --- a/Source/Core/Core/Src/PowerPC/GDBStub.h +++ b/Source/Core/Core/Src/PowerPC/GDBStub.h @@ -44,6 +44,7 @@ typedef enum { void gdb_init(u32 port); void gdb_deinit(); bool gdb_active(); +void gdb_break(); void gdb_handle_exception(); int gdb_signal(u32 signal);