Commit Graph

846 Commits

Author SHA1 Message Date
David Brownell
dd9d1a3459 misc code review updates
More updates from the code review by Steve Grubb <sgrubb@redhat.com>.
The Jim float-comparision bug just gets a comment not a fix, though.

Cc: Steve Grubb <sgrubb@redhat.com>.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-12-05 14:40:06 -08:00
Zachary T Welch
b58c1d808f switch 'rm' command away from using Jim
Commands that do not need to use Jim should be registered as
high-level command handlers.
2009-12-04 03:34:32 -08:00
David Brownell
f62c035c52 doxygen: remove some warnings
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-12-03 18:31:38 -08:00
Zachary T Welch
822c06d9e3 remove tertiary include paths
With all #include directives converted, we only need to have the
top-level src/ directory in the search path.
2009-12-03 04:24:50 -08:00
Zachary T Welch
c538a830cd change #include "server.h" to <server/server.h>
Changes from the flat namespace to heirarchical one.  Instead of writing:

	#include "server.h"

the following form should be used.

	#include <server/server.h>

The exception is from .c files in the same directory.
2009-12-03 04:24:49 -08:00
Zachary T Welch
c6dd6a576d change #include "target.h" to <target/target.h>
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-12-03 04:24:42 -08:00
Zachary T Welch
df0e90ec8c change #include "types.h" to <helper/types.h>
Changes from the flat namespace to heirarchical one.  Instead of writing:

	#include "types.h"

the following form should be used.

	#include <helper/types.h>

The exception is from .c files in the same directory.
2009-12-03 04:22:52 -08:00
Zachary T Welch
35f1a40f6f change #include "jim.h" to <helper/jim.h>
Changes from the flat namespace to heirarchical one.  Instead of writing:

	#include "jim.h"

the following form should be used.

	#include <helper/jim.h>

The exception is from .c files in the same directory.
2009-12-03 04:22:52 -08:00
Zachary T Welch
264d24495d change #include "command.h" to <helper/command.h>
Changes from the flat namespace to heirarchical one.  Instead of writing:

	#include "command.h"

the following form should be used.

	#include <helper/command.h>

The exception is from .c files in the same directory.
2009-12-03 04:22:48 -08:00
Zachary T Welch
896ac8d4ef allow #include directives to use module name
Includes the src directory in the search path, so header files may be
migrated from:

  #include "foo.h"

to
  #include <module/foo.h>

which is more conducive for installation.
2009-12-03 01:54:15 -08:00
David Brownell
a79b76d893 stubs: buildfix
The new stubs for httpd and ioutil gave errors like:

  ioutil_stubs.c: In function ‘ioutil_init’:
  ioutil_stubs.c:27: error: implicit declaration of function ‘LOG_DEBUG’
  ioutil_stubs.c:28: error: ‘ERROR_OK’ undeclared (first use in this function)
  ioutil_stubs.c:28: error: (Each undeclared identifier is reported only once
  ioutil_stubs.c:28: error: for each function it appears in.)

Fix.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-12-02 15:24:14 -08:00
Zachary T Welch
eaf10f69de remove BUILD_IOUTIL symbol
Add ioutil_stubs.c to provide an empty ioutil_init() routine.
Add ioutil.h to prevent applications from needing to declare it.

Allows unconditionally calling that function during startup, and the
resulting libocdhelper library API is now more stable.

Prints a DEBUG message when the stub implementation is included.
2009-12-02 13:26:26 -08:00
Øyvind Harboe
5576a6240a command: the Jim interpreter can now be provided rather than created
In embedded hosts, the Jim interpreter can come from the
existing context rather than be created by OpenOCD.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2009-12-01 09:53:23 +01:00
Zachary T Welch
330733eadf improve command prohibition error report
Ensures that the correct information gets displayed, depending on the
mode of the command being denied.  Fixes misreporting all commands as
needing to run "before 'init'".
2009-11-30 20:54:40 -08:00
Zachary T Welch
8fc5a9a5e9 remove interp global variable!
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-30 16:29:34 -08:00
Zachary T Welch
cbc894ed7b command output capture: do not use interp global
Adds a log_capture_state structure to pass to the log capture
callback used by the command module.  Ensures that the capture occurs
in the proper context.
2009-11-30 16:29:34 -08:00
Zachary T Welch
7b2906de24 do not extern 'interp' from command.c
Adds 'interp' field to command_context, chasing the few remaining
references to the global variable outside of the command module.
2009-11-30 16:29:34 -08:00
Zachary T Welch
5dd6457d2c make syntax errors respond with 'usage'
The 'help' text will become more verbose, so its entire text will be
far more than desired when you only borked your syntax.  The usage
still allows the commands to be looked up for more help.
2009-11-30 16:29:34 -08:00
Zachary T Welch
3d204ec66a move improperly located documentation
Somehow, the comment block for command handlers ended up associated
with the output_handler.  Move it to the command_handler_t declaration.
2009-11-30 16:29:34 -08:00
Zachary T Welch
bc9ae74073 improve command_done() API and docs
command_done() does not need to return an error, but it needed
Doxygen comment.  Provide some for copy_command_context as well.

Note: this audit revealed some potential bugs with the command context
implementation.  There was a reason that commands were added at the
end of the list.  Shallow copying of command_context means that
the list is shared between them.  And commands added at the top-level
before the pre-existing commands will not be available in the shared
context as they were before.  Yikes!

Fortunately, this does not seem to occur in general use, as
'add_help_text' gets registered in startup.tcl and claims the first slot
in my own test cases.  Thus, it seems that we have been masking the issue
for now, but it shows the need for further architectural improvement in
the core command module.
2009-11-30 16:29:34 -08:00
Zachary T Welch
c0630d8a58 only display usable commands in help
With the ability to defer 'init', users can access the help system while
still in CONFIG mode.  This patch omits commands from the help and usage
list when they cannot be run in the current command mode, making it much
easier to see what can be done at a given time.
2009-11-30 16:29:24 -08:00
Zachary T Welch
2da2864632 remove redundant 'rm' command handler
Two 'rm' commands were implemented and registered.  This removes the
version that would have never been called prior to refactoring the
command registration.
2009-11-28 13:00:39 -08:00
Zachary T Welch
8795b8f9df add error checking in command_new
Adds checks for memory allocation failures.  Started to use calloc()
instead of malloc()/memset(), but I got carried away.  This kind of work
should be done throughout the tree, but it's almost hopeless at present.
2009-11-28 13:00:39 -08:00
Zachary T Welch
42e00bb379 include mode information in help text.
Extends the help output to list the valid modes for each commands.
Fixes a memory leak of the returned command_name() string.
2009-11-28 13:00:39 -08:00
Zachary T Welch
fd343bea7f refactor command mode detection
Splits the check for a command's ability to run into a helper.

This also fixes a bug whereby commands that specified COMMAND_EXEC
were allowed to run during the configuration stage.  This allowed
problematic commands to be called before 'init', defeating the intention
of specifying that command mode.  With this change, the run_command()
helper denies access to handlers that should run only after 'init'
during the configuration stage.
2009-11-28 13:00:39 -08:00
Zachary T Welch
933b4579f0 add command private data setter/accessor
Presently, commands registration taks a static handler data pointer.
This patch adds support for commands that require a dynamic pointer,
such as those registered in a dynamic context (e.g. subcommands for a
user-created 'foo.cpu' command).  The command_set_handler_data will
update a command (group) to use a new context pointer, while the
CMD_DATA macro allows command handlers to access the value.
Jim handlers should find this value in interp->cmdPrivData.
2009-11-28 13:00:39 -08:00
Zachary T Welch
3b5751a4d4 add 'command mode' introspective handler
Allows scripts to behave different depending on the current mode.
Also allows introspection of the mode required for commands.
2009-11-28 13:00:39 -08:00
Zachary T Welch
89fa493a3b remove unknown handler
Updates command registration to provide top-level handlers for all
commands, rather than falling back onto the 'unknown' command. Instead,
that same handler is registered for placeholders, providing the same
functionality under the root verb command name instead.  This permits
users to implement their own 'unknown' function, and it resolves some
mind-bending breakage related to function object lookup while recursing.

Changes 'ocd_bounce' to call 'ocd_command' and 'ocd_help' from the
wrapper directly, rather than bouncing through their wrappers. This
prevents endless recursion caused by the above changes, whereby the
'command' wrapper's type check would blow the stack to hell and gone.
2009-11-28 13:00:39 -08:00
Zachary T Welch
df22f0f9ca improve command handler wrapper script
Adds 'ocd_bouncer' in startup.tcl that is called as a helper for
all command handlers, shrinking the embedded C wrapper to a mere stub.

Jim handlers are called directly, simple handlers get called with the
wrapper to capture and discard their output on error, and placeholders
call help directly (though the unknown handler still does this too).
It attempts to improve the quality of the error messages as well.
2009-11-28 13:00:38 -08:00
Zachary T Welch
37dd5a685a add 'command type' introspective handler
Adds the 'command' group handler, with the 'type' command producing
a string that tells whether the given command is 'native' (for Jim-based
command handlers), 'simple' (for simple built-in commands), 'group'
for command group placeholders, and 'unknown' if not found in the
command registration tables (e.g. core built-ins functions).
2009-11-28 12:58:35 -08:00
Zachary T Welch
77aa7ca8d6 fix regression causing duplicated output
The command refactoring caused subcommand handlers to produce duplicate
output when run.  The problem was introduced by failing to ensure all
such invocations went through a top-level "catcher" script, prefixing
the command name with the 'ocd_' prefix and consuming its results.

The fix is to ensure such a top-level "catcher" script gets created
for each top-level command, regardless of whether it has a handler.
Indeed, this patch removes all command registrations for sub-commands,
which would not have worked in the new registration scheme anyway.

For now, dispatch of subcommands continues to be handled by the new
'unknown' command handler, which gets fixed here to strip the 'ocd_'
prefix if searching for the top-level command name fails initially.
Some Jim commands may be registered with this prefix, and that situation
seems to require the current fallback approach.  Otherwise, that prefix
could be stripped unconditionally and the logic made a little simpler.
The same problem must be handled by the 'help' command handler too,
so its lookup process works as intended.

