summaryrefslogtreecommitdiff
path: root/src/server/gdb_server.c
Commit message (Collapse)AuthorAgeFilesLines
* gdb: fix regression in gdb_port commandØyvind Harboe2010-01-051-2/+3
| | | | | | | | | | | | | | | | | | | The gdb_port command can be invoked during normal execution to report the port used for gdb, whereas it was listed as CONFIG stage only, which caused an error when excuting it to return the reported error. Also in line with the grander goal of making more commands available during all "modes" (perhaps retiring config mode), there is no particular reason to limit gdb_port to the config stage. Regression was introduced in: b3bf1d12b2fdfba1c1cbee3e1afbfbb27cbd1a26 aka v0.4.0-rc1-32-gb3bf1d1 Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* streamline and document helptext mode displaysDavid Brownell2010-01-021-1/+2
| | | | | | | | | | | | | | | | | | | Most commands are usable only at runtime; so don't bother saying that, it's noise. Moreover, tokens like EXEC are cryptic. Be more clear: highlight only the commands which may (also) be used during the config stage, thus matching the docs more closely. There are - Configuration commands (per documentation) - And also some commands that valid at *any* time. Update the docs to note that "help" now shows this mode info. This also highlighted a few mistakes in command configuration, mostly commands listed as "valid at any time" which shouldn't have been. This just fixes ones I noted when sanity testing. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* cygwin 1.7 build fixesDavid Brownell2009-12-261-1/+1
| | | | | | | | | | | 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>
* gdb_server: use more local variables in inner loop of fetching packetstiny ↵Øyvind Harboe2009-12-111-31/+73
| | | | | | | | | | | | | | | | | | refactoring to allow optimisation of inner loops Some profiling information for arm7 16MHz GDB load operation shows gdb_get_packet_inner() near the very top. Each sample counts as 0.01 seconds. % cumulative self self total time seconds seconds calls Ts/call Ts/call name 52.91 2.27 2.27 embeddedice_write_dcc 11.89 2.78 0.51 gdb_get_packet_inner 8.86 3.16 0.38 memcpy 3.26 3.30 0.14 idle_thread_main(unsigned int) 3.03 3.43 0.13 cyg_in_cksum Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* gdb_server: make struct gdb_connection privateØyvind Harboe2009-12-111-1/+20
| | | | | | it is only used inside gdb_server.c Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* remove flash.h from treeZachary T Welch2009-12-041-1/+1
| | | | | Remove the now vestigial <flash/flash.h> header from the tree, replacing a few references with <flash/nor/core.h>
* fix regressions with GDB port numbersZachary T Welch2009-12-031-3/+11
| | | | | | Use a separate variable for iterating GDB service port numbers than the one set by the user. Restores the behavior of returning the original port number and only incrementing the port used on success.
* change #include "flash.h" to <flash/flash.h>Zachary T Welch2009-12-031-1/+1
| | | | | | | | | | | | Changes from the flat namespace to heirarchical one. Instead of writing: #include "flash.h" the following form should be used. #include <flash/flash.h> The exception is from .c files in the same directory.
* change #include "target_request.h" to <target/target_request.h>Zachary T Welch2009-12-031-1/+1
| | | | | | | | | | | | Changes from the flat namespace to heirarchical one. Instead of writing: #include "target_request.h" the following form should be used. #include <target/target_request.h> The exception is from .c files in the same directory.
* change #include "register.h" to <target/register.h>Zachary T Welch2009-12-031-1/+1
| | | | | | | | | | | | Changes from the flat namespace to heirarchical one. Instead of writing: #include "register.h" the following form should be used. #include <target/register.h> The exception is from .c files in the same directory.
* change #include "image.h" to <target/image.h>Zachary T Welch2009-12-031-1/+1
| | | | | | | | | | | | Changes from the flat namespace to heirarchical one. Instead of writing: #include "image.h" the following form should be used. #include <target/image.h> The exception is from .c files in the same directory.
* change #include "breakpoints.h" to <target/breakpoints.h>Zachary T Welch2009-12-031-1/+1
| | | | | | | | | | | | Changes from the flat namespace to heirarchical one. Instead of writing: #include "breakpoints.h" the following form should be used. #include <target/breakpoints.h> The exception is from .c files in the same directory.
* change #include "jtag.h" to <jtag/jtag.h>Zachary T Welch2009-12-031-1/+1
| | | | | | | | | | | | Changes from the flat namespace to heirarchical one. Instead of writing: #include "jtag.h" the following form should be used. #include <jtag/jtag.h> The exception is from .c files in the same directory.
* improve gdb_init() sequenceZachary T Welch2009-11-301-33/+46
| | | | | | | | | | | | Rework gdb_init to create flexible APIs (gdb_target_add_{one,all}) and static helper (gdb_target_start) for starting GDB services. Eliminates duplicated code and provides general mechanisms for adding GDB services. The 'init' command is updated to call the new API, and later patches can decouple its policy of adding all targets therein. Provides the new capability to use both piped and TCP servers when multiple targets are defined. The first target fills the pipe, and others will be started on TCP ports (unless disabled, i.e. gdb_port=0).
* fix typos in source filesUwe Hermann2009-11-261-5/+5
| | | | | | Correct some spelling errors in source comments and printed output. Signed-off-by: Zachary T Welch <zw@superlucidity.net>
* target: create and use target_name()David Brownell2009-11-251-5/+5
| | | | | | | | | | | | | Several of the sites now using target_type_name() really ought to be using an instance-specific name. Create a function called target_name(), accessing the instance's own (command) name. Use it in several places that really should be displaying instance-specific names. Also in several places which were already doing so, but which had no wrapper to call. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* target: target_get_name() --> target_type_name()David Brownell2009-11-251-2/+2
| | | | | | | | | | | | | There are two names that may matter on a per-target basis. One is a per-instance name (for example, "at91sam7s.cpu"). The other is the name of its type (for example, "arm7tdmi"), which is shared among multiple targets. Currently target_get_name() returns the type name, which is misleading and is rarely appropriate for target diagnostics. Rename that as target_type_name(). Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* server: use register_commandsZachary T Welch2009-11-241-22/+50
| | | | Converts server directory to use new command registration paradigm.
* use COMMAND_REGISTER macroZachary T Welch2009-11-241-6/+6
| | | | | Replaces direct calls to register_command() with a macro, to allow its parameters to be changed and callers updated in phases.
* use COMMAND_PARSE_ENABLE macro where appropriateZachary T Welch2009-11-181-42/+3
| | | | | | | | Updates all command parsing of simple "enable" and "disable" arguments. A few case in the tree use a tri-state or extended arguments, which cannot use this simple macro. Simlifies the xscale icache/dcache command handler logic.
* command_handler: change 'cmd_ctx' to CMD_CTXZachary T Welch2009-11-171-1/+1
| | | | Convert all command handler 'cmd_ctx' parameter usage with CMD_CTX.
* command_handler: change 'args' to CMD_ARGVZachary T Welch2009-11-171-12/+12
| | | | | This patch converts all instances of 'args' in COMMAND_HANDLER routines to use CMD_ARGV macro.
* command_handler: change to 'argc' to CMD_ARGCZachary T Welch2009-11-171-6/+6
| | | | | This patch converts all instances of 'argc' in COMMAND_HANDLER routines to use CMD_ARGC.
* target: simplify register get/set opsDavid Brownell2009-11-171-9/+2
| | | | | | | | | | | No need to indirect from registered integers to pointers. Just stash the pointers directly in the register struct, and don't even bother registering. This is a small code shrink, speeds register access just a smidgeon, and gets rid of another rude exit() path. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* rename CEIL as DIV_ROUND_UPZachary T Welch2009-11-161-11/+11
| | | | | Improves the name of this macro, moves it to types.h, and adds a block of Doxygen comments to describe what it does.
* #include "target.h" less wildlyDavid Brownell2009-11-161-1/+1
| | | | | | | | | Don't include "target.h" from more headers than necessary. This avoids needless interdependencies and duplicated include paths. Don't needlessly include it in source files, either. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* target: don't implicitly include "breakpoint.h"David Brownell2009-11-161-0/+1
| | | | | | | | | | | Most files in the tree seem to have ended up including this, and *quite* needlessly ... only code implementing or using breakpoints actually needs these declarations. So take it out of the header files which included it, and put it in files which use it ... reduce needless interdependencies. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* command_context_t -> struct command_contextZachary T Welch2009-11-131-3/+3
| | | | Remove misleading typedef and redundant suffix from struct command_context.
* flash_bank_t -> struct flash_bankZachary T Welch2009-11-131-7/+7
| | | | Remove misleading typedef and redundant suffix from struct flash_bank.
* target_t -> struct targetZachary T Welch2009-11-131-21/+21
| | | | Remove misleading typedef and redundant suffix from struct target.
* reg_t -> struct regZachary T Welch2009-11-131-6/+6
| | | | Remove misleading typedef and redundant suffix from struct reg.
* image_t -> struct imageZachary T Welch2009-11-131-1/+1
| | | | | | | Remove misleading typedef and redundant suffix from struct image. Also removes the typedef from enum image_type, as it is used in image.h only.
* reg_arch_type_t -> struct reg_arch_typeZachary T Welch2009-11-131-2/+2
| | | | Remove misleading typedef and redundant suffix from struct reg_arch_type.
* connection_t -> struct connectionZachary T Welch2009-11-131-34/+34
| | | | Remove misleading typedef and redundant suffix from struct connection.
* gdb_service_t -> struct gdb_serviceZachary T Welch2009-11-131-8/+8
| | | | Remove misleading typedef and redundant suffix from struct gdb_service.
* gdb_connection_t -> struct gdb_connectionZachary T Welch2009-11-131-19/+19
| | | | Remove misleading typedef and redundant suffix from struct gdb_connection.
* use CALL_COMMAND_HANDLER instead of direct callsZachary T Welch2009-11-131-1/+1
| | | | | | 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.
* use COMMAND_HANDLER macro to define all commandsZachary T Welch2009-11-131-6/+6
|
* log: improve log_callback_fn signatureZachary T Welch2009-11-111-2/+2
| | | | Use unsigned type for line number in log_callback_fn signature.
* server: remove useless declarationsZachary T Welch2009-11-091-18/+26
| | | | Remove server command declarations, make handler routines static.
* Update all server port command to use new helper.Zachary T Welch2009-11-051-9/+1
|
* Retired gdb_attach. gdb-detach event covers this functionality.Øyvind Harboe2009-10-131-66/+3
|
* If halt times out, stop GDB. Allows e.g. manual reset via monitor commands.Øyvind Harboe2009-10-121-1/+4
|
* Stop debug session if halt failsØyvind Harboe2009-10-091-1/+6
|
* Stop GDB when polling fails, srst assert or powerdropout is detectedØyvind Harboe2009-10-081-1/+1
|
* When attaching GDB to OpenOCD, the target state is no longer affected.oharboe2009-09-241-28/+64
| | | | | | | | | Added gdb_sync feature that allows GDB to sync up to target state. Issue "monitor gdb_sync" and the next stepi, will return immediately with updated register values to GDB. git-svn-id: svn://svn.berlios.de/openocd/trunk@2754 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Remove annoying end-of-line whitespace from most src/*dbrownell2009-09-211-1/+1
| | | | | | | files; omitted src/httpd git-svn-id: svn://svn.berlios.de/openocd/trunk@2742 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* David Brownell <david-b@pacbell.net> start phasing out integers as target IDsoharboe2009-08-301-4/+12
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2650 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Fix NPE in GDB_EVENT_END as logforwarding was not disabled early enoughoharboe2009-07-271-1/+7
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2570 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Andreas Fritiofson <andreas.fritiofson@gmail.com> UTF8 fixesoharboe2009-07-171-1/+1
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2549 b42882b7-edfa-0310-969c-e2dbd0fdcd60