From: Vandra Akos Date: Fri, 25 May 2012 01:02:55 +0000 (+0200) Subject: target.c, jim_target_md using command_print_sameline X-Git-Tag: v0.6.0-rc1~42 X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=commitdiff_plain;h=9ce207a52affec0270678808ce760450905c3f7d target.c, jim_target_md using command_print_sameline jim_target_md is supposed to print out results with command_print in hexdump format. It was using command_print which appends a newline character aftre every invocation. Using command_print_sameline instead Change-Id: Iaff03021acc38d54b5a082cb58b82aa4449c0715 Signed-off-by: Vandra Akos Reviewed-on: http://openocd.zylin.com/669 Tested-by: jenkins Reviewed-by: Alexander Osipenko Reviewed-by: Freddie Chopin --- diff --git a/src/target/target.c b/src/target/target.c index dbac9a1fba..80e2c4cf21 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -4447,32 +4447,32 @@ static int jim_target_md(Jim_Interp *interp, int argc, Jim_Obj *const *argv) return JIM_ERR; } - command_print(NULL, "0x%08x ", (int)(addr)); + command_print_sameline(NULL, "0x%08x ", (int)(addr)); switch (dwidth) { case 4: for (x = 0; x < 16 && x < y; x += 4) { z = target_buffer_get_u32(target, &(target_buf[x])); - command_print(NULL, "%08x ", (int)(z)); + command_print_sameline(NULL, "%08x ", (int)(z)); } for (; (x < 16) ; x += 4) - command_print(NULL, " "); + command_print_sameline(NULL, " "); break; case 2: for (x = 0; x < 16 && x < y; x += 2) { z = target_buffer_get_u16(target, &(target_buf[x])); - command_print(NULL, "%04x ", (int)(z)); + command_print_sameline(NULL, "%04x ", (int)(z)); } for (; (x < 16) ; x += 2) - command_print(NULL, " "); + command_print_sameline(NULL, " "); break; case 1: default: for (x = 0 ; (x < 16) && (x < y) ; x += 1) { z = target_buffer_get_u8(target, &(target_buf[x])); - command_print(NULL, "%02x ", (int)(z)); + command_print_sameline(NULL, "%02x ", (int)(z)); } for (; (x < 16) ; x += 1) - command_print(NULL, " "); + command_print_sameline(NULL, " "); break; } /* ascii-ify the bytes */ @@ -4493,7 +4493,7 @@ static int jim_target_md(Jim_Interp *interp, int argc, Jim_Obj *const *argv) /* terminate */ target_buf[16] = 0; /* print - with a newline */ - command_print(NULL, "%s\n", target_buf); + command_print_sameline(NULL, "%s\n", target_buf); /* NEXT... */ bytes -= 16; addr += 16;