diff options
author | Paul Fertser <fercerpav@gmail.com> | 2024-04-25 14:33:07 +0300 |
---|---|---|
committer | Antonio Borneo <borneo.antonio@gmail.com> | 2024-06-08 08:51:20 +0000 |
commit | ed9203f4aaf3b4a28d5e28da2cdb1a52d9f7c408 (patch) | |
tree | 055205217b126b440a7592798a27543e63be243c /src/server/gdb_server.c | |
parent | 1fba55a9b62118ac102c161bb8efcd2ceed379a1 (diff) | |
download | riscv-openocd-ed9203f4aaf3b4a28d5e28da2cdb1a52d9f7c408.zip riscv-openocd-ed9203f4aaf3b4a28d5e28da2cdb1a52d9f7c408.tar.gz riscv-openocd-ed9203f4aaf3b4a28d5e28da2cdb1a52d9f7c408.tar.bz2 |
gdb_server: do not start multiple instances on "pipe"
For configurations which include multiple targets and the "pipe" mode is
requested only the first gdb_server instance should be enabled,
otherwise GDB gets confusing replies, goes out of sync and the session
fails in weird ways.
Compile-tested only.
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Change-Id: If8f13aa7b58e9b0dc6d5ae88cf75538b34cc1218
Reviewed-on: https://review.openocd.org/c/openocd/+/8222
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Diffstat (limited to 'src/server/gdb_server.c')
-rw-r--r-- | src/server/gdb_server.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index 7c2f41e..0ded8e4 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -3879,7 +3879,7 @@ static int gdb_target_add_one(struct target *target) return gdb_target_start(target, target->gdb_port_override); } - if (strcmp(gdb_port, "disabled") == 0) { + if (strcmp(gdb_port_next, "disabled") == 0) { LOG_INFO("gdb port disabled"); return ERROR_OK; } @@ -3908,6 +3908,8 @@ static int gdb_target_add_one(struct target *target) gdb_port_next = strdup("0"); } } + } else if (strcmp(gdb_port_next, "pipe") == 0) { + gdb_port_next = "disabled"; } } return retval; |