target.c, jim_target_md using command_print_sameline
authorVandra Akos <axos88@gmail.com>
Fri, 25 May 2012 01:02:55 +0000 (03:02 +0200)
committerFreddie Chopin <freddie.chopin@gmail.com>
Wed, 11 Jul 2012 08:08:01 +0000 (08:08 +0000)
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 <axos88@gmail.com>
Reviewed-on: http://openocd.zylin.com/669
Tested-by: jenkins
Reviewed-by: Alexander Osipenko <sipych@gmail.com>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
src/target/target.c

index dbac9a1fba0ebaf340a51ad191fb296e6a80cd1d..80e2c4cf21d06b0ce0d1b84929d162f32f46ceb0 100644 (file)
@@ -4447,32 +4447,32 @@ static int jim_target_md(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
                        return JIM_ERR;
                }
 
                        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]));
                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)
                        }
                        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]));
                        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)
                        }
                        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]));
                        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)
                        }
                        for (; (x < 16) ; x += 1)
-                               command_print(NULL, "   ");
+                               command_print_sameline(NULL, "   ");
                        break;
                }
                /* ascii-ify the bytes */
                        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 */
                /* 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;
                /* NEXT... */
                bytes -= 16;
                addr += 16;

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)