X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Ftarget%2Ftarget.c;h=b8e4c2ff9ed937dc0720b2f98634a3c6923aa074;hb=cbfc443c7b8582631d389bd1932334487f9a1576;hp=dbac9a1fba0ebaf340a51ad191fb296e6a80cd1d;hpb=30aacc0564dc200ab3397d7f7c05dab932bed85b;p=openocd.git diff --git a/src/target/target.c b/src/target/target.c index dbac9a1fba..b8e4c2ff9e 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; @@ -5131,8 +5131,10 @@ static int jim_target_smp(Jim_Interp *interp, int argc, Jim_Obj *const *argv) target->head = head; curr = curr->next; } - if (target->rtos) + + if (target && target->rtos) retval = rtos_smp_init(head->target); + return retval; }