helper/command: change prototype of command_print/command_print_sameline
To prepare for handling TCL return values consistently, all calls to command_print/command_print_sameline should switch to CMD as first parameter. Change prototype of command_print() and command_print_sameline() to pass CMD instead of CMD_CTX. Since the first parameter is currently not used, the change can be done though scripts without manual coding. This patch is created using the command: sed -i PATTERN $(find src/ doc/ -type f) with all the following patters: 's/\(command_print(cmd\)->ctx,/\1,/' 's/\(command_print(CMD\)_CTX,/\1,/' 's/\(command_print(struct command_\)context \*context,/\1invocation *cmd,/' 's/\(command_print_sameline(cmd\)->ctx,/\1,/' 's/\(command_print_sameline(CMD\)_CTX,/\1,/' 's/\(command_print_sameline(struct command_\)context \*context,/\1invocation *cmd,/' This change is inspired by http://openocd.zylin.com/1815 from Paul Fertser but is now done through scripting. Change-Id: I3386d8f96cdc477e7a2308dd18269de3bed04385 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/5081 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
This commit is contained in:
committed by
Tomas Vanek
parent
6916550938
commit
6cb5ba6f11
@@ -344,13 +344,13 @@ COMMAND_HANDLER(handle_etb_config_command)
|
||||
|
||||
arm = target_to_arm(target);
|
||||
if (!is_arm(arm)) {
|
||||
command_print(CMD_CTX, "ETB: '%s' isn't an ARM", CMD_ARGV[0]);
|
||||
command_print(CMD, "ETB: '%s' isn't an ARM", CMD_ARGV[0]);
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
|
||||
tap = jtag_tap_by_string(CMD_ARGV[1]);
|
||||
if (tap == NULL) {
|
||||
command_print(CMD_CTX, "ETB: TAP %s does not exist", CMD_ARGV[1]);
|
||||
command_print(CMD, "ETB: TAP %s does not exist", CMD_ARGV[1]);
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
|
||||
@@ -382,17 +382,17 @@ COMMAND_HANDLER(handle_etb_trigger_percent_command)
|
||||
target = get_current_target(CMD_CTX);
|
||||
arm = target_to_arm(target);
|
||||
if (!is_arm(arm)) {
|
||||
command_print(CMD_CTX, "ETB: current target isn't an ARM");
|
||||
command_print(CMD, "ETB: current target isn't an ARM");
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
|
||||
etm = arm->etm;
|
||||
if (!etm) {
|
||||
command_print(CMD_CTX, "ETB: target has no ETM configured");
|
||||
command_print(CMD, "ETB: target has no ETM configured");
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
if (etm->capture_driver != &etb_capture_driver) {
|
||||
command_print(CMD_CTX, "ETB: target not using ETB");
|
||||
command_print(CMD, "ETB: target not using ETB");
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
etb = arm->etm->capture_driver_priv;
|
||||
@@ -402,13 +402,13 @@ COMMAND_HANDLER(handle_etb_trigger_percent_command)
|
||||
|
||||
COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], new_value);
|
||||
if ((new_value < 2) || (new_value > 100))
|
||||
command_print(CMD_CTX,
|
||||
command_print(CMD,
|
||||
"valid percentages are 2%% to 100%%");
|
||||
else
|
||||
etb->trigger_percent = (unsigned) new_value;
|
||||
}
|
||||
|
||||
command_print(CMD_CTX, "%d percent of tracebuffer fills after trigger",
|
||||
command_print(CMD, "%d percent of tracebuffer fills after trigger",
|
||||
etb->trigger_percent);
|
||||
|
||||
return ERROR_OK;
|
||||
|
||||
Reference in New Issue
Block a user