diff options
author | Matthias Blaicher <matthias@blaicher.com> | 2012-10-09 10:25:00 +0200 |
---|---|---|
committer | Peter Stuge <peter@stuge.se> | 2012-10-09 10:23:51 +0000 |
commit | 9ff407156894a5f0b9db1f5438901b5a2e0b80b9 (patch) | |
tree | fa6dc9df3ae32acea4d86598004011a8f464f3f2 /src/rtos/rtos.c | |
parent | a136b08fc3ad4a9cc17ff0e5a23315f302ee5f48 (diff) | |
download | riscv-openocd-9ff407156894a5f0b9db1f5438901b5a2e0b80b9.zip riscv-openocd-9ff407156894a5f0b9db1f5438901b5a2e0b80b9.tar.gz riscv-openocd-9ff407156894a5f0b9db1f5438901b5a2e0b80b9.tar.bz2 |
rtos: Don't crash on qSymbol GDB packet when no RTOS is configured
Commit 43902905bbc8fdc9d764f3843d697161d9b5fd92 fixed a bug but also
introduced a regression. The RTOS GDB packet handler is always called,
not only when an RTOS is actually configured, so it is important to
check if an RTOS has been configured or not before actually processing
the qSymbol packet.
Change-Id: I1aed54f6c2817e1ebf99ddcda051df4554ea5a3a
Signed-off-by: Peter Stuge <peter@stuge.se>
Reviewed-on: http://openocd.zylin.com/907
Tested-by: jenkins
Diffstat (limited to 'src/rtos/rtos.c')
-rw-r--r-- | src/rtos/rtos.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/rtos/rtos.c b/src/rtos/rtos.c index 9002f1a..ed559c3 100644 --- a/src/rtos/rtos.c +++ b/src/rtos/rtos.c @@ -194,6 +194,9 @@ int rtos_qsymbol(struct connection *connection, char *packet, int packet_size) reply_len = sprintf(reply, "OK"); + if (!os) + goto done; + if (sscanf(packet, "qSymbol:%" SCNx64 ":", &addr)) hex_to_str(cur_sym, strchr(packet + 8, ':') + 1); else if (target->rtos_auto_detect && !rtos_try_next(target)) |