From fe7ec1eca269faeca0fa3b025ea02b72660477b7 Mon Sep 17 00:00:00 2001 From: Philippe Waroquiers Date: Sat, 28 Sep 2019 22:18:23 +0200 Subject: [PATCH] xb monitor command: fix adressability for first byte of a line 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 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/memcheck/mc_main.c b/memcheck/mc_main.c index 6685dff6dd..3afc9911a4 100644 --- a/memcheck/mc_main.c +++ b/memcheck/mc_main.c @@ -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 { -- 2.47.2