winedbg: Respect Thumb mode when adjusting PC on ARM

André Hentschel nerv at dawncrow.de
Sat Mar 10 11:26:05 CST 2012


---
 programs/winedbg/be_arm.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/programs/winedbg/be_arm.c b/programs/winedbg/be_arm.c
index c39043c..6c1cc05 100644
--- a/programs/winedbg/be_arm.c
+++ b/programs/winedbg/be_arm.c
@@ -205,13 +205,15 @@ static void be_arm_clear_watchpoint(CONTEXT* ctx, unsigned idx)
 
 static int be_arm_adjust_pc_for_break(CONTEXT* ctx, BOOL way)
 {
+    INT step = (ctx->Cpsr & 0x20) ? 2 : 4;
+
     if (way)
     {
-        ctx->Pc-=4;
-        return -4;
+        ctx->Pc -= step;
+        return -step;
     }
-    ctx->Pc+=4;
-    return 4;
+    ctx->Pc += step;
+    return step;
 }
 
 static int be_arm_fetch_integer(const struct dbg_lvalue* lvalue, unsigned size,
-- 

Best Regards, André Hentschel
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Nachrichtenteil als Anhang
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20120310/fb117e41/attachment.ksh>


More information about the wine-patches mailing list