jtag: print an errmsg on using jtag API for non jtag transport
authorAntonio Borneo <borneo.antonio@gmail.com>
Tue, 28 Aug 2018 12:49:10 +0000 (14:49 +0200)
committerTomas Vanek <vanekt@fbl.cz>
Tue, 14 Jan 2020 11:38:23 +0000 (11:38 +0000)
commitf275ae586bba359611dd34af2b3718526101279e
treea3f0ef34a2025805f7353671c4d08eb2b7461c4a
parent0f24549ce95e682f1e04b3358b13ea8b7f80c074
jtag: print an errmsg on using jtag API for non jtag transport

After the cleanup of swd and hla, there should be no more calls
to jtag_execute_queue() or to queue jtag commands if current
transport is not jtag. Thus we can start removing the jtag
specific code from adapters that do not support jtag.

To prevent some remaining call to jtag_execute_queue() to crash
openocd, verify the transport, print an error message if the
transport is not jtag, call the adapter's jtag_execute_queue()
only if it exist.
To identify code that still add commands in the jtag queue even
if transport is not jtag, print an error message in the function
jtag_queue_command(). For the moment, still queue the message,
even if will cause a memory leak if there is no following call
to jtag_execute_queue(); the target is to identify the issue and
cleanup the code, thus solving also the leak.

Change-Id: I8fc85f754aa057aad1df05ff0448c8619897da23
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/4897
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
src/jtag/commands.c
src/jtag/core.c