openocd/src/server
Antonio Borneo fad1eaaa42 server/telnet: fix autocomplete for jimtcl commands
Current autocomplete filters-out some command reported by "info
commands". One of the filter rule concerns the command's private
data.
Every command registered by OpenOCD has its 'struct command' as
private data.

By ignoring commands without private data, we loose several TCL
commands registered by jimtcl, e.g. 'foreach', 'llength'.

By assuming that every command with non-NULL private data has
'struct command' as private data, we risk at best to access
inconsistent data, at worst to trigger a segmentation fault.

Export the already available functions:
- to check if a command has been registered by OpenOCD and
- to get the private data.
While there, rename jimcmd_is_ocd_command() as
jimcmd_is_oocd_command().
Don't filter-out jimtcl commands with no private data.
Check the private data only on OpenOCD commands.

Change-Id: Ib5bf8d2bc5c12440c0cfae438f637c38724a79b7
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/6282
Tested-by: jenkins
Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
2021-06-04 17:41:09 +01:00
..
gdb_server.c server: gdb_server: Add colon for target extended-remote 2021-05-15 20:57:12 +01:00
gdb_server.h server: free strduped port numbers 2018-03-15 17:08:53 +00:00
ipdbg.c Add IPDBG JtagHost functionality to OpenOCD 2021-05-08 09:51:04 +01:00
ipdbg.h Add IPDBG JtagHost functionality to OpenOCD 2021-05-08 09:51:04 +01:00
Makefile.am Add IPDBG JtagHost functionality to OpenOCD 2021-05-08 09:51:04 +01:00
rtt_server.c server: revert commit 7e6556b3ca 2021-03-10 21:34:13 +00:00
rtt_server.h Add initial RTT support 2020-12-02 23:15:52 +00:00
server_stubs.c Remove FSF address from GPL notices 2016-05-24 22:30:01 +01:00
server.c Cleanup of config/includes. 2021-05-01 14:35:09 +01:00
server.h Cleanup of config/includes. 2021-05-01 14:35:09 +01:00
startup.tcl telnet/auto-complete: hide deprecated and internal commands 2021-05-08 09:48:15 +01:00
tcl_server.c server: revert commit 7e6556b3ca 2021-03-10 21:34:13 +00:00
tcl_server.h server: free strduped port numbers 2018-03-15 17:08:53 +00:00
telnet_server.c server/telnet: fix autocomplete for jimtcl commands 2021-06-04 17:41:09 +01:00
telnet_server.h server: free strduped port numbers 2018-03-15 17:08:53 +00:00