kernel_samsung_a53x/kernel/debug/kdb
Daniel Thompson 8004752fc8 kdb: Fix console handling when editing and tab-completing commands
commit db2f9c7dc29114f531df4a425d0867d01e1f1e28 upstream.

Currently, if the cursor position is not at the end of the command buffer
and the user uses the Tab-complete functions, then the console does not
leave the cursor in the correct position.

For example consider the following buffer with the cursor positioned
at the ^:

md kdb_pro 10
          ^

Pressing tab should result in:

md kdb_prompt_str 10
                 ^

However this does not happen. Instead the cursor is placed at the end
(after then 10) and further cursor movement redraws incorrectly. The
same problem exists when we double-Tab but in a different part of the
code.

Fix this by sending a carriage return and then redisplaying the text to
the left of the cursor.

Cc: stable@vger.kernel.org
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Tested-by: Justin Stitt <justinstitt@google.com>
Link: https://lore.kernel.org/r/20240424-kgdb_read_refactor-v3-3-f236dbe9828d@linaro.org
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-19 12:27:18 +01:00
..
kdb_bp.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kdb_bt.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kdb_cmds Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kdb_debugger.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kdb_io.c kdb: Fix console handling when editing and tab-completing commands 2024-11-19 12:27:18 +01:00
kdb_keyboard.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kdb_main.c kdb: Fix a potential buffer overflow in kdb_local() 2024-11-18 12:12:51 +01:00
kdb_private.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kdb_support.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00