aboutsummaryrefslogtreecommitdiff
path: root/src/server/tcl_server.c
AgeCommit message (Collapse)Author
2015-09-30tcl_server: Support line buffers up to 4M (v3)Philipp Wagner
Currently, the maximum size of a command sent to the TCL server is 4k. This patch increases this limit up to 4M. Reasoning: To get high-speed JTAG data transfers, I'm using a very long shift register. This reduces the overhead of the state changes, as well as the latency due to the common USB adapter transfers considerably. In order to submit those long DRSCAN commands to OpenOCD over the TCL/TCL interface, long TCL command lines are required. This is enabled by this patch. v3: Address review comments. Drop line instead of connection when realloc() fails. Changes in v2 of this patch: The line buffer is allocated dynamically to avoid an OpenOCD memory overhead if the large buffers are not used. The buffer starts at 4K and increases exponentially up to 1M, and then linearly in 1M increments up to 4M. Change-Id: Iecaef6a56ed5e18e9de4d912a514031ea78fa3bd Signed-off-by: Philipp Wagner <philipp.wagner@tum.de> Reviewed-on: http://openocd.zylin.com/2837 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2015-09-28server: remove connection limit from tcl and telnet serversAustin Morton
Add constant CONNECTION_LIMIT_UNLIMITED which indicates a service has no connection limit Change-Id: I008d31264010c25fa44ca74eb6d5740eca38bee1 Signed-off-by: Austin Morton <austinpmorton@gmail.com> Reviewed-on: http://openocd.zylin.com/2937 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2015-09-05server: tcl_trace commandAustin Morton
Implements async target trace output to the tcl server Change-Id: I0178f6404447337d523782a1d2c317457030da40 Signed-off-by: Austin Morton <austinpmorton@gmail.com> Reviewed-on: http://openocd.zylin.com/2588 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2015-05-17server: avoid the tcl server crashing when there is no targetAustin Morton
Since commit 1d0cf0df37a4e831ca3121ba8987d5848cad3e42 ("server: tcl_notifications command") connecting to the tcl server would terminate openocd. Fix this. Change-Id: I36e2a7482f7db3a30ff7e9f969c3b6cda9599382 Signed-off-by: Austin Morton <austinpmorton@gmail.com> Reviewed-on: http://openocd.zylin.com/2759 Tested-by: jenkins Reviewed-by: Forest Crossman <cyrozap@gmail.com> Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2015-03-09server: tcl_notifications commandAustin Morton
Implements async target notifications to the tcl server Change-Id: I4d83e9fa209e95426c440030597f99e9f0c3b260 Signed-off-by: Austin Morton <austinpmorton@gmail.com> Reviewed-on: http://openocd.zylin.com/2336 Reviewed-by: Paul Fertser <fercerpav@gmail.com> Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-01-08Allow "tcl_port" to be run after config to simply display the port.Robert P. J. Day
To be consistent with gdb_port and telnet_port, allow tcl_port to be run to display the configured port number, while still not allowing the user to change it after configuration. Change-Id: Ibe6aedb3bd447f2985e42dd8246358481a047dd6 Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Reviewed-on: http://openocd.zylin.com/1857 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-10-31Clean up const usage to avoid excessive castingAndreas Fritiofson
Don't use const on pointers that hold heap allocated data, because that means functions that free them must cast away the const. Do use const on pointer parameters or fields that needn't be modified. Remove pointer casts that are no longer needed after fixing the constness. Change-Id: I5d206f5019982fd1950bc6d6d07b6062dc24e886 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/1668 Tested-by: jenkins Reviewed-by: Mathias Küster <kesmtp@freenet.de> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-06-05update files to correct FSF addressSpencer Oliver
Change-Id: I429f7fd51f77b0e7c86d7a7f110ca31afd76c173 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1426 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2012-05-25Jim_GetResult was called twiceVandra Akos
Removed the superflous call to Jim_GetResult, as we are reading in the result to a variable anyways in the next instruction. Change-Id: Idc96400737dc15e28304e97bcea79fa6c7a88ae1 Signed-off-by: Vandra Akos <axos88@gmail.com> Reviewed-on: http://openocd.zylin.com/661 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-02-06build: cleanup src/server directorySpencer Oliver
Change-Id: I6410df28c5999f5cbee2d3bcaa02469a29ea4c15 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/412 Tested-by: jenkins
2010-10-01pipes: add documentation for pipesØyvind Harboe
Stick with the name "gdb_port" even if this command can be used for other things(disable, named pipes, anonymous stdin/out pipe). "port" is correct for probably more than 90% of use cases, if not more. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-10-01server: add support for pipesØyvind Harboe
-p/--pipe is now deprecated. Use '-c "gdb_port pipe;log_output openocd.log"' instead. Warning logged. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-10-01server: specify port as a stringØyvind Harboe
This will allow switching to using named pipes. Split this out as a seperate commit to make changes easier to follow. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-10-01server: read/write now goes through connection fn'sØyvind Harboe
depending on whether the connection is over a socket or pipe, the read is done differently. pipes can return -1 when writing 0 bytes, make 0 byte writes a successful no-op. 0 byte writes falls out naturally of tcl server code. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-10-01server: split file descriptors in in/out fd'sØyvind Harboe
pipes have different fd's for in/out. This makes the code more orthogonal and prepares for adding pipes. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-09-20tcl_server: switch to ctrl-zØyvind Harboe
by using ctrl-z instead of line end, multi-line tcl scripts can be handled. Testing: send ctrl-z a couple of times to make telnet enter the mode where it sends ctrl-z unencoded. Programs that talk to the tcl_server can send ctrl-z to indicate end of tcl-let to be executed without having to worry about telnet protocols. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-05-05Fixed bug in tcl-serverMatthias Bode
No segmentationfault when sending commands to tcl-server. modified: src/server/server.c modified: src/server/tcl_server.c modified: src/server/tcl_server.h
2010-01-09src/server: usage/help/doc updatesDavid Brownell
Make "usage" messages use the same EBNF as the User's Guide; no angle brackets. Improve and correct various helptexts. Specifically for the port commands, clarify that the number is optional, and omitting it causes the current number to be displayed. Don't use "&function"; a function's name is its address. Remove a couple instances of pointless whitespace; shrink a few overlong lines. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-12-26cygwin 1.7 build fixesDavid Brownell
It's less accepting of signed char ... insisting that e.g. tolower() not receive one as a parameter. It's probably good to phase out such usage, given the number of bugs that lurk in the vicinity (assumptions that char is unsigned), so fix these even though such usage is actually legal. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-30do not extern 'interp' from command.cZachary T Welch
Adds 'interp' field to command_context, chasing the few remaining references to the global variable outside of the command module.
2009-11-24server: use register_commandsZachary T Welch
Converts server directory to use new command registration paradigm.
2009-11-24use COMMAND_REGISTER macroZachary T Welch
Replaces direct calls to register_command() with a macro, to allow its parameters to be changed and callers updated in phases.
2009-11-13command_context_t -> struct command_contextZachary T Welch
Remove misleading typedef and redundant suffix from struct command_context.
2009-11-13connection_t -> struct connectionZachary T Welch
Remove misleading typedef and redundant suffix from struct connection.
2009-11-13tcl_connection_t -> struct tcl_connectionZachary T Welch
Remove misleading typedef and redundant suffix from struct tcl_connection.
2009-11-13use CALL_COMMAND_HANDLER instead of direct callsZachary T Welch
By using CALL_COMMAND_HANDLER, parameters can be reordered, added, or even removed in inherited signatures, without requiring revisiting all of the various call sites.
2009-11-13use COMMAND_HANDLER macro to define all commandsZachary T Welch
2009-11-09server: remove useless declarationsZachary T Welch
Remove server command declarations, make handler routines static.
2009-11-05Update all server port command to use new helper.Zachary T Welch
2009-06-23Remove whitespace at end of lines, step 2.zwelch
- Replace '\s*$' with ''. git-svn-id: svn://svn.berlios.de/openocd/trunk@2380 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-13David Brownell <david-b@pacbell.net>:zwelch
OpenOCD doesn't actually *need* to be keeping all TCP ports active ... creating security issues in some network configs. Instead, let config file specify e.g. "tcl_port 0" (or gdb_port, telnet_port) to disable that particular remote access method. git-svn-id: svn://svn.berlios.de/openocd/trunk@2240 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-24David Brownell <david-b@pacbell.net>:zwelch
Make startup for the various server ports be quiet, unless debugging is active: don't emit needless scarey messages. Update the relevant documentation and its references: - For these port commands ... cover the default values; convert to @deffn syntax; include their use outside of the configuration stage; and alphabetize. Similar updates to the rest of that small chapter: - Highlight that there even *IS* a configuration stage, after which some command functionality is no longer available. - For GDB commands ... convert to @deffn syntax; alphabetize; include a missing command (!); add missing helptext (!) for one non-missing command; update relevant cross-references and index entries. git-svn-id: svn://svn.berlios.de/openocd/trunk@1909 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-11Audit and eliminate redundant #include directives from src/server.zwelch
git-svn-id: svn://svn.berlios.de/openocd/trunk@1709 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-29Remove redundant declarations to allow building with -Wredundant-decls.zwelch
git-svn-id: svn://svn.berlios.de/openocd/trunk@1560 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-12-15- add ability for openocd to communicate to gdb using pipes (stdin/stdout).ntfreak
- this is enabled by new command line option option --pipe. git-svn-id: svn://svn.berlios.de/openocd/trunk@1242 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-10-22Laurentiu Cocanu - more help textoharboe
git-svn-id: svn://svn.berlios.de/openocd/trunk@1087 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-09-01Duane Ellis: "target as an [tcl] object" feature.oharboe
git-svn-id: svn://svn.berlios.de/openocd/trunk@975 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-18- fix incorrectly registered function openocd_array2memntfreak
- removed unused variables - reformatted lpc288x.[ch] - fixed helper/Makefile.am dependencies - add correct svn props to added files git-svn-id: svn://svn.berlios.de/openocd/trunk@829 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-17Charles Hardin <ckhardin@gmail.com> move jim into helperoharboe
git-svn-id: svn://svn.berlios.de/openocd/trunk@822 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-06- fixed build issues with win32ntfreak
- fixed build warnings for last commit - set svn props for last commit git-svn-id: svn://svn.berlios.de/openocd/trunk@760 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-06moving Tcl stuff around slightly.oharboe
git-svn-id: svn://svn.berlios.de/openocd/trunk@759 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-06fix a few compilation problems.oharboe
git-svn-id: svn://svn.berlios.de/openocd/trunk@758 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-06Charles Hardin <ckhardin@gmail.com> - Tcl Serveroharboe
git-svn-id: svn://svn.berlios.de/openocd/trunk@757 b42882b7-edfa-0310-969c-e2dbd0fdcd60