]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
xb monitor command: fix adressability for first byte of a line
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Sat, 28 Sep 2019 20:18:23 +0000 (22:18 +0200)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Sat, 28 Sep 2019 20:18:23 +0000 (22:18 +0200)
The addressability of the first byte of a new line was used for the first
byte of the previous line.

Fix by first outputting the line, then getting the addressability of
the first byte of the new line.

memcheck/mc_main.c

index 6685dff6dda87acb7e949336eb1a89fdb127062a..3afc9911a4fb593fd0d36fc8f30c5671ffa6a16e 100644 (file)
@@ -6803,10 +6803,6 @@ static Bool handle_gdb_monitor_command (ThreadId tid, HChar *req)
          Int unaddressable = 0;
          for (i = 0; i < szB; i++) {
             Int bnr = i % 8;
-            res[bnr] = mc_get_or_set_vbits_for_client 
-               (address+i, (Addr) &vbits[bnr], 1, 
-                False, /* get them */
-                False  /* is client request */ ); 
             /* We going to print the first vabits of a new line.
                Terminate the previous line if needed: prints a line with the
                address and the data. */
@@ -6817,6 +6813,10 @@ static Bool handle_gdb_monitor_command (ThreadId tid, HChar *req)
                }
                VG_(printf) ("\t"); // To align VABITS with gdb_xb layout
             }
+            res[bnr] = mc_get_or_set_vbits_for_client
+               (address+i, (Addr) &vbits[bnr], 1,
+                False, /* get them */
+                False  /* is client request */ );
             if (res[bnr] == 1) {
                VG_(printf) ("\t  %02x", vbits[bnr]);
             } else {