]> git.gag.com Git - fw/openocd/commit
server/gdb: fix gdb remote monitor cmd on multi-target
authorAntonio Borneo <borneo.antonio@gmail.com>
Wed, 4 May 2022 14:17:08 +0000 (16:17 +0200)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sat, 7 May 2022 11:03:03 +0000 (11:03 +0000)
commitf88a7dde6a0c5e0a74806f6e81528a8525591e9e
tree0257255a04491313231374e943b781d6a6e0d21a
parentb4f8d99c8d9e453b2beb3f6c9db7ff01c8d00756
server/gdb: fix gdb remote monitor cmd on multi-target

Commit 5ebb1bdea1df ("server/gdb: fix return of gdb remote monitor
command") replaces the call to command_run_line() with call to
Jim_EvalObj() but does not properly set the "context".
In multi-target environment, his can cause the erroneously
execution of the command on the wrong target.

Copy from the code in command_run_line() the proper setup before
executing Jim_EvalObj().

Change-Id: I56738c80779082ca146a06c01bc30e28bc835fd3
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reported-by: Bohdan Tymkiv <bohdan200@gmail.com>
Fixes: 5ebb1bdea1df ("server/gdb: fix return of gdb remote monitor command")
Reviewed-on: https://review.openocd.org/c/openocd/+/6966
Tested-by: jenkins
Reviewed-by: Bohdan Tymkiv <bohdan200@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Tim Newsome <tim@sifive.com>
src/server/gdb_server.c