riscv-openocd/src/server
Christopher Head ea41048830 Permit null target on TCL connection
In previous versions of OpenOCD, it was possible to connect to the TCL
RPC interface without a current target. In `tcl_new_connection`, the
curent target would be queried by number, and the possibility of a null
current target was handled properly.

In commit bb9d9c6026, the
`get_target_by_num` call was replaced by a `get_current_target` call,
without noticing that `get_current_target` aborts if there is no current
target, whereas `tcl_new_connection` is perfectly able to handle that
situation.

Provide a `get_current_target_or_null` function for use by consumers who
are OK with a null current target, and use it in `tcl_new_connection`.

Change-Id: I06f7e1e149f1169e23c73ba328c7ad9f9425cc2a
Signed-off-by: Christopher Head <chead@zaber.com>
Reviewed-on: http://openocd.zylin.com/4730
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Franck Jullien <franck.jullien@gmail.com>
2018-11-13 07:02:58 +00:00
..
Makefile.am helper,rtos,server: Restore missing warning flags 2017-01-15 10:16:16 +00:00
gdb_server.c gdb_server: add support for architecture element 2018-10-16 11:58:10 +01:00
gdb_server.h server: free strduped port numbers 2018-03-15 17:08:53 +00:00
server.c server/server: Add ability to remove services 2018-08-01 14:34:13 +01:00
server.h server/server: Add ability to remove services 2018-08-01 14:34:13 +01:00
server_stubs.c Remove FSF address from GPL notices 2016-05-24 22:30:01 +01:00
startup.tcl Fix a bunch of typos. 2011-03-17 07:25:25 +01:00
tcl_server.c Permit null target on TCL connection 2018-11-13 07:02:58 +00:00
tcl_server.h server: free strduped port numbers 2018-03-15 17:08:53 +00:00
telnet_server.c server: free strduped port numbers 2018-03-15 17:08:53 +00:00
telnet_server.h server: free strduped port numbers 2018-03-15 17:08:53 +00:00