aboutsummaryrefslogtreecommitdiff
path: root/src/server
AgeCommit message (Collapse)Author
2012-01-04retire ERROR_INVALID_ARGUMENTS and replace with ERROR_COMMAND_SYNTAX_ERRORØyvind Harboe
Change-Id: I6dee51e1fab1944085391f274a343cdb9014c7a4 Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/300 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-12-02gdb_server: use strndup to allocate debug messagesSpencer Oliver
Lets be consistent and use strndup to allocate the debug buffer. Change-Id: I535ad270ebfeae6e09d28372ab3749c822971223 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/245 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2011-12-01Fix compile error when _DEBUG_GDB_IO_ is setJames Zhao
Compile error is encountered when _DEBUG_GDB_IO_ is set, due to duplicate variables. Fixed by renaming the variable. Change-Id: I729c06e317fdb899142c9ceaf543b7f580088807 Signed-off-by: James Zhao <jamzhao@gmail.com> Reviewed-on: http://openocd.zylin.com/243 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-11-17gdb: Potential rounding error in reg_packet_size gdb_get_registers_packetPhilip Nye
The calculation for reg_packet_size in gdb_get_registers_packet() could generate a wrong result in the case of multiple registers whose size is not a multiple of 8. The current calculation sums the sizes for all registers then rounds the result up to the next multiple of 8. Instead it should round each register size up individually and sum the results for all registers. Change-Id: Idfb5e5eeee0e69a6889dbe9769c0bf17feacb63b Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/200 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2011-11-17gdb: fix multi core gdb issuePhilip Nye
gdb_memory_map() correctly calculates the target specific number of flash banks, but then uses the total number (all targets) instead of the target specific number to construct its GDB response, causing a crash. Change-Id: I3f8639b3e90303a59753ebe140ce4fff96fd5db0 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/199 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2011-11-03gdb_server: assert to avoid malloc(0)Øyvind Harboe
Change-Id: I6ae3e007f4aa768f8bc64de78351750138f12e53 Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/135 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
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>
2011-08-24remove target argument from gdb packet handling functionsJie Zhang
2011-06-04Fix "unused variable" warnings (errors) detected with GCC 4.7.0 - trivial fixesFreddie Chopin
2011-05-18Get register value if it's invalid in cache.Jie Zhang
2011-04-28gdb_server : 'R' command replied by OKMichel Jaouen
2011-04-28smp : infra for smp minimum supportMichel Jaouen
2011-04-15RTOS Thread awareness support wipBroadcom Corporation (Evan Hunter)
- works on Cortex-M3 with ThreadX and FreeRTOS Compared to original patch a few nits were fixed: - remove stricmp usage - unsigned compare fix - printf formatting fixes - fixed a bug with overrunning a memory buffer allocated with malloc.
2011-03-17Fix a bunch of typos.Uwe Hermann
Fix a bunch of typos. Most are in code comments, so nothing should break. UNKOWN_COMMAND and CMD_UNKOWN are not used elsewhere, so correcting the spelling should also not break anything.
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-11-18build: add common.mkSpencer Oliver
Rather than specifying common makefile variables move them all to a common.mk. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2010-11-15httpd: retire this serverØyvind Harboe
this never panned out and there are enough mistakes in the code that probably nobody used this. Use the tcl server and implement a standalone http app instead works fine. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-11-15gdb: fix occasional crash when flash probe failedØyvind Harboe
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-11-11gdb: improve error message when gdb connect failsØyvind Harboe
gdb connect can fail when the flash has not been probed. During gdb connect, the flash layout is reported, but this can not be automatically detected for a target that is powered up and OpenOCD supports connecting to gdb server even if the target is powered down. The solution is to turn of the gdb_memory_map feature. 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-04gdbserver: fix gdb_port memory leakSpencer Oliver
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-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-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-09-26gdb: fix blank line at topØyvind Harboe
snuck in at some point... 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-07-05gdbserver: incorrect memory map for multiple targets (bug #24)sb-sf
The gdb server incorrectly reports the memory map if we have multiple targets with multiple flash banks. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2010-06-17gdb-server: fix -Wshadow warningOyvind Harboe
This warning was only reproducable with Cygwin. Cygwin now builds without warnings for the basic case. Signed-off-by: Oyvind Harboe <oyvind.harboe@zylin.com>
2010-06-16gdb: -Wshadow warning fixesØyvind Harboe
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-06-16gdb: clean up error handling in step/continueØyvind Harboe
if step/continue fails, then the error should be reported to the calling fn. The calling fn decides if the connection has to be aborted or if packet processing can continue. 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-06-08gdb-server: fix error reporting bugsØyvind Harboe
GDB and OpenOCD has two different error number spaces and no mapping exists between them. If a specific error number is to be reported to GDB then this has to be done at the calling site, rather than as a generic routine that tries to map "retval" to GDB error number speak. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-05-17gdbserver: gdb cmds returning failure on successSpencer Oliver
The gdb_memory_map cmd for example fell through and returned ERROR_COMMAND_SYNTAX_ERROR on success - behaviour is now as expected. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2010-05-14missing pointer's declaration when enable macro -D_DEBUG_GDB_IO_.Jun Ma
reproducable when "./configure --enable-maintainer-mode CFLAGS=-D_DEBUG_GDB_IO_" Signed-off-by: Jun Ma <sync.jma@gmail.com> 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-05gdb: connect will now fail if flash autoprobe failsØyvind Harboe
This stops GDB from launching with an empty memory map, making gdb load w/flashing fail for no obvious reason. The error message points in the direction of the gdb-attach event that can be set up to issue a halt or "reset init" which will put GDB in a well defined stated upon attach and thus have a robust flash autoprobe. 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-03-25telnet_server: review unused symbolsAntonio Borneo
Remove unused function Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2010-03-25telnet_server: review scope of functionsAntonio Borneo
Add "static" qualifier to private functions. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
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-03-17gdb_server: improved gdb load performanceØyvind Harboe
by ack'ing memory writes immediately and reporting either at next memory write or stepi/continue time. GDB will then send off a new packet that is ready by the time the previous packet has been written to target memory. On faster adapters this can be as much as 10% improvement. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-01-31telnet: fix strage blank spaces at beginning of telnet linesØyvind Harboe
Sometimes we saw two strange blank spaces at the beginning of the telnet lines. progress ogress > This patch fixes this problem: progress progress > The code changes are *reasonably* clean, but perhaps it could be made a bit more elegant, but I didn't want to change things after I finished diagnosis/testing & submitting the patch. The problem was that logging can send the text and the newline separately in two different requests and the telnet code would incorrectly remove the prompt from the end of a line. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>