rtos: Don't crash on qSymbol GDB packet when no RTOS is configured

Commit 43902905bb 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
__archive__
Matthias Blaicher 2012-10-09 10:25:00 +02:00 committed by Peter Stuge
parent a136b08fc3
commit 9ff4071568
1 changed files with 3 additions and 0 deletions

View File

@ -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))