[PATCH 1/6] [WineDbg]: correctly display whether we're in 32 vs 64 bit code

Eric Pouech eric.pouech at orange.fr
Mon Apr 19 15:33:19 CDT 2010




A+
---

 programs/winedbg/tgt_active.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)


diff --git a/programs/winedbg/tgt_active.c b/programs/winedbg/tgt_active.c
index 6153243..8283550 100644
--- a/programs/winedbg/tgt_active.c
+++ b/programs/winedbg/tgt_active.c
@@ -131,7 +131,8 @@ static unsigned dbg_exception_prolog(BOOL is_debug, BOOL first_chance, const EXC
         switch (addr.Mode)
         {
         case AddrModeFlat:
-            dbg_printf(" in 32-bit code (%s)",
+            dbg_printf(" in %d-bit code (%s)",
+                       be_cpu->pointer_size * 8,
                        memory_offset_to_string(hexbuf, addr.Offset, 0));
             break;
         case AddrModeReal:
@@ -141,7 +142,7 @@ static unsigned dbg_exception_prolog(BOOL is_debug, BOOL first_chance, const EXC
             dbg_printf(" in 16-bit code (%04x:%04x)", addr.Segment, (unsigned) addr.Offset);
             break;
         case AddrMode1632:
-            dbg_printf(" in 32-bit code (%04x:%08lx)", addr.Segment, (unsigned long) addr.Offset);
+            dbg_printf(" in segmented 32-bit code (%04x:%08lx)", addr.Segment, (unsigned long) addr.Offset);
             break;
         default: dbg_printf(" bad address");
         }
@@ -164,15 +165,14 @@ static unsigned dbg_exception_prolog(BOOL is_debug, BOOL first_chance, const EXC
     if (addr.Mode != dbg_curr_thread->addr_mode)
     {
         const char* name = NULL;
-        
+
         switch (addr.Mode)
         {
         case AddrMode1616: name = "16 bit";     break;
-        case AddrMode1632: name = "32 bit";     break;
+        case AddrMode1632: name = "segmented 32 bit"; break;
         case AddrModeReal: name = "vm86";       break;
-        case AddrModeFlat: name = "32 bit";     break;
+        case AddrModeFlat: name = be_cpu->pointer_size == 4 ? "32 bit" : "64 bit"; break;
         }
-        
         dbg_printf("In %s mode.\n", name);
         dbg_curr_thread->addr_mode = addr.Mode;
     }






More information about the wine-patches mailing list