[PATCH 3/9] [WineDbg]: added the a to the format supported in examine command (a stands for address)

Eric Pouech eric.pouech at orange.fr
Mon Dec 14 15:05:34 CST 2009




A+
---

 programs/winedbg/debug.l  |    2 +-
 programs/winedbg/memory.c |   23 ++++++++++++++++-------
 2 files changed, 17 insertions(+), 8 deletions(-)


diff --git a/programs/winedbg/debug.l b/programs/winedbg/debug.l
index 9b1e4fa..2e87ddb 100644
--- a/programs/winedbg/debug.l
+++ b/programs/winedbg/debug.l
@@ -109,7 +109,7 @@ static int syntax_error;
 
 DIGIT	   [0-9]
 HEXDIGIT   [0-9a-fA-F]
-FORMAT     [ubcdgiswx]
+FORMAT     [ubcdgiswxa]
 IDENTIFIER [_a-zA-Z~?][_a-zA-Z0-9~?@]*
 PATHNAME   [\\/_a-zA-Z0-9\.~@][\\/\-_a-zA-Z0-9\.~@]*
 STRING     \"[^\n"]+\"
diff --git a/programs/winedbg/memory.c b/programs/winedbg/memory.c
index 2292ea6..e4f4729 100644
--- a/programs/winedbg/memory.c
+++ b/programs/winedbg/memory.c
@@ -216,15 +216,24 @@ void memory_examine(const struct dbg_lvalue *lvalue, int count, char format)
                 }                                                       \
             }                                                           \
             dbg_printf("\n");                                           \
-        }                                                               \
-	return
+        }
 #define DO_DUMP(_t,_l,_f) DO_DUMP2(_t,_l,_f,_v)
 
-    case 'x': DO_DUMP(int, 4, " %8.8x");
-    case 'd': DO_DUMP(unsigned int, 4, " %4.4d");
-    case 'w': DO_DUMP(unsigned short, 8, " %04x");
-    case 'c': DO_DUMP2(char, 32, " %c", (_v < 0x20) ? ' ' : _v);
-    case 'b': DO_DUMP2(char, 16, " %02x", (_v) & 0xff);
+    case 'x': DO_DUMP(int, 4, " %8.8x"); break;
+    case 'd': DO_DUMP(unsigned int, 4, " %4.4d"); break;
+    case 'w': DO_DUMP(unsigned short, 8, " %04x"); break;
+    case 'a':
+        if (sizeof(DWORD_PTR) == 4)
+        {
+            DO_DUMP(DWORD_PTR, 4, " %8.8lx");
+        }
+        else
+        {
+            DO_DUMP(DWORD_PTR, 2, " %16.16lx");
+        }
+        break;
+    case 'c': DO_DUMP2(char, 32, " %c", (_v < 0x20) ? ' ' : _v); break;
+    case 'b': DO_DUMP2(char, 16, " %02x", (_v) & 0xff); break;
     }
 }
 






More information about the wine-patches mailing list