diff options
author | Tarek El-Sherbiny <tarek.el-sherbiny@arm.com> | 2020-02-24 13:50:45 +0000 |
---|---|---|
committer | jimqui01 <54316584+jimqui01@users.noreply.github.com> | 2020-03-23 14:22:21 +0000 |
commit | f7b8b7c8a5ad6fc37389ed9ada1f55696174fadb (patch) | |
tree | d7cdce017d6c7eafb4036ff72567d7b19819eea0 | |
parent | 9b251e7775602119305b45bdfb60a57833be8dbe (diff) |
dbg: CLI command history buffer
The cli commands history buffer is cleared every time
the cli is called. For example, when using a checkpoint
to invoke the cli the history buffer will be empty.
This patch maintains the history buffer between cli calls.
Change-Id: I763bf8d6bb9128c93c641943c85043ebf1f4e425
Signed-off-by: Tarek El-Sherbiny <tarek.el-sherbiny@arm.com>
-rw-r--r-- | debugger/src/cli/cli.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/debugger/src/cli/cli.c b/debugger/src/cli/cli.c index fcd530d3..368d6c50 100644 --- a/debugger/src/cli/cli.c +++ b/debugger/src/cli/cli.c @@ -29,6 +29,8 @@ static char cli_input_buffer[CLI_CONFIG_COMMAND_BUF_SIZE] = { 0 }; /* Array holding pointers to arguments after a command is parsed. */ static char *cli_args[CLI_CONFIG_MAX_NUM_ARGUMENTS] = { 0 }; +/* Starting history buffer index. */ +static uint32_t history_index = 0; /* Buffer used to store the command history. */ static char *cli_history[CLI_CONFIG_HISTORY_LENGTH] = { 0 }; static char cli_history_buffer @@ -664,8 +666,6 @@ uint32_t cli_getline( static void cli_main(void const *argument) { int32_t status = FWK_SUCCESS; - /* Starting history buffer index. */ - uint32_t history_index = 0; uint32_t last_history_index = CLI_CONFIG_HISTORY_LENGTH - 1; uint32_t command_length = 0; bool cli_exit = false; |