To prepare for handling TCL return values consistently, all calls
to command_print/command_print_sameline should be ready to switch
to CMD as first parameter.
Change prototype of esirisc_trace_dump*() functions to pass CMD
instead of CMD_CTX.
This change was part of http://openocd.zylin.com/1815 from Paul
Fertser and has been extracted and rebased to simplify the review.
Change-Id: Ia43bff112372cbb76e1aea9f59f4a9b6df05c15d
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5079
Tested-by: jenkins
Reviewed-by: Steven Stallion <sstallion@gmail.com>
-static int esirisc_trace_dump(struct command_context *cmd_ctx, const char *filename,
+static int esirisc_trace_dump(struct command_invocation *cmd, const char *filename,
uint8_t *buffer, uint32_t size)
{
struct fileio *fileio;
uint8_t *buffer, uint32_t size)
{
struct fileio *fileio;
retval = fileio_open(&fileio, filename, FILEIO_WRITE, FILEIO_BINARY);
if (retval != ERROR_OK) {
retval = fileio_open(&fileio, filename, FILEIO_WRITE, FILEIO_BINARY);
if (retval != ERROR_OK) {
- command_print(cmd_ctx, "could not open dump file: %s", filename);
+ command_print(cmd->ctx, "could not open dump file: %s", filename);
return retval;
}
retval = fileio_write(fileio, size, buffer, &size_written);
if (retval == ERROR_OK)
return retval;
}
retval = fileio_write(fileio, size, buffer, &size_written);
if (retval == ERROR_OK)
- command_print(cmd_ctx, "trace data dumped to: %s", filename);
+ command_print(cmd->ctx, "trace data dumped to: %s", filename);
- command_print(cmd_ctx, "could not write dump file: %s", filename);
+ command_print(cmd->ctx, "could not write dump file: %s", filename);
fileio_close(fileio);
return retval;
}
fileio_close(fileio);
return retval;
}
-static int esirisc_trace_dump_buffer(struct command_context *cmd_ctx, const char *filename)
+static int esirisc_trace_dump_buffer(struct command_invocation *cmd, const char *filename)
- struct target *target = get_current_target(cmd_ctx);
+ struct target *target = get_current_target(cmd->ctx);
struct esirisc_common *esirisc = target_to_esirisc(target);
struct esirisc_trace *trace_info = &esirisc->trace_info;
uint8_t *buffer;
struct esirisc_common *esirisc = target_to_esirisc(target);
struct esirisc_trace *trace_info = &esirisc->trace_info;
uint8_t *buffer;
size = esirisc_trace_buffer_size(trace_info);
buffer = calloc(1, size);
if (buffer == NULL) {
size = esirisc_trace_buffer_size(trace_info);
buffer = calloc(1, size);
if (buffer == NULL) {
- command_print(cmd_ctx, "out of memory");
+ command_print(cmd->ctx, "out of memory");
if (retval != ERROR_OK)
goto done;
if (retval != ERROR_OK)
goto done;
- retval = esirisc_trace_dump(cmd_ctx, filename, buffer, size);
+ retval = esirisc_trace_dump(cmd, filename, buffer, size);
-static int esirisc_trace_dump_memory(struct command_context *cmd_ctx, const char *filename,
+static int esirisc_trace_dump_memory(struct command_invocation *cmd, const char *filename,
target_addr_t address, uint32_t size)
{
target_addr_t address, uint32_t size)
{
- struct target *target = get_current_target(cmd_ctx);
+ struct target *target = get_current_target(cmd->ctx);
uint8_t *buffer;
int retval;
buffer = calloc(1, size);
if (buffer == NULL) {
uint8_t *buffer;
int retval;
buffer = calloc(1, size);
if (buffer == NULL) {
- command_print(cmd_ctx, "out of memory");
+ command_print(cmd->ctx, "out of memory");
if (retval != ERROR_OK)
goto done;
if (retval != ERROR_OK)
goto done;
- retval = esirisc_trace_dump(cmd_ctx, filename, buffer, size);
+ retval = esirisc_trace_dump(cmd, filename, buffer, size);
- return esirisc_trace_dump_buffer(CMD_CTX, CMD_ARGV[0]);
+ return esirisc_trace_dump_buffer(CMD, CMD_ARGV[0]);
} else {
COMMAND_PARSE_ADDRESS(CMD_ARGV[0], address);
COMMAND_PARSE_NUMBER(u32, CMD_ARGV[1], size);
} else {
COMMAND_PARSE_ADDRESS(CMD_ARGV[0], address);
COMMAND_PARSE_NUMBER(u32, CMD_ARGV[1], size);
- return esirisc_trace_dump_memory(CMD_CTX, CMD_ARGV[2], address, size);
+ return esirisc_trace_dump_memory(CMD, CMD_ARGV[2], address, size);
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)