From: Philippe Waroquiers Date: Sat, 28 Sep 2019 20:18:23 +0000 (+0200) Subject: xb monitor command: fix adressability for first byte of a line X-Git-Tag: VALGRIND_3_16_0~212 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe7ec1eca269faeca0fa3b025ea02b72660477b7;p=thirdparty%2Fvalgrind.git 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. --- 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 {