aboutsummaryrefslogtreecommitdiff
path: root/src/server/server.c
AgeCommit message (Collapse)Author
2011-10-23SERVER: fix clang warningAntonio Borneo
The fix is inline with the Linux coding style that forbids assignment in if condition Change-Id: I0b9d0b419d9c8b7a8c755e048d5faf72d1658ba2 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/87 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-10-22server: remove warning due to dead assignmentØyvind Harboe
Change-Id: Idb08aef0c11b3fae92286e8fcea61ab09ab09e74 Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/44 Reviewed-by: Peter Stuge <peter@stuge.se> Tested-by: jenkins
2011-10-17target: DCC / target message backoff algorithmØyvind Harboe
by immediately polling again when we have received a message from the target instead of waiting 100ms, we can hope for much better performance. More than 100x? :-) Change-Id: Ieaf0c6c8b6e5addc482895670ffbf9a743e07a29 Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/27 Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com> Tested-by: Øyvind Harboe <oyvindharboe@gmail.com>
2010-12-29warnings: use more 'const' for char *Øyvind Harboe
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-12-21server: remove error value from LOG_INFOØyvind Harboe
the error values is not part of the interface to the user, so they should never be printed in LOG_INFO or LOG_USER. Printing them in LOG_DEBUG() rarely makes much sense but is OK. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-10-05build: remove warn_unused_result errorsSpencer Oliver
Remove any build errors for strtol when building release version of openocd. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2010-10-04server: fix server pipe windows supportSpencer Oliver
commit 50d5441e2a615fb2c44b41a777e4373901f7a2e6 caused native windows build to fail. Firstly this patch fixes the build issue, but it also disables support for named pipes under Windows. Windows does not support posix named pipes. A cross-platfom access layer will need creating before support can be enabled again. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
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-10-01server: rely on ctrl-c to stop openocdØyvind Harboe
there was special support to support pressing 'x' to quit openocd. ctrl-c is sufficient. The main server loop is already complicated enough. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-06-14-Wshadow fixesØyvind Harboe
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-05-06server: incorrectly display socket port numberSpencer Oliver
c->sin.sin_port does not contain a valid port number so just use service->port as this is always correct. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
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-03-24server: review unused symbolsAntonio Borneo
Remove unused function Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2010-03-24server: review scope of functions and dataAntonio Borneo
Add "static" qualifier to private functions and data. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2010-01-11shutdown: more graceful shutdownØyvind Harboe
Shutdown is not an error condition, do not return error from main. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2009-12-16server: server loop will exhaust data inputs before sleepingØyvind Harboe
By exhausting data on input, the performance will be more consistent + the code more clearly distinguishes between polling and processing. A test showed gdb packet load performance go from ~1550kByte/s to 1650kBytes/s + being more stable. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2009-12-11server: add server_preinit which is called before config file is parsed.Spencer Oliver
This fixes the issue under native win32 of the socket interface not being enabled (via WSAStartup) before init is called from a script. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2009-12-03change #include "target.h" to <target/target.h>Zachary T Welch
Changes from the flat namespace to heirarchical one. Instead of writing: #include "target.h" the following form should be used. #include <target/target.h> The exception is from .c files in the same directory.
2009-11-30remove interp global variable!Zachary T Welch
Finish removing references to the 'interp' global variable from the command module, encapsulating all reference via command_context. Eliminates use of the global entirely, so it can be removed. Hurrah!
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-30move server_init() to openocd_main()Zachary T Welch
Moves the telnet and TCL server startup to server_init(), moving their respective command registration in to server_register_commands(). Adds proper error checking for these particular startup processes. Moves the core server startup to openocd_main(), improving related error checking and preparing to defer 'init'.
2009-11-26fix typos in source filesUwe Hermann
Correct some spelling errors in source comments and printed output. Signed-off-by: Zachary T Welch <zw@superlucidity.net>
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-17command_handler: change 'cmd_ctx' to CMD_CTXZachary T Welch
Convert all command handler 'cmd_ctx' parameter usage with CMD_CTX.
2009-11-17command_handler: change 'args' to CMD_ARGVZachary T Welch
This patch converts all instances of 'args' in COMMAND_HANDLER routines to use CMD_ARGV macro.
2009-11-17command_handler: change to 'argc' to CMD_ARGCZachary T Welch
This patch converts all instances of 'argc' in COMMAND_HANDLER routines to use CMD_ARGC.
2009-11-14add openocd.h for top-level declarationsZachary T Welch
Create src/openocd.h to hold declarations previously made internally by src/main.c and src/server/server.c. This ensures all functions are verified to be in-sync at compile time (rather than at link), making it easier to track down bugs.
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-13service_t -> struct serviceZachary T Welch
Remove misleading typedef and redundant suffix from struct service.
2009-11-13use COMMAND_HELPER for command helper functionsZachary T Welch
Define the numerous helpers that inherit command handler parameters using the COMMAND_HELPER macro.
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-05Add server port command helper function.Zachary T Welch
2009-07-17Andreas Fritiofson <andreas.fritiofson@gmail.com> UTF8 fixesoharboe
git-svn-id: svn://svn.berlios.de/openocd/trunk@2549 b42882b7-edfa-0310-969c-e2dbd0fdcd60
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-23Remove whitespace that occurs before ')'.zwelch
- Replace '[ \t]*[)]' with ')'. git-svn-id: svn://svn.berlios.de/openocd/trunk@2377 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23Remove whitespace that occurs after '('.zwelch
- Replace '([ \t]*' with '('. git-svn-id: svn://svn.berlios.de/openocd/trunk@2376 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23- Fixes '=' whitespacezwelch
- Replace ')\(=\)\(\w\)' with ') \1 \2'. - Replace '\(\w\)\(=\)(' with '\1 \2 ('. - Replace '\(\w\)\(=\)\(\w\)' with '\1 \2 \3'. git-svn-id: svn://svn.berlios.de/openocd/trunk@2372 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23- Replace 'while(' with 'while ('.zwelch
git-svn-id: svn://svn.berlios.de/openocd/trunk@2358 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-05-11Remove redundant sys/types.h #include directives (now in types.h).zwelch
git-svn-id: svn://svn.berlios.de/openocd/trunk@1700 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-22Michael Bruck <mbruck@digenius.de> signed/unsigned incompatibility warningoharboe
git-svn-id: svn://svn.berlios.de/openocd/trunk@1511 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-01-01- add gdb pipe support to native win32 (--pipe option)ntfreak
git-svn-id: svn://svn.berlios.de/openocd/trunk@1294 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-12-13- remove target specific variant and use target->variant memberntfreak
- fix build warning in cortex_m3 - code cleanup - remove trailing lf and convert c++ comments git-svn-id: svn://svn.berlios.de/openocd/trunk@1238 b42882b7-edfa-0310-969c-e2dbd0fdcd60