Overall, the command dispatching remains more complicated than desired,
but this patch fixes the immediate regressions.
2009-11-27 14:30:26 -08:00
Zachary T Welch
a3d81eed4d support OPENOCD_DEBUG_LEVEL environment setting
Detect the OPENOCD_DEBUG_LEVEL setting in log_init(), allowing the
very early startup phases to be debugged.
2009-11-25 10:29:06 -08:00
Zachary T Welch
be482a5335 log: improve initialization
Removes redundant assignment of start_ms from log_register_commands().
Eliminates command_context parameter and return value.
Adds Doxygen comment block for this API call.
2009-11-25 10:29:06 -08:00
Zachary T Welch
d89c631014 add script_command_run helper
Eliminates duplicated code in script_command and handle_unknown_command.
Fixes bug with duplicated help output generated by placeholder commands.
2009-11-25 10:29:05 -08:00
Zachary T Welch
9e5d8a94f1 encapsulate and re-use log capture, retval setup
Factors log capture while running script commands, eliminating
duplicated code between script_command and jim_capture.  Factors
setting a command's Jim "retval" into a new helper as well.

Using these new helpers in the new unknown command handler's
fixes possible regressions caused by these bits being missing.
2009-11-25 10:29:05 -08:00
Zachary T Welch
910bb250c4 combine help and usage command handlers
Remove duplicated handler code by checking the running command name.
2009-11-25 10:29:05 -08:00
Zachary T Welch
c297a14f70 improve usage and help command output
Rewrite formatting code in C, removing last remenants of TCL help code.
Sinificantly improves the readability by using smarter indent and wrap.
2009-11-24 21:37:37 -08:00
Zachary T Welch
6b066cd170 allow scripts to update usage information
The add_usage_text command uses the same C handler, which was updated
to support its new polymorphic role.  This patch updates the two script
commands that needed this support: 'find' and 'script'.
2009-11-24 21:37:37 -08:00
Zachary T Welch
17a9dea53a add jim_handler to command_registration
Adding jim_handler field to command_registration allows removing the
register_jim helper.  All command registrations now go through the
register_command{,s}() functions.
2009-11-24 21:37:37 -08:00
Zachary T Welch
cd7e76ebf0 refactor command_new to use command_registration
Save stack space: use a struct.  Makes it easier to add new parameters.
2009-11-24 21:37:37 -08:00
Zachary T Welch
29772ec372 log: use register_commands()
Use register_commands() for logging callbacks.  Improve help and add
proper usage.
2009-11-24 21:37:32 -08:00
Zachary T Welch
8de1e7bd9e ioutil: use register_commands()
Use table instead of individual calls.  Add proper usage information.
2009-11-24 21:37:32 -08:00
Zachary T Welch
62e5649600 rewrite 'unknown' command dispatching in C
Rewrite the magical 'unknown' command in C as a Jim handler, allowing
it to dispatch commands to any level in the tree.
2009-11-24 21:37:30 -08:00
Zachary T Welch
769fbfa058 add public API for locating commands
Allow other modules to find a command, primarily for the purpose of
registering and unregistering subcommands.
2009-11-24 21:37:30 -08:00
Zachary T Welch
4c54c27da7 refactor script_command context grabbing
Move command context acquisition to current_command_context() for re-use.
2009-11-24 21:37:30 -08:00
Zachary T Welch
60ba4641d6 add command registration chaining
Adds the ability to chain registration structures.  Modules can define a
command with the 'chain' and 'num_chain' fields defined in their
registration table, and the register_commands() function will initialize
these commands.  If the registration record creates a new command, then
the chained commands are created under it; otherwise, they are created
in the same context as the other commands (i.e. the parent argument).
2009-11-24 21:37:30 -08:00
Zachary T Welch
607634f967 more command registration refactoring
Split out the handler registration into its own function, and add a
few obviously missing NULL pointer error checking.
2009-11-24 21:37:30 -08:00
Zachary T Welch
25a7ac2c75 command: use register_commands for handlers
Use register_commands() to register low-level command handlers,
adding a builtin_command_handlers declaration that is easy to understand.
Splits help and usage information into their appropriate fields.
2009-11-24 21:37:30 -08:00
Zachary T Welch
d107f71c50 add command usage, separate from help
Adds the usage command, to display usage information for commands.
The output for this command will remain erronenously empty until
commands are updated to use these new coventions.
2009-11-24 21:37:29 -08:00
Zachary T Welch
2461855494 add register_commands for batch registration
The register_commands API takes multiple commands in one call, allowing
modules to declare and pass a much simpler (and more explicit) array of
command_registration records.
2009-11-24 21:37:29 -08:00
Zachary T Welch
69076057dd add struct command_registration
Add a structure to encapsulate command registration information, rather
than passing them all as parameters.  Enables further API changes that
require additional required or optional parameters.

Updates the register_command API and COMMAND_REGISTER macro to use it,
along with their documentation.
2009-11-24 21:37:29 -08:00
Zachary T Welch
833e7f5248 use COMMAND_REGISTER macro
Replaces direct calls to register_command() with a macro, to allow
its parameters to be changed and callers updated in phases.
2009-11-24 21:37:29 -08:00
Zachary T Welch
f7e1f2df74 add COMMAND_REGISTER macro
Provides a migration path for the widely used register_command API,
which needs to be updated to provide new functionality.

This macro allows the API to change without having to update all of its
callers at the same time.
2009-11-24 21:37:29 -08:00
Zachary T Welch
47cb10217a improve startup tcl scripts
Fix a couple of layering violations missed in the last round.
Add missing comment headers.
2009-11-24 21:37:29 -08:00
Andreas Fritiofson
338a674faa improve alloc_vprintf
The previous implementation was unnecessarily complex. Get rid of the loops,
let vsnprintf() tell us directly how much storage we need and allocate that. A
second pass writes the actual string. Also add a va_end() that was missing.
This should be much faster for large strings and less wasteful for small ones.

A quirk that has been retained is that some callers patch in a newline at the
end of the returned string and depend on alloc_vprintf to allocate at least
one byte extra.

Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Signed-off-by: Zachary T Welch <zw@superlucidity.net>
2009-11-24 12:48:02 -08:00
Andreas Fritiofson
0583cb0a0d support for scripts in $HOME/.openocd
Add $HOME/.openocd as the first default script search directory, allowing
the user to override the standard scripts.

Update the user guide with information on where OpenOCD expects to find
configuration files and scripts. Also fixed some minor formatting issues.

Add entry to NEWS as well.

Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2009-11-24 08:57:02 +01:00
Øyvind Harboe
700a60ec57 embedded: reduce stack usage
Allocate working structures on stack to avoid issues with
path lengths + reduce stack usage.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2009-11-22 13:38:42 +01:00
Andreas Fritiofson
425e43d9d1 show script search dirs in debug log
Add this to ease debugging why the standard scripts aren't
found on the default script search path in some build/install
enviroments. Especially on Windows it's not straight forward
where openocd actually looks for the scripts.

Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-21 09:30:09 -08:00
Zachary T Welch
7a67aae93c maintain command lists in sorted order
Use insertion sort to the command link lists.  The only practical effect
of this is to order the output of the new 'help' command.
2009-11-20 15:03:41 -08:00
Zachary T Welch
a19aaf9136 add add_help_text command handler
Rewrite means for scripts to register help text for commands.  These
cause the new commands to be stored in the command heirarchy, with
built-in commands; however, they will never be invoked there because
they do not receive a command handler.  The same trick is used for
the Jim commands.

Remove the old helpers that were used to register commands.
2009-11-20 15:03:35 -08:00
Zachary T Welch
e5b0a69ba9 provide command context during cmd_init
For the startup.tcl code to use built-in commands, the context must be
associated with the interpreter temporarily.  This will be required to
add help text.
2009-11-20 14:52:56 -08:00
Zachary T Welch
5458fef43c improve 'help' command
Rewrites 'help' command in C, using new 'cmd_help' for display.  Adds the
built-in 'help' COMMAND_HANDLER to provide better output than the
TCL-based script command (e.g. heirarchical listing of commands).

The help string is stored in the command structure, though it conitnues
to be pushed into the Jim environment.  The current idiomatic usage
suggests the addition of a usage field as well, to provide two levels
of detail for users to consume (i.e. terse usage list, or verbose help).
2009-11-20 14:52:56 -08:00
Zachary T Welch
82449e2d60 factor help script command into parts
Creates a helper function, cmd_help, which displays the help string
for a single command.  Presently, it is called from the loop in help.

The routine has been extended to allow indentation of command groups,
so an improved help command can improve the display of information.
2009-11-20 14:52:56 -08:00
Zachary T Welch
9e9633c6b9 refactor command registration
Refactors the command registration to use helpers to simplify the code.
The unregistration routines were made more flexible by allowing them
to operate on a single command, such that one can remove all of a
commands children in one step (perhaps before adding back a 'config'
subcommand that allows getting the others back).  Eliminates a bit
of duplicated code and adds full API documentation for these routines.
2009-11-20 14:52:56 -08:00
Zachary T Welch
73c6e3bb18 change command_find helper interface
Avoid requiring double pointers where a single would suffice.
2009-11-20 14:52:56 -08:00
Zachary T Welch
67c29d9935 factor script_command argv allocation
Splits argument allocation out from script command, reusing free() code.
2009-11-20 14:52:56 -08:00
Zachary T Welch
c0d14dc7f1 remove fast command and jim_global_long
Removing the fast command eliminates the fast_and_dangerous global,
which was used only by arm7_9_common as an initializer.  The command
is not called in the tree; instead, more explicit commands are used.

The jim_global_long function was not used anywhere in the tree.
2009-11-18 15:51:07 -08:00
Zachary T Welch
4d8d1d32d0 change all bool parsers to accept any value
This patch changes the behavior of all boolean parsing callers to
accept any one of "true/enable/on/yes/1" or "false/disable/off/no/0".

Since one particular pair will be most appropriate in any given
situation, the specific macros should continue to be used in
order to display the most informative error messages possible.
2009-11-18 15:51:07 -08:00
Zachary T Welch
7e4adfe1c5 add handle_command_parse_bool command helper
Rewrite arm11_handle_bool to provide a generic on/off command helper.

Refactors COMMAND_PARSE_BOOL to use new command_parse_bool helper,
which gets reused by the new command_parse_bool_any helper.
This later helper is called by the new command helper function to
accepts any on/off, enable/disable, true/false, yes/no, or 0/1 parameter.
2009-11-18 15:51:07 -08:00
Zachary T Welch
bd5a1799ea add COMMAND_PARSE_BOOL macro and friends
Adds several macros similar to COMMAND_PARSE_NUMBER, but for parsing
boolean command arguments.  Two flavors are provided to provide
drop-in compatibility with existing code, allow for the elimination
of a lot of code bloat while improving the error checking and reporting.

COMMAND_PARSE_ON_OFF parses "on"/"off" command parameters.
COMMAND_PARSE_ENABLE parses "enable"/"disable" command parameters.

Both print the error and return an error out of the calling function.
2009-11-18 15:51:07 -08:00
Zachary T Welch
5e229bbf87 pass startup_tcl to command_init
Removes external linkage from helper module, making the startup
code a parameter to a new command context's initialization routine.
2009-11-18 07:22:22 -08:00
Zachary T Welch
cb7dbc1af4 split startup.tcl file across modules
Moves definitions for each layer into their own file, eliminating
layering violations in the built-in TCL code.  Updates src/Makefile.am
rules to include all files in the final startup.tcl input file, and
others Makefile.am rules to distribute the new files in our packages.
2009-11-18 07:21:42 -08:00
Zachary T Welch
903daa796a move startup.c to libopenocd
Moves the creation of startup_tcl.c from src/helper/ to src/.
Prepares to split the startup.tcl file into its per-module parts.
2009-11-18 03:59:14 -08:00
Zachary T Welch
cfaf7bdd0a remove unused variable from run_command 2009-11-17 11:40:21 -08:00
Zachary T Welch
cffc98ad80 add CMD_NAME variable in command_invocation
Update CMD_NAME from its migratory home in CMD_ARGV[-1] to cmd->name.
Allows CMD_ARGV++ idiom to be used safely in command handlers.
2009-11-17 11:40:21 -08:00
Zachary T Welch
be084414ba add struct command_invocation for COMMAND_HANDLER
Adds the command_invocation structure to encapsulate parameters for
all COMMAND_HANDLER routines.  Rather than passing several arguments
to each successive subroutine, a single pointer may be passed around.

Changes the CMD_* macros to reference the new fields.

Updates run_command to create an instance and pass it to the handler.
2009-11-17 11:40:21 -08:00
Zachary T Welch
2861877b32 command_handler: change 'cmd_ctx' to CMD_CTX
Convert all command handler 'cmd_ctx' parameter usage with CMD_CTX.
2009-11-17 11:40:06 -08:00
Zachary T Welch
23402315ce command_handler: change 'args' to CMD_ARGV
This patch converts all instances of 'args' in COMMAND_HANDLER routines
to use CMD_ARGV macro.
2009-11-17 11:38:07 -08:00
Zachary T Welch
7bf1a86e47 command_handler: change to 'argc' to CMD_ARGC
This patch converts all instances of 'argc' in COMMAND_HANDLER routines
to use CMD_ARGC.
2009-11-17 11:38:06 -08:00
Zachary T Welch
5b9899d6ea add more command_handler conversion macros
Add additional macros to allow command handling to be migrated easily:
CMD_CTX, CMD_ARGC, and CMD_ARGV.  Updates CMD_NAME to use CMD_ARGV.

In addition to making the remaining patches of this series cleaner,
this introduces easily sed-able symbols that could allow us to retire
these once the command handler infrastructure matures (i.e. pre-1.0).
2009-11-17 11:38:06 -08:00
David Brownell
f86137066a ARM: "armv4_5" command prefix becomes "arm"
Rename the "armv4_5" command prefix to straight "arm" so it makes
more sense for newer cores.  Add a simple compatibility script.

Make sure all the commands give the same "not an ARM" diagnostic
message (and fail properly) when called against non-ARM targets.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-16 16:36:09 -08:00
Zachary T Welch
51862bb98c fileio: improve API types
Use size_t instead of uint32_t when specifying file sizes.  Update all
consumers up through the layers to use size_t when required.  These
changes should be safe, but the higher-levels will need to be updated
further to receive the intended benefits (i.e. large file support).

Add error checking for fileio_read and file_write.  Previously, all
errors were being silently ignored, so this change might cause some
problems for some people in some cases.  However, it gives us the chance
to handle any errors that do occur at higher-levels, rather than burying
our heads in the sand.
2009-11-16 15:47:09 -08:00
Zachary T Welch
69df712d1d struct fileio: improve member types
Add const keyword to file url and cast to free().

Make size an ssize_t and chase all format strings that use it.
2009-11-16 15:47:09 -08:00
Zachary T Welch
9763aef76a helper/log: improve API parameter types
Uses unsigned type to pass line numbers.

Use uint64_t to pass sleep routines their milliseconds.  Updates sleep
routines to use this type and improve whitespace.
2009-11-16 15:47:09 -08:00
Zachary T Welch
df9b12695f use Jim_CmdProc in jim_register
The jim_register command just needed to use the type defined by jim.h.
2009-11-16 15:47:08 -08:00
Zachary T Welch
0a9daddc2e improve constness of open_file_from_path 2009-11-16 15:47:08 -08:00
Zachary T Welch
ccf59123b7 make command line options const
The getopt_long call allows a const struct option, so mark ours
const too.
2009-11-16 15:47:08 -08:00
David Brownell
b6e0f2e1c3 binarybuffer: regression fix
The "improve inline binarybuffer helpers" mis-handled bytes
with the high bit set; treat them as unsigned, not signed.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-16 14:50:07 -08:00
David Brownell
66300d5966 "types.h" doxygen fix
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-16 10:42:01 -08:00
Zachary T Welch
dc1685ca25 move ARRAY_SIZE macro to types.h
The ARRAY_SIZE macro was defined in several target files, so move it
to types.h.

This patch also removes two other identical macros: DIM (from jtag.h)
and asizeof (from arm11.h).
2009-11-16 09:58:11 -08:00
Zachary T Welch
a94748ec6d rename CEIL as DIV_ROUND_UP
Improves the name of this macro, moves it to types.h, and adds a block
of Doxygen comments to describe what it does.
2009-11-16 09:58:11 -08:00
Zachary T Welch
f0ce88b3af move container_of to types.h
The container_of macro is useful as a general solution.  It belongs
in types.h, rather than target.h where it was introduced.  Requires
the offsetof macro, which comes from <stddef.h> (moved as well).
2009-11-16 09:57:59 -08:00
Zachary T Welch
da4cb3c029 Add FILEIO_NONE access mode.
In some cases, the FILEIO_NONE access mode may be useful as a parameter
to indicate that file access should be disabled.  High-level routines can
use it to skip file access calls, as 'fileio_open' will fail presently
if called to open a file using this mode.
2009-11-16 01:38:19 -08:00
Zachary T Welch
45527ee82c binarybuffer: add API documentation
Adds Doxygen documentation for a number of the binarybuffer APIs,
including "unexpected" behavior exposed during review on the list.
2009-11-16 01:25:47 -08:00
Zachary T Welch
d6348d4316 improve inline binarybuffer helpers
Use void*, unsigned, and bool types with inline helpers.
2009-11-16 00:46:34 -08:00
Zachary T Welch
21b452cf67 improve buf_set_buf helper
Use void * and unsigned types for buffer and their sizes.
Allows it to be used with more than uint8_t * without casts.
2009-11-16 00:46:34 -08:00
Zachary T Welch
d8d8c5d8c3 improve buf_set_ones
Use memset instead of loop. Improve types, using void * and unsigned.
2009-11-16 00:46:34 -08:00
Zachary T Welch
d09e308130 improve buf_cpy helper
Use memcpy for bulk of copy, improve final byte handling.
Improve types by using void * for buffers and unsigned for size.
2009-11-16 00:46:34 -08:00
Zachary T Welch
e4ee891759 improve buf_cmp and buf_cmp_mask helpers
Rewrite buf_cmp to use memcpy for bulk of comparison.  Add static
helper to perform comparison of trailing byte, which uses another
static helper to perform a maksed comparison.  The masked comparison
helper is used by the buf_cmp_mask to simplify its loop.
Improve types to use void *, unsigned, and return bool.
2009-11-16 00:46:33 -08:00
Zachary T Welch
d50caa97d1 improve str_to_buf and buf_to_str helpers
Improve types: use void * and unsigned.  Move all variables to point of
first use.  Move radix guessing logic to new str_radix_guess helper.
2009-11-16 00:46:33 -08:00
Zachary T Welch
5a43bd2e18 binarybuffer: move variables to point of first use
Reduce some noise from subsequent patches.
2009-11-16 00:46:33 -08:00
Zachary T Welch
82fc2f9628 binarybuffer: fix whitespace related issues
Add inter-operator whitespace.  Improve existing documentation.
2009-11-16 00:46:33 -08:00
David Brownell
1186f7efa7 target: less implicit inclusion of "command.h"
Lots of files still include it, often through needless
duplicate inclusion of "log.h"; sigh.

This cleans up the inclusion graph a bunch, so there are
fewer inclusion paths, but it doesn't change much otherwise.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-16 00:35:11 -08:00
Zachary T Welch
bc07ee82fb remove unused buf_to_u32_handler
Purge an unused routine from the tree and remove a layering violation.
If this code is needed, it should reappear somwhere in src/jtag/,
where struct scan_field gets defined.
2009-11-14 18:21:02 -08:00
Zachary T Welch
4d4b2958a5 struct scan_field_s -> struct scan_field
Remove obsolete suffix from struct scan_field.  Somehow, these
definitions did not get updated but did not cause any errors.
2009-11-14 18:21:02 -08:00
Zachary T Welch
ef746e27c5 command_t -> struct command
Remove misleading typedef and redundant suffix from struct command.
2009-11-13 13:30:50 -08:00
Zachary T Welch
98723c4ecd command_context_t -> struct command_context
Remove misleading typedef and redundant suffix from struct command_context.
2009-11-13 13:25:47 -08:00
Zachary T Welch
42ef503d37 jtag_tap_t -> struct jtag_tap
Search and destroy the jtag_tap_t typedef.  This also cleans up a
layering violation, removing the declaration from types.h.
2009-11-13 11:58:04 -08:00
Zachary T Welch
9f212b01be fileio_t -> struct fileio
Remove useless structure typedef.
2009-11-13 11:58:04 -08:00
Zachary T Welch
f59ec2043b log_callback_t -> struct log_callback
Removes useless and confusing typedef for log callback structure.
Types with _t should be suitable for passing by-value as arguments.
2009-11-13 11:58:04 -08:00
Zachary T Welch
f973320cbb command_handler_t: make cmd an indirect parameter
This patch removes 'cmd' from the list of direct parameters, moving
that pointer to args[-1] (by way of the new CMD_NAME macro).
2009-11-13 10:56:55 -08:00
Zachary T Welch
deede35c27 command_handler_t: make args parameter const
This patch prevents command handlers from modifying the strings passed
in the 'args' array.
2009-11-13 10:55:27 -08:00
Zachary T Welch
cc63d6e72b command_handler_t: make cmd parameter const
Prevents the command name from being modified in command handlers.
Again, this has cascading effects, but the patches are fairly minimal.
2009-11-13 10:55:27 -08:00
Zachary T Welch
d22270e0ed command_handler_t: make argc unsigned
The number of command arguments will always be 0 or more, so use
the right type in handlers.  This has a cascading effect up through
the layers, but the new COMMAND_HANDLER macros prevented total chaos.
2009-11-13 10:55:27 -08:00
Zachary T Welch
a585bdf726 add CMD_NAME macro for command handlers
By introducing the CMD_NAME macro, this parameter may be integrated
as args[-1] in command.[ch], without touching any other call sites.
2009-11-13 10:55:00 -08:00
Zachary T Welch
cfc4d5c6b7 use COMMAND_HANDLER macro to define all commands 2009-11-13 10:51:45 -08:00
Zachary T Welch
ddb6138ed4 add command_handler_t type
This patch adds new typedefs for command handler callback functions.
Users of this type signature were updated to use these new types.
It uses the new __COMMAND_HANDLER macro to prevent duplication.
2009-11-13 10:51:45 -08:00
Zachary T Welch
3f9fd4e2a6 add COMMAND_HANDLER and COMMAND_HELPER macros
The COMMAND_HANDLER and COMMAND_HELPER macros allow commands to be
defined in a manner that decouples them from the exact order and type of
their parameters.  Once converted, incremental changes to the command
handler type can be addressed in incremental patches that do not need to
touch the entire tree.

These macros' implementation, __COMMAND_HANDLER, is used to define the
new command_handler_t type, and additional patches will use it to derive
new macros to define extended command types (e.g. flash, nand, pld).
The CALL_COMMAND_HANDLER provides a means of calling helpers or nested
handlers from withing a command handler.

This patch uses C99 varadic macro expansion.  Please report compilers
that cannot handle this code.
2009-11-13 10:51:45 -08:00
Zachary T Welch
1ae4d93c3c add command_output_handler_t
Add a typedef for command output handler function type, simplifying
the appearance of functions that use it and eliminating duplicate code.
2009-11-13 10:51:45 -08:00
Zachary T Welch
158698e333 improve command registration
Eliminate duplicate code for linking commands into a list.

Adds a check to ensure the command does not already exist;
if it does, return that one instead of creating a duplicate.
2009-11-11 13:50:28 -08:00
Zachary T Welch
46d9ba4c8b add help regardless of callback
Add help for commands regardless of whether a handler is involved.
With this, all sorts of new commands can be found in 'help' text.
Hopefully, all of them have been documented....

Sadly, the lsort function appears to handle nested lists poorly, such
that sub-commands do not group with their parents.
2009-11-11 12:15:39 -08:00
Zachary T Welch
a1a3ee579c eliminate duplicate helptext management
Add helpers to manage adding entries to the helptext list.
Adds support for arbitrarily nested commands.
2009-11-11 12:15:39 -08:00
Zachary T Welch
2d3cc1eac1 add command_name helper
The command_name function returns a malloced string for a given
command and its parents.  This can be used to display a message
to the user, but it is used internally to handle registration
and syntax errors.  This helps permit arbitrary command nesting.
2009-11-11 12:15:39 -08:00
Zachary T Welch
f93c98081f wrap help command
Use continuation characters to wrap the help command into 80 columns.
2009-11-11 12:15:39 -08:00
Zachary T Welch
e09d8938f5 script_debug(): improve types
Use unsigned type for number of arguments.
2009-11-11 05:40:48 -08:00
Zachary T Welch
c942969377 command.c: make private routines static
This patch also improves the signature of run_command function.
2009-11-11 05:40:48 -08:00
Zachary T Welch
6a2e83c017 log: improve log_callback_fn signature
Use unsigned type for line number in log_callback_fn signature.
2009-11-11 05:40:48 -08:00
Zachary T Welch
0cd414c7d6 time_support: improve use of types
Update timeval_add_time to use long int; implement timeval_add with it.
Update timeval_ms to check gettimeofday return value, return int64_t.
2009-11-11 05:40:48 -08:00
Øyvind Harboe
151a270695 tcl: HostOs now picks up eCos as well during compile time
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2009-11-10 08:36:19 +01:00
Zachary T Welch
841721929a command.c: make commands static
Removes useless declarations, moving the handler functions to appear
before their use in the (much bigger) command registriation function.
2009-11-09 21:39:46 -08:00
Zachary T Welch
1712d7835e src/helper: wrap and clean headers.
Remove all useless 'extern' keywords from function prototypes.
Wraps long lines for readability.
2009-11-09 09:44:33 -08:00
David Brownell
4882647f3e User's Guide: bugfix global state info
The "$ocd_HOSTOS" variable was wrongly documented.  Fix its
documentation, and its value on Linux.

Shrink a few of the too-long lines.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-09 09:40:55 -08:00
Zachary T Welch
2689f58f2a Overhaul time support API
This patch changes the duration_* API in several ways.  First, it
updates the API to use better names.  Second, string formatting has
been removed from the API (with its associated malloc).  Finally, a
new function added to convert the time into seconds, which can be
used (or formatted) by the caller.  This eliminates hidden calls to
malloc that require associated calls to free().

This patch also removes the useless extern keyword from prototypes,
and it eliminates the duration_t typedef (use 'struct duration').
These API also allows proper error checking, as it is possible for
gettimeofday to fail in certain circumstances.

The consumers have all been chased to use this new API as well, as
there were relatively few cases doing this type of measurement.
In most cases, the code performs additional checks for errors, but
the calling code looks much cleaner in every case.
2009-11-09 01:21:50 -08:00
Zachary T Welch
f6f1dbfafd Improve debug_level command argument parsing. 2009-11-05 18:03:18 -08:00
Zachary T Welch
36a3646c22 Add macro for parsing numeric command arguments.
This helper eliminates significant amount of redundant code in command
handler functions throughout the system.  It wraps the lower-level
parse_* macros to implement a policy for reporting parse errors to the
active command context (cmd_ctx).  If errors do occur, this macro causes
the calling function to abort with the proper return code.
2009-11-05 17:27:25 -08:00
Zachary T Welch
68785af4da Add stringify macros in src/helper/types.h. 2009-11-05 17:20:18 -08:00
Spencer Oliver
e8a5092f1e bin2char: for win32 set stdin/stdout to binary mode
Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2009-10-30 11:59:57 +00:00
Øyvind Harboe
a02411a15f eCos synthetic target updates. 2009-10-21 12:02:04 +02:00
Redirect 'Slash' NIL
113679ff59 corrective fix for MinGW GNU C99 printf compliance
Compilation on cygwin, using gcc v3 with option -mno-cygwin,
currently produces a large number of the following warnings:

   warning: `gnu_printf' is an unrecognized format function type

These have been introduced with the recent MinGW GNU C99 printf
compliance patch, as gnu_printf was only introduced with gcc v4.4
and is not recognized with earlier versions.

The attached fix adds gcc version detection to the previous patch
to avoid the problem.
2009-10-19 09:49:34 -07:00
oyvind
557d1b6490 Sync with official Jim Tcl repository. 2009-10-19 15:16:42 +02:00
Redirect 'Slash' NIL
990f50a73b safer conversion to HANDLER on MinGW-W64
Assign to "intptr_t", which on some versions of MS-Windows
will widen the variable; then cast to HANDLE.
2009-10-17 22:18:38 -07:00
Redirect 'Slash' NIL
73349dc5ac More MinGW C99 printf compliance
Passing "--std=gun99" is unfortunately not sufficient to make current
MinGW compilers conform with respect to checking printf format strings.
(The C runtime seems not to have problems.)

Fix by using a "gnu_printf" format specifier not "printf".
2009-10-17 17:47:52 -07:00
Redirect \"Slash\" NIL
c9fbfbd95c jim-eventloop for MinGW-w64
Use JIM_WIDE_MODIFIER for the sscanf format, and apply it for MINGW32 as
well as other Windows environments.  (Microsoft doesn't conform to the
C99 standard, and uses "%I64d" not "%lld" for "long long".)

NB: __MINGW32__ should work on both w32 and w64,.
2009-10-17 12:15:13 -07:00
David Brownell
cb7965da15 xscale: better fix for debug_handler.bin
Generate a C struct with the data, and use that, instead of an
assembly language file.  The assembly language causes issues on
Darwin and MS-Windows, which don't necessarily use GNU AS; or
if they do, don't necessarily use its ELF syntax.

It's also better in two other ways:  fewer global symbols; and
the init-time size check gets optimized away at compile time.
(Unless it fails, in which case bigger chunks of the file vanish.)

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-10-16 13:52:40 -07:00
David Brownell
510db585fd portability updates
Based on some patches from <redirect.slash.nil@gmail.com>
for preliminary Win64 compilation.  More such updates are
needed, but they need work.  Compile tested on 64 and 32 bit
Linuxes, and Cygwin.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-10-14 20:04:33 -07:00
David Brownell
bc792857a5 doc updates to match "help" better
This makes the documentation a closer match to "help" output:

 - "pathmove" somehow was not documented in the User's Guide

 - "jtag_nsrst_assert_width" and "jtag_ntrst_assert_width"
   are new; both needed descriptions.

 - Removed two undocumented and fairly useless script mechanisms:
    * production/production_info/production_test ... using it,
      requires replacing everything; so having it adds no value.
    * cpu ... way out of date; hopeless to keep that current

Note that anyone using that "production" stuff already defines
their own procedures, and can keep using them with no change.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-10-14 15:18:00 -07:00
Øyvind Harboe
4d32b6eee9 Missing type for eCos. 2009-10-13 13:13:29 +02:00
David Brownell
6160a946ec add overridable Tcl "init_reset"
This abstracts the "jtag arp_init-reset" call into a method
called from OpenOCD startup and reset processing.

Platforms which have different requirements for how such hard
resets must be performed can now override "init_reset" instead
of needing to rebuild custom hacked versions of the server.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-10-08 23:51:50 -07:00
Øyvind Harboe
d75b9ec697 Update copyright statements. Make it easier to sync with Jim Tcl 2009-10-08 13:56:57 +02:00
oharboe
39b57471bf Introduced jtag_init and "jtag arp_init" to allow target scripts more control over how OpenOCD starts up and initializes the target.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2805 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-10-06 08:10:57 +00:00
dbrownell
f64e924ba9 Updates to the initial scanchain validation code:
- minor bug fixes
  - code cleanup
  - update comments
  - improve diagnostics
  - etc


git-svn-id: svn://svn.berlios.de/openocd/trunk@2759 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-09-26 19:18:42 +00:00
oharboe
1c262c8826 Try/catch scheme. Typed up the functionality and regression tested.
Ready for discussion and tiny patches that tries out this scheme.

git-svn-id: svn://svn.berlios.de/openocd/trunk@2755 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-09-25 11:11:39 +00:00
dbrownell
23e22b6ec4 Start handling the (second) SRST stage of reset better:
make sure that when there are two or more targets, their
various pre/post event reports are correctly ordered.

Previously, only the first target always saw its "pre"
method before SRST was asserted or deasserted.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2753 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-09-23 22:03:41 +00:00
oharboe
7393fcfc90 Nico Coesel <ncoesel@dealogic.nl> fix warnings. . I'm wondering why these
didn't turn up earlier. Is everyone still using gcc 3.x? Or is the x86
version of gcc 4.x much more relaxed?

git-svn-id: svn://svn.berlios.de/openocd/trunk@2749 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-09-23 07:14:03 +00:00
dbrownell
86a7d813a1 Remove annoying end-of-line whitespace from most src/*
files; omitted src/httpd


git-svn-id: svn://svn.berlios.de/openocd/trunk@2742 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-09-21 18:40:55 +00:00
dbrownell
358263f484 Tweak TCL reset script ... mostly improving descriptions of
the various steps, but also calling [target names] only once.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2726 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-09-18 00:11:51 +00:00
dbrownell
9655c5b093 Fix coredump seen in some code paths.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2723 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-09-17 18:52:32 +00:00
oharboe
14dc22612b error message upon recursive invocation of reset from reset event handlers
git-svn-id: svn://svn.berlios.de/openocd/trunk@2707 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-09-14 13:54:49 +00:00
oharboe
072d6d3db6 Dirk Behme <dirk.behme@googlemail.com> Fix typo in help text. It has to be 'production_test' instead of 'production' here.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2654 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-30 20:08:07 +00:00
oharboe
d879faa3cb David Brownell <david-b@pacbell.net> start phasing out integers as target IDs
git-svn-id: svn://svn.berlios.de/openocd/trunk@2650 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-30 17:30:14 +00:00
oharboe
4b9bdd664a David Brownell <david-b@pacbell.net> Be sure the built-in search paths always go *after* ones provided
on the command line ... matching comment in add_default_dirs().

Without this it's impossible to use a private config file which
happens to have the same name as an installed one.  Say, because
you're bugfixing a private copy...

git-svn-id: svn://svn.berlios.de/openocd/trunk@2649 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-30 17:27:50 +00:00
oharboe
0ed5f5afd9 add missing isblank() for eCos
git-svn-id: svn://svn.berlios.de/openocd/trunk@2607 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-25 06:45:40 +00:00
oharboe
bf5f21e39a Steve Grubb <sgrubb@redhat.com> fix various and sundry leaks
git-svn-id: svn://svn.berlios.de/openocd/trunk@2606 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-24 07:53:46 +00:00
ntfreak
bb5086b83e Jonas Horberg [jhorberg@sauer-danfoss.com]
Change jtag_rclk behaviour so it can be called before the interface init function

git-svn-id: svn://svn.berlios.de/openocd/trunk@2590 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-18 12:14:01 +00:00
oharboe
8b994145b8 Andreas Fritiofson <andreas.fritiofson@gmail.com> UTF8 fixes
git-svn-id: svn://svn.berlios.de/openocd/trunk@2549 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-17 19:54:25 +00:00
oharboe
fc889f0357 delete long retired commented out code (daemon_startup)
git-svn-id: svn://svn.berlios.de/openocd/trunk@2487 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-07 10:43:44 +00:00
ntfreak
d41f2bfb14 - fix build when using a cross compiler - do not try and run any host tools
- add missing types.h when platform does not contain elf.h

git-svn-id: svn://svn.berlios.de/openocd/trunk@2482 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-06 15:19:10 +00:00
oharboe
5fe4500e50 try to use tabs instead of spaces
git-svn-id: svn://svn.berlios.de/openocd/trunk@2465 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-06 08:01:22 +00:00
oharboe
fca8cddc26 human readable error message upon invalid arguments
git-svn-id: svn://svn.berlios.de/openocd/trunk@2464 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-06 07:33:38 +00:00
zwelch
f7c85c42a0 Add missing copyright header and fix @page direction in membuf.h.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2443 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-01 19:55:39 +00:00
zwelch
1d61e34e1e Fix doxygen 'undocumented parameter' warnings in membuf.h.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2426 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-30 05:34:36 +00:00
duane
9c05c92c14 Switch to strotk() grr....
git-svn-id: svn://svn.berlios.de/openocd/trunk@2406 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-27 16:44:35 +00:00
duane
8adda07ed1 Fixes from Oleksandr Tymoshenko "gonzo@bluezbox.com"
git-svn-id: svn://svn.berlios.de/openocd/trunk@2401 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-25 00:12:40 +00:00
zwelch
fddbc58091 Remove whitespace at end of lines, step 2.
- Replace '\s*$' with ''.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2398 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-24 09:38:21 +00:00
zwelch
2428bc2a5c - Replace '){' with ') {'.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2397 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-24 09:38:15 +00:00
zwelch
f11b1ff485 Remove whitespace that occurs before ')'.
- Replace '[ \t]*[)]' with ')'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2396 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-24 09:38:08 +00:00
zwelch
1793150091 Remove whitespace that occurs after '('.
- Replace '([ \t]*' with '('.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2395 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-24 09:38:01 +00:00
zwelch
dbb0f31abb - Fixes '[<>]' whitespace
- Replace '\(\w\)\([<>]\)\(\w\)' with '\1 \2 \3'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2394 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-24 09:37:56 +00:00
zwelch
9cd160608c - Fixes '+' whitespace
- Replace '\(\w\)\(+\)\(\w\)' with '\1 \2 \3'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2392 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-24 09:37:44 +00:00
zwelch
5e53d488dc - Fixes '=' whitespace
- Replace '\(\w\)\(=\)\(\w\)' with '\1 \2 \3'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2391 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-24 09:37:37 +00:00
zwelch
e47be43ed1 - Fixes '==' whitespace
- Replace '\(\w\)\(==\)\(\w\)' with '\1 \2 \3'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2390 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-24 09:37:31 +00:00
zwelch
c3e7d33b54 - Replace 'for(' with 'for ('.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2389 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-24 09:37:23 +00:00
zwelch
cb3429570c - Replace 'if(' with 'if ('.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2386 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-24 09:37:05 +00:00
zwelch
3324841558 Fix end-of-line style properties on newly added files.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2384 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-24 07:43:18 +00:00
duane
176b5600ed Add a growable sprintf memory buffer library
git-svn-id: svn://svn.berlios.de/openocd/trunk@2381 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-24 01:54:25 +00:00
zwelch
c97caebccd Remove whitespace at end of lines, step 2.
- Replace '\s*$' with ''.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2380 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:50:08 +00:00
zwelch
c493543fc9 - Replace '){' with ') {'.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2378 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:49:06 +00:00
zwelch
dc575dc5bf Remove whitespace that occurs before ')'.
- Replace '[ \t]*[)]' with ')'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2377 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:47:42 +00:00
zwelch
f90d8fa45f Remove whitespace that occurs after '('.
- Replace '([ \t]*' with '('.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2376 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:46:23 +00:00
zwelch
6d1d58a1fc - Fixes '[<>]' whitespace
- Replace ')\([<>]\)(' with ') \1 ('.
- 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@2375 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:45:47 +00:00
zwelch
fb1a9b2cb2 - Fixes '[|]' whitespace
- Replace ')\([|]\)(' with ') \1 ('.
- 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@2374 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:45:15 +00:00
zwelch
8959de9f67 - Fixes '+' whitespace
- Replace ')\(+\)(' with ') \1 ('.
- 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@2373 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:44:17 +00:00
zwelch
84df52f9ea - Fixes '=' whitespace
- 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 22:42:54 +00:00
zwelch
3813fda44a - Fixes '==' whitespace
- Replace ')\(==\)\(\w\)' with ') \1 \2'.
- Replace '\(\w\)\(==\)\(\w\)' with '\1 \2 \3'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2371 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:42:03 +00:00
zwelch
aea6815462 - Fixes '<<' whitespace
- 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@2370 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:41:13 +00:00
zwelch
0e2c2fe1d1 - Fixes '>>' whitespace
- 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@2369 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:40:42 +00:00
zwelch
6319ea33f7 - Fixes '<=' whitespace
- Replace '\(\w\)\(<=\)\(\w\)' with '\1 \2 \3'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2368 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:40:33 +00:00
zwelch
4ce93ac479 - Fixes '>=' whitespace
- Replace ')\(>=\)\(\w\)' with ') \1 \2'.
- Replace '\(\w\)\(>=\)\(\w\)' with '\1 \2 \3'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2367 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:40:10 +00:00
zwelch
128a733428 - Fixes '&&' whitespace
- Replace ')\(&&\)(' with ') \1 ('.
- Replace '\(\w\)\(&&\)(' with '\1 \2 ('.
- Replace '\(\w\)\(&&\)\(\w\)' with '\1 \2 \3'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2366 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:39:47 +00:00
zwelch
d61714f4d5 - Fixes '[+]=' whitespace
- Replace '\(\w\)\([+]=\)(' with '\1 \2 ('.
- Replace '\(\w\)\([+]=\)\(\w\)' with '\1 \2 \3'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2364 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:39:18 +00:00
zwelch
53d605e12c - Fixes '!=' whitespace
- 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@2363 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:38:12 +00:00
zwelch
95d2a23724 - Replace 'for(' with 'for ('.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2360 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:37:21 +00:00
zwelch
9af5e445b7 - Replace 'switch(' with 'switch ('.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2359 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:36:56 +00:00
zwelch
50c086ffb9 - Replace 'while(' with 'while ('.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2358 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:36:11 +00:00
zwelch
e43979e702 - Replace 'if(' with 'if ('.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2357 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:35:09 +00:00
oharboe
8591335ba6 update w/missing eCos definitions after latest round of compiler formatting warnings fixes
git-svn-id: svn://svn.berlios.de/openocd/trunk@2356 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 07:38:01 +00:00
ntfreak
1d9ce8d2b3 - fix break caused by r2208 when using --pipe option
- issue is gdb stdin buffer gets full before we redirect openocd output

git-svn-id: svn://svn.berlios.de/openocd/trunk@2350 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-21 21:20:10 +00:00
duane
836b6c18f0 C99 Type updates, include inttypes.h - it is catagorically required
git-svn-id: svn://svn.berlios.de/openocd/trunk@2296 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-21 02:59:39 +00:00
zwelch
580a05a07f Remove editor preferences from source files.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2294 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-19 23:56:52 +00:00
zwelch
e8ba53ef6f Oyvind Harboe <oyvind.harboe@zylin.com>:
Ecos uses sys/types.h not stdint.h.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2286 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-18 10:42:40 +00:00
zwelch
4cf8d5ec17 Remove redundant typedefs in types.h; include stdint.h unconditionally.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2283 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-18 07:11:48 +00:00
zwelch
0ca97d82d8 Transform 'u64' to 'uint64_t'
- Replace '\([^_]\)u64' with '\1uint64_t'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2282 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-18 07:11:40 +00:00
zwelch
86e4324f1b Finish transforming 'u32' to 'uint32_t'.
- Replace '\([^_]\)u32' with '\1uint32_t'.
- Replace '^u32' with 'uint32_t'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2281 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-18 07:11:11 +00:00
zwelch
f876d5e9c7 Transform 'u16' to 'uint16_t'
- Replace '\([^_]\)u16' with '\1uint16_t'.
- Replace '^u16' with 'uint16_t'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2277 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-18 07:07:59 +00:00
zwelch
c18947b947 Transform 'u8' to 'uint8_t'
- Replace '\([^_]\)u8' with '\1uint8_t'.
- Replace '^u8' with 'uint8_t'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2276 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-18 07:07:12 +00:00
zwelch
ed5b5b834e Fix compilation for Ubuntu 9.04 on x86-64 when using --enable-httpd.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2262 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-17 06:10:10 +00:00
zwelch
2d0afa36a8 Ensure range errors are reported only when errno indicates one occurred.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2260 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-17 00:31:06 +00:00
zwelch
c0f4495d5e Change parse_type macros to be sed-friendly.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2259 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-17 00:30:52 +00:00
zwelch
d579befc07 Add argument parsing errors in command.h, use in parse_type routines.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2258 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-17 00:30:44 +00:00
zwelch
0e28997989 Move definition of parse_type helpers to command.c:
- Add declarations in header file.
- Improve wrapper implementations to check for underflow.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2257 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-17 00:30:36 +00:00
zwelch
06a1bb335e Convert core parse_type implementations to check for underflow errors.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2256 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-17 00:30:29 +00:00
zwelch
a830197f59 Add improved support for parsing signed integers.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2255 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-17 00:30:20 +00:00
zwelch
a3ec1e1f94 Update parse_type macro definitions to allow re-use with signed types.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2254 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-17 00:30:11 +00:00
zwelch
8b16068941 Improve definitions of parse_ulong and parse_ullong:
- Use macro to eliminate duplicate body definitions.
- Rename okay as is_okay; add parenthesis to help "clarify" logic.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2253 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-17 00:29:56 +00:00
oharboe
588a17da43 fix eCos build problems w/latest parse_ulong() stuff
git-svn-id: svn://svn.berlios.de/openocd/trunk@2241 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-15 14:22:13 +00:00
zwelch
cdd8f23b9b David Brownell <david-b@pacbell.net>:
Currently the "debug_level 3" command tracing ignores commands
that could return values to TCL scripts (by plugging in to a
slightly lower level of the interpreter stack).

Fix that by abstracting the tracing command and starting to
make some of those previously-untraced commands use this new
mechanism.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2224 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-12 22:06:02 +00:00
zwelch
0f6a47837e Simplify and improve handle_debug_level_comamnd:
- Bug fix: Return a syntax error if more than one argument is given.
- Bug fix: Use new parse_uint helper ensure debug_level parses correctly.
- Change: Display the debug_level after it has been set.
- Simplify bounds checking of debug_level.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2208 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-12 01:39:57 +00:00
zwelch
5af1bdcff4 Simplify handle_sleep_command:
- Use new parse_ulong to ensure duration parses as a valid number.
- Rework logic to improve readability and seliminate uperfluous braces.
- Change whitespace to improve style.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2207 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-12 01:39:51 +00:00
zwelch
5c123481a1 Add new parse_uinttype wrappers for strtoul in src/helper/command.[ch].
- Used to improve command argument parsing of unsigned integers values.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2206 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-12 01:39:44 +00:00
zwelch
5bb0f1d29a David Brownell <david-b@pacbell.net>:
Minor bugfix:  command_print_sameline() is what the
headers declare; make the code match.

Minor improvement:  make the printf format params always be const.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2205 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-11 21:55:43 +00:00
oharboe
1b2c1c6ff0 fix ordering of arguments to fwrite()
git-svn-id: svn://svn.berlios.de/openocd/trunk@2197 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-11 13:00:08 +00:00
zwelch
00228aa839 Fix make maintainer-clean for out-of-tree builds.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2172 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-09 10:28:16 +00:00
zwelch
695c6c0960 David Brownell <david-b@pacbell.net>:
Let disabled targets be ignored during normal operation:

 - In target_examine(), ignore disabled TAPs

 - Reset handling must not poke at them either:
     * fail $target_name arp_* operations on disabled TAPs
     * in startup.tcl, don't even issue the arp_* wait ops 

ZW: removed superfluous braces from the patch to target.c.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2100 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-07 23:35:29 +00:00
oharboe
aee65603ee remove hacks no longer required to build OpenOCD w/eCos
git-svn-id: svn://svn.berlios.de/openocd/trunk@2074 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-05 06:43:09 +00:00
oharboe
3b3a5b642c remove unused include file: inttypes.h
git-svn-id: svn://svn.berlios.de/openocd/trunk@2072 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-05 06:41:54 +00:00
zwelch
9a5acdc161 Improve in-source documentation that was causing Doxygen warnings.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2025 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-03 04:37:51 +00:00
oharboe
cd5e09303c more missing eCos types
git-svn-id: svn://svn.berlios.de/openocd/trunk@2001 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-02 10:07:47 +00:00
zwelch
e8e0af3956 Whitespace-only updates to automake input files:
- use continuations to break long lines of variable assignments
- makes these variables more patch-friendly and conform to style guide


git-svn-id: svn://svn.berlios.de/openocd/trunk@1970 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-31 12:10:57 +00:00
kc8apf
35d8b2bf77 Author: Nicolas Pitre <nico@cam.org>
- Silence errors about keep_alive() not being called frequently enough unless
	a gdb session is active or debugging is enabled


git-svn-id: svn://svn.berlios.de/openocd/trunk@1933 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-27 20:30:17 +00:00
zwelch
dd86b54e6e Update build system to find moved scripts -- Step 3 of 2:
- Update references from using PKGLIBDIR to PKGDATADIR.
- Update built-in script search paths to reflect new install location:
  - $(pkgdatadir)       =>   $(pktdatadir)/site
  - $(pkglibdir)        =>   $(pktdatadir)/scripts
- Update installed location of httpd files:
  - $(pkglibdir)/httpd   =>   $(pkgdatadir)/httpd


git-svn-id: svn://svn.berlios.de/openocd/trunk@1920 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-27 07:49:58 +00:00
zwelch
2e55b68360 David Brownell <david-b@pacbell.net>:
The "Illegal mode for command" diagnostic is deeply useless.
Say "Command '%s' only runs during configuration stage" instead,
letting users know what the real issue is.


git-svn-id: svn://svn.berlios.de/openocd/trunk@1908 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-24 20:57:53 +00:00
oharboe
2f8c6015ba delete unused code
git-svn-id: svn://svn.berlios.de/openocd/trunk@1878 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-21 17:44:04 +00:00
oharboe
576b8a8a48 fix warning. Use %p for pointers
git-svn-id: svn://svn.berlios.de/openocd/trunk@1877 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-21 17:42:19 +00:00
zwelch
08c11a4c70 Additional format warning fixes in ioutil, required by r1873 changes.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1874 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-21 09:49:19 +00:00
zwelch
570631454d David Brownell <david-b@pacbell.net>: This patch adds annotations to
the key command_*() helper functions, fixng the bugs that turned up.

Several of these bugs were from misuse of PRIi64; that's for 64-bit
integers, NOT for "long long" or "u64" (which work best with %lld).


git-svn-id: svn://svn.berlios.de/openocd/trunk@1873 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-21 09:28:57 +00:00
oharboe
208fda15d5 fix warnings
git-svn-id: svn://svn.berlios.de/openocd/trunk@1837 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-19 14:36:04 +00:00
oharboe
a8daf2251d Remove unecessary(and poptentially harmful?) "" around arguments
passed in to "eval" in command.c


git-svn-id: svn://svn.berlios.de/openocd/trunk@1811 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-18 13:55:38 +00:00
oharboe
7eaed436c6 less weird error messages for unknown commands. Check if command exists before trying it.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1810 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-18 13:07:37 +00:00
zwelch
ea3ddc7e4f Initialize a more variables in jim.c to allow gcc-4.4 to build.
Fix provided by Benjamin Schmidt <DeMonk@gmx.net>.


git-svn-id: svn://svn.berlios.de/openocd/trunk@1797 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-15 23:35:27 +00:00
zwelch
5cff9997c5 Initialize value of objPtr local variable; prevents warning w/ gcc-4.4.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1796 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-15 22:10:32 +00:00
oharboe
21c8284233 fix -fno-common/Mac build problems.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1795 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-15 21:10:35 +00:00
oharboe
4dcd58724a Less wrong handling of JIM_EMBEDDED, follow Jim Tcl doc's and only use JIM_EMBEDDED in a single .c file. Still broken w/-fno-common(i.e. Mac OS).
git-svn-id: svn://svn.berlios.de/openocd/trunk@1794 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-15 20:35:53 +00:00
oharboe
b9522f0e78 revert to 1775. 1790 causes SEGFAULT w/Cygwin.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1793 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-15 09:03:52 +00:00
zwelch
789b639a39 Remove JIM_EMBEDDED symbol; not appropriate or necessary.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1790 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-14 22:20:00 +00:00
zwelch
9c2468eee4 Include types.h in command.h to make stdint.h available through it.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1775 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-13 10:50:32 +00:00
oharboe
0ecb96cc1b move eCos type definition to types.h where it belongs.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1766 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-12 12:16:31 +00:00
zwelch
46d13ccc3b Add stdint.h to types.h to provide intptr_t.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1765 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-12 10:52:01 +00:00
ntfreak
14f3548ff2 - fix build issue when HAVE_ELF_H is not defined
git-svn-id: svn://svn.berlios.de/openocd/trunk@1764 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-12 10:47:48 +00:00
oharboe
75f89c5cb6 eCos fixes
git-svn-id: svn://svn.berlios.de/openocd/trunk@1763 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-12 10:02:47 +00:00
zwelch
f976af56a4 Audit and remove redundant uses of replacements.h in the tree.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1761 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-12 08:35:17 +00:00
zwelch
dd85eebf22 Make system.h private by including it from config.h autoheader.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1759 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-12 08:24:47 +00:00
zwelch
85f9734103 Audit and reduce #include directives in jim source files.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1758 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-12 07:44:57 +00:00
zwelch
4c71ca6b5f Define _GNU_SOURCE in config.h, remove definitions from source files.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1757 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-12 07:35:00 +00:00
zwelch
61cba7e0e6 Remove config.h from types.h; all .c files are required to include it.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1756 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-12 07:22:07 +00:00
zwelch
30a17f0bb4 Include assert.h in system.h to promote tree-wide use of assertions.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1750 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-12 04:52:15 +00:00
zwelch
ce23eb7e3a Update jim helper files to use proper configure script support:
- configure.in: Add AC_TYPE_LONG_LONG_INT to detect 'long long int' support.
- configure.in: Add AC_C_CONST to provide equivalent support as jim.h.
- jim*.c: include config.h when HAVE_CONFIG_H is defined.
- jim*.{h,c}: use HAVE_LONG_LONG_INT definition from config.h.
- jim.h: Remove hard-coded const and HAVE_LONG_LONG definitions.
- jim.h: -DJIM_NO_CONST has been obsoleted; -Dconst is equivalent.


git-svn-id: svn://svn.berlios.de/openocd/trunk@1744 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-11 11:20:45 +00:00
oharboe
dda225b7b3 leave eCos include file issues alone for now.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1723 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-11 07:26:11 +00:00
zwelch
6411b69af9 Mark API layering violations in the helper module with @todo notes.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1718 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-11 05:50:21 +00:00
zwelch
e2598f06fd Remove redundant config.h from replacements.h, obtained from types.h.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1717 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-11 05:33:39 +00:00
zwelch
8a5b25790f Audit and eliminate redundant helper #include directives.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1706 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-11 03:59:02 +00:00
zwelch
5a818f71d7 Simplify #include directives in ioutil.c, use new header checks.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1705 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-11 03:48:32 +00:00
zwelch
6a8583ebc4 Add --enable-malloc-logging configure option and update log.c to match.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1703 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-11 03:35:25 +00:00
zwelch
af7cdfd82b Factor system #includes out of replacements.h into new system.h.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1702 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-11 02:52:00 +00:00
zwelch
4e7ec08939 Finish portability support for AC_HEADER_STDBOOL configure macro.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1701 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-11 02:29:53 +00:00
zwelch
490e271290 Remove redundant sys/types.h #include directives (now in types.h).
git-svn-id: svn://svn.berlios.de/openocd/trunk@1700 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-11 02:27:16 +00:00
zwelch
eb6da244cb Add configure check for sys/types.h; include in our types.h.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1699 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-11 02:24:58 +00:00
zwelch
647e61cc6d Extend autotools build to create shared library libopenocd with libtool:
- Add libtoolize step too bootstrap script; creates ltmain.sh script.
- Add AC_PROG_LIBTOOL to configure.in to add libtool support to build.
- Change Makefile.am library rules from static (_a) to libtool (_la).
- Install libopenocd.{la,so,a} in $(libdir); update openocd link rules.
- Extend MAINTAINERCLEANFILES in top-level Makefile.am to remove ltmain.sh.


git-svn-id: svn://svn.berlios.de/openocd/trunk@1695 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-10 22:03:57 +00:00
zwelch
104580e0bf Reverse revision 1691: all of its functionality has migrated elsewhere.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1694 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-10 21:33:53 +00:00
zwelch
72acdac71a Revive tclapi.c from r1650:
* Remove superfluous #include directives.
* Fix warnings and API usage to cure its bit rot.
* Build into libhelper library (for now).
Add tclapi.h to export tclapi_register_commands().
Register tclapi commands in openocd.c:setup_command_handler().



git-svn-id: svn://svn.berlios.de/openocd/trunk@1691 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-10 19:44:38 +00:00
oharboe
3ac5d073dc Michael Bruck <mbruck@digenius.de> use more const
git-svn-id: svn://svn.berlios.de/openocd/trunk@1687 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-10 12:55:16 +00:00
oharboe
79d515c347 Michael Bruck <mbruck@digenius.de> use more const
git-svn-id: svn://svn.berlios.de/openocd/trunk@1686 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-09 09:30:00 +00:00
zwelch
f2676adb3c Fix typo from hurrying the last commit. Nothing to see here.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1662 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-08 05:33:08 +00:00
zwelch
6d60d22687 Fix loadFile to return file length once again.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1661 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-08 05:30:37 +00:00
zwelch
1000674d1c Fix warnings in ioutil.c; improves loadFile inteface.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1658 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-08 04:46:00 +00:00
zwelch
b36db3036c Remove unreferenced tcpapi.c source file.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1655 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-07 22:59:20 +00:00
zwelch
4b127e229b Fix pointer cast alignment warnings in jim.c.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1620 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-06 21:21:18 +00:00
zwelch
7e50a39773 Add autoconf check to determine where environ should be declared.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1610 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-06 07:17:57 +00:00
oharboe
4d88c124b1 retire out_mask - not used anywhere
git-svn-id: svn://svn.berlios.de/openocd/trunk@1608 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-06 06:20:52 +00:00
oharboe
e03658ee07 made warning about keep_alive() not being invoked more helpful
git-svn-id: svn://svn.berlios.de/openocd/trunk@1606 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-05 12:07:02 +00:00
oharboe
a83583e926 remove extra newline before prompt
git-svn-id: svn://svn.berlios.de/openocd/trunk@1605 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-05 12:06:26 +00:00
oharboe
1f378efbf0 Mariano Alvira <mar@devl.org> fixes warning as error about a signed vs. unsigned comparison by casting the local unsigned variable as (long long).
git-svn-id: svn://svn.berlios.de/openocd/trunk@1600 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-04 11:03:40 +00:00
kc8apf
53b7ce5b22 Fix environ declaration for non-glibc systems
git-svn-id: svn://svn.berlios.de/openocd/trunk@1599 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-04 06:22:49 +00:00
oharboe
832af8c1b0 Backed out change to solve Mac OS compilation problems.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1597 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-03 20:21:32 +00:00
zwelch
6f449ff098 Fix compilation when HAVE_UNISTD_H is not defined.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1596 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-03 15:21:40 +00:00
oharboe
ca3d4db1e3 Piotr Esden-Tempski <piotr@esden.net> Mac OS X compile fixes
git-svn-id: svn://svn.berlios.de/openocd/trunk@1595 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-03 15:11:17 +00:00
zwelch
66add57aa5 Update autotools scripts to require automake 1.6. The configure.in script
already required autoconf 2.59 (circa 2006), so there is no reason to
support versions of automake older than 1.6 (circa 2002).

The first part of this patch upgrades the configure.in script:

     1. Use current calling conventions for the AC_INIT and
        AM_INIT_AUTOMAKE macros, bringing their usage up-to-date with
        the version of autoconf already specified by AC_PREREQ.
     2. Add AC_CONFIG_SRCDIR macro, required by new version of AC_INIT.
     3. Automatically enable all of automake's warnings except Makefile
        portability (which OpenOCD violates by using GNU make's $(wildcard)).
        [[ While automake has its own -Werror option, I did not enabled it
        due to existing warnings. ]]
     4. Add the missing AM_PROG_C_O check, required by the build rules for
        openocd.o in src/Makefile.am.
     5. Adjust version number to show progress toward the next release.
     6. Include a bug reporting e-mail address to direct users to this list.

This patch makes the following adjustments to the Makefile.am files:

     1. Update AUTOMAKE_OPTIONS to require automake version 1.6
     2. Rewrite all deprecated INCLUDES assignments as AM_CPPFLAGS
     3. Clean-up all AM_CPPFLAGS declarations to be patch-friendly.
     4. Remove vestigial references to $(all_includes)
     5. Remove erroneous references to @CPPFLAGS@ (only use AM_CPPFLAGS)
     6. Remove unused -I and -D directives in helper/, flash/, target/


git-svn-id: svn://svn.berlios.de/openocd/trunk@1591 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-02 22:35:02 +00:00
oharboe
e69b222d53 Zach Welch <zw@superlucidity.net> fix warnings
git-svn-id: svn://svn.berlios.de/openocd/trunk@1589 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-02 12:26:10 +00:00
zwelch
6f73d44fab Michael Bruck <mbruck@digenius.de>: use HAVE_UNISTD_H for environ decl.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1572 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-30 00:57:58 +00:00
zwelch
1de959ca1c Remove redundant declarations to allow building with -Wredundant-decls.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1560 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-29 01:43:01 +00:00
zwelch
55c39bae67 Add missing header files to fix C99 compatibility.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1559 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-29 00:33:35 +00:00
ntfreak
154d8241c9 - fix win32 build
git-svn-id: svn://svn.berlios.de/openocd/trunk@1555 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-28 13:40:06 +00:00
oharboe
70d80bba5a Zach Welch <zw@superlucidity.net> wrap _GNU_SOURCE defines
git-svn-id: svn://svn.berlios.de/openocd/trunk@1532 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-27 05:29:30 +00:00
ntfreak
5fbfbec86b - fix win32 build after svn 1511 changes
git-svn-id: svn://svn.berlios.de/openocd/trunk@1513 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-22 19:54:03 +00:00
mlu
f29b2da658 Fix str_to_buf problem, thanks Andy Chenee
git-svn-id: svn://svn.berlios.de/openocd/trunk@1505 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-22 10:09:15 +00:00
ntfreak
dcdf71c21b - fix signed/unsigned build errors under win32. Thanks Zach Welch <zw@superlucidity.net>
git-svn-id: svn://svn.berlios.de/openocd/trunk@1489 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-21 09:02:42 +00:00
ntfreak
9997362a2a - remove environ warning under win32 build
git-svn-id: svn://svn.berlios.de/openocd/trunk@1488 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-21 08:51:07 +00:00
oharboe
24243b2b7a Zach Welch <zw@superlucidity.net> fix unused return value warnings (2 of 4)
git-svn-id: svn://svn.berlios.de/openocd/trunk@1486 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-21 05:42:18 +00:00
oharboe
4f0bd8e8e1 Zach Welch <zw@superlucidity.net> fix -Wformat-security warnings (1 of 4)
git-svn-id: svn://svn.berlios.de/openocd/trunk@1481 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-21 05:33:47 +00:00
oharboe
40580e2d71 Zach Welch <zw@superlucidity.net> fix -Werror warnings
git-svn-id: svn://svn.berlios.de/openocd/trunk@1472 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-19 20:51:16 +00:00
mifi
0bba832713 The following patches was applied:
- openocd-flash-static-keyword-v3.patch
- openocd-lpc2000-fix-erase-obo.patch
- openocd-jlink-fix-sign-ptr-warn.patch
- openocd-wextra-etm.patch
- openocd-wextra-jtag.patch
- openocd-add-new-tap-symbols-v6.patch

Many thanks to  Zach Welch <zw(at)superlucidity.net>

git-svn-id: svn://svn.berlios.de/openocd/trunk@1462 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-18 10:08:13 +00:00
ntfreak
c13924e32c - remove build warnings
git-svn-id: svn://svn.berlios.de/openocd/trunk@1415 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-03-17 10:22:26 +00:00
duane
7a731eb637 Added HostOS variable
git-svn-id: svn://svn.berlios.de/openocd/trunk@1400 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-03-07 15:19:21 +00:00
oharboe
b7593457bc Holger Schurig <hs4233@mail.mn-solutions.de> fix warnings
git-svn-id: svn://svn.berlios.de/openocd/trunk@1375 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-02-18 07:39:20 +00:00
oharboe
2136238908 zy1000 1.49 snapshot
git-svn-id: svn://svn.berlios.de/openocd/trunk@1374 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-02-17 11:54:30 +00:00
kc8apf
e77ae9096a Use C89/C99/C++ compliant boolean types
git-svn-id: svn://svn.berlios.de/openocd/trunk@1370 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-02-10 18:21:17 +00:00
kc8apf
ab9dfffdb5 - Cable driver helper API courtesy of Dick Hollenbeck <dick@softplc.com>
- Formatting changes from uncrustify


git-svn-id: svn://svn.berlios.de/openocd/trunk@1366 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-02-03 05:59:17 +00:00
kc8apf
a79adf1383 Search path fixes for MinGW builds. Courtesy of Dimitar Dimitrov <dinuxbg@gmail.com>
git-svn-id: svn://svn.berlios.de/openocd/trunk@1358 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-01-23 07:07:02 +00:00
kc8apf
93180753be Fix 'make maintainer-clean' courtesy of Zach Welch <zw@superlucidity.net>
git-svn-id: svn://svn.berlios.de/openocd/trunk@1345 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-01-20 03:55:38 +00:00
oharboe
59ff8d24d8 moved ioutil init to the right spot: before config scripts
git-svn-id: svn://svn.berlios.de/openocd/trunk@1311 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-01-09 11:44:01 +00:00
ntfreak
ab87627c5c - add gdb pipe support to native win32 (--pipe option)
git-svn-id: svn://svn.berlios.de/openocd/trunk@1294 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-01-01 16:06:46 +00:00
oharboe
f4d82deb36 Uwe Hermann <uwe@hermann-uwe.de> One of them is fixing a few compiler warnings (see attached patch) and
likely also one (non-cosmetic) bug (the 'id_buff' change, which seems to
be a buffer overflow).

git-svn-id: svn://svn.berlios.de/openocd/trunk@1293 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-12-28 21:40:39 +00:00
duane
f7274784a2 Build Permutations with ftd2xx and libftdi addressed. Also added a new se of regression makefiles to build openocd in multiple ways
git-svn-id: svn://svn.berlios.de/openocd/trunk@1275 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-12-27 01:15:50 +00:00
oharboe
6d3c1cd972 httpd wip
git-svn-id: svn://svn.berlios.de/openocd/trunk@1268 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-12-22 15:02:09 +00:00
oharboe
ee94947ffe cygwin fixes
git-svn-id: svn://svn.berlios.de/openocd/trunk@1266 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-12-22 10:28:11 +00:00
oharboe
ca805a472c Dick Hollenbeck <dick@softplc.com> better logging
git-svn-id: svn://svn.berlios.de/openocd/trunk@1262 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-12-19 19:40:38 +00:00
oharboe
865c5dcc2a Dick Hollenbeck <dick@softplc.com> better comments
git-svn-id: svn://svn.berlios.de/openocd/trunk@1261 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-12-19 14:48:00 +00:00
ntfreak
9d1f95e01a - fix rlink build under native win32 (mingw)
- remove rlink build warnings
- add usb_set_configuration to rlink_init, win32 requires this
- add win32 ETIMEDOUT define

git-svn-id: svn://svn.berlios.de/openocd/trunk@1260 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-12-19 13:58:15 +00:00
oharboe
e2c2b2d926 Dick Hollenbeck <dick@softplc.com> convert macros to inline fn's.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1259 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-12-19 06:49:34 +00:00
oharboe
bb56339761 houskeeping
git-svn-id: svn://svn.berlios.de/openocd/trunk@1255 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-12-17 13:39:40 +00:00
oharboe
439a187ea1 sync up to latest jim tcl
git-svn-id: svn://svn.berlios.de/openocd/trunk@1250 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-12-16 21:10:06 +00:00
oharboe
498c87bf02 fix broken -c/f options where it would silently terminate for scripts that did not set the return value.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1246 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-12-16 10:22:24 +00:00
ntfreak
0748b5ad4c - add missing svn props from r1243 commit
git-svn-id: svn://svn.berlios.de/openocd/trunk@1245 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-12-15 16:10:18 +00:00
oharboe
a98e1094a0 sync up to tap_xxx rename + add with-ioutil for standalone openocd implemetnations
git-svn-id: svn://svn.berlios.de/openocd/trunk@1243 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-12-15 11:32:22 +00:00
ntfreak
47d0449347 - add ability for openocd to communicate to gdb using pipes (stdin/stdout).
- 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-15 09:43:26 +00:00
ntfreak
0cba0d4df3 - remove target specific variant and use target->variant member
- 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
2008-12-13 12:44:39 +00:00
ntfreak
00b3eb5fed - fix illegal memory access in unregister_command function
git-svn-id: svn://svn.berlios.de/openocd/trunk@1224 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-12-10 17:47:16 +00:00
oharboe
b1cf5423ef "Theodore A. Roth" <taroth@gmail.com> fixes to distcheck
git-svn-id: svn://svn.berlios.de/openocd/trunk@1199 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-12-01 19:55:55 +00:00
duane
a28eaa85f7 jtag newtap change & huge manual update
git-svn-id: svn://svn.berlios.de/openocd/trunk@1194 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-11-30 22:25:43 +00:00
oharboe
3a636951eb Rick Altherr <kc8apf@kc8apf.net> retire obsolete syntax
git-svn-id: svn://svn.berlios.de/openocd/trunk@1190 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-11-27 14:58:49 +00:00
oharboe
6e2e706d7e friendlier error messages
git-svn-id: svn://svn.berlios.de/openocd/trunk@1185 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-11-26 13:42:02 +00:00
oharboe
ded28546f8 Fixes (more or less) random SEGFAULT upon invoking script_command().
git-svn-id: svn://svn.berlios.de/openocd/trunk@1156 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-11-11 14:47:01 +00:00
oharboe
3de3de0b37 execute reset init upon power restore / srst deassert
git-svn-id: svn://svn.berlios.de/openocd/trunk@1150 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-11-10 10:16:13 +00:00
oharboe
0bbe570882 minor cleanup
git-svn-id: svn://svn.berlios.de/openocd/trunk@1149 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-11-10 08:33:03 +00:00
oharboe
71c7306885 fix telnet async messages. retired telnet_async command - no user serviceable parts inside.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1135 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-11-05 08:48:50 +00:00
oharboe
c7e9d09e96 cpu help command wip
git-svn-id: svn://svn.berlios.de/openocd/trunk@1131 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-11-04 11:08:19 +00:00
oharboe
199ebae564 Rick Altherr <kc8apf@kc8apf.net> - fix warnings
git-svn-id: svn://svn.berlios.de/openocd/trunk@1126 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-11-03 07:22:14 +00:00
oharboe
c2120ba28a Added telnet_async command to enable/disable asynchronous
messages.

git-svn-id: svn://svn.berlios.de/openocd/trunk@1117 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-10-31 13:40:02 +00:00
oharboe
63ac444ba9 Kees Jongenburger <kees.jongenburger@gmail.com> - fix typo
git-svn-id: svn://svn.berlios.de/openocd/trunk@1106 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-10-27 20:56:58 +00:00
oharboe
edfca66467 now compiles under Cygwin and eCos again.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1102 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-10-27 07:32:09 +00:00
ntfreak
88c940c4b8 - fix native mingw build if gettimeofday not defined.
- reformat whitespace in startup.tcl

git-svn-id: svn://svn.berlios.de/openocd/trunk@1101 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-10-24 15:53:22 +00:00