winedbg: x /s improvement

Jeff Smith whydoubt at hotmail.com
Thu Oct 24 21:12:42 CDT 2002


Summary:
  In winedbg, "x /s ..." did not act appropriately.
  It would print one or more characters from the
  memory location, then several characters of junk.
  After this patch, it should act as expected.

Changelog:
  Fixed behaviour of "x /s ..." in winedbg.

Index: programs/winedbg/memory.c
===================================================================
RCS file: /home/wine/wine/programs/winedbg/memory.c,v
retrieving revision 1.1
diff -u -r1.1 memory.c
--- programs/winedbg/memory.c	13 Sep 2002 17:54:28 -0000	1.1
+++ programs/winedbg/memory.c	25 Oct 2002 01:54:02 -0000
@@ -285,6 +285,7 @@
		DEBUG_Printf(DBG_CHN_MESG, "\n");
		return;
         case 's':
+		if (count == 1) count = 256;
                 DEBUG_nchar += DEBUG_PrintStringA(DBG_CHN_MESG, 
&value.addr, count);
		DEBUG_Printf(DBG_CHN_MESG, "\n");
		return;
@@ -350,16 +351,14 @@

     if (len == -1) len = 32767; /* should be big enough */

-    /* so that the ach is always terminated */
-    ach[sizeof(ach) - 1] = '\0';
-    for (i = len; i >= 0; i -= sizeof(ach) - 1)
+    for (i = len; i > 0; i -= l)
     {
         l = min(sizeof(ach) - 1, i);
         DEBUG_READ_MEM_VERBOSE(lin, ach, l);
+	ach[l] = '\0';  /* protect from displaying junk */
         l = strlen(ach);
         DEBUG_OutputA(chnl, ach, l);
         lin += l;
-        if (l < sizeof(ach) - 1) break;
     }
     return len - i; /* number of actually written chars */
}






_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online 
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963




More information about the wine-patches mailing list