- 01 Dec, 2009 11 commits
-
-
Zachary T Welch authored
Adds 'interp' field to command_context, chasing the few remaining references to the global variable outside of the command module.
-
Zachary T Welch authored
Adds 'interp' to target_event_action structure to avoid using the global variable of the same name.
-
Zachary T Welch authored
Adds 'interp' field to jtag_tap_event_action structure to avoid using the global variable of same name.
-
Zachary T Welch authored
Splits the old help strings to provide proper usage as well.
-
Zachary T Welch authored
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.
-
Zachary T Welch authored
Somehow, the comment block for command handlers ended up associated with the output_handler. Move it to the command_handler_t declaration.
-
Zachary T Welch authored
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.
-
Zachary T Welch authored
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.
-
Zachary T Welch authored
Adds 'noinit' command to prevent OpenOCD from running 'init' at the end up startup, allowing it to be given from telnet or TCL. This provides the old behavior by default, and users can add this command to their scripts to get the new behavior.
-
Zachary T Welch authored
Moves the telnet and TCL server startup to server_init(), moving their respective command registration in to server_register_commands(). Adds proper error checking for these particular startup processes. Moves the core server startup to openocd_main(), improving related error checking and preparing to defer 'init'.
-
Zachary T Welch authored
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).
-
- 30 Nov, 2009 1 commit
-
-
Øyvind Harboe authored
Add missing COMMAND_REGISTRATION_DONE. For now the command syntax for zy1000 needs to be compatible across 0.3/0.4, the world outside OpenOCD interfaces to zy1000 using the old syntax. Post 0.4 release(0.4.1 even) I'll switch to subcommand scheme. Switch to subcommands post 0.3 lifecycle. Signed-off-by:
Øyvind Harboe <oyvind.harboe@zylin.com>
-
- 29 Nov, 2009 7 commits
-
-
David Brownell authored
Streamline the loop by continuing as soon as we know there's no work to be done; this lets us un-indent almost everything. Signed-off-by:
David Brownell <dbrownell@users.sourceforge.net>
-
David Brownell authored
When fetching all the registers, XScale was doing various stupid things like calling number_to_mode() a few dozen times instead of just once, and mapping access to each register three times (again, instead of just once). Stop that. Signed-off-by:
David Brownell <dbrownell@users.sourceforge.net>
-
David Brownell authored
Use the new mapping interfaces in the debug entry path. SPSR and the banked registers now have smaller and faster accessors ... use them. Signed-off-by:
David Brownell <dbrownell@users.sourceforge.net>
-
Marek Vasut authored
[dbrownell@users.sourceforge.net; remove pxa255 comment] Signed-off-by:
David Brownell <dbrownell@users.sourceforge.net>
-
Marek Vasut authored
[dbrownell@users.sourceforge.net: user's guide; variant param is optional] Signed-off-by:
David Brownell <dbrownell@users.sourceforge.net>
-
David Brownell authored
Previous version of JTAG_DEBUG() macro hid this bug. Signed-off-by:
David Brownell <dbrownell@users.sourceforge.net>
-
David Brownell authored
Code other than main() may invoke "init". When it does so, customized handlers may need to run ... so make sure the command context state is updated before they do so. Signed-off-by:
David Brownell <dbrownell@users.sourceforge.net>
-
- 28 Nov, 2009 21 commits
-
-
lementec fabien authored
Returns the common structure for the s3c24xx device, which was somehow nuked during past cleaning efforts.
-
David Brownell authored
Those commands presume support for the "classic" set of CPU modes (FIQ, supervisor, IRQ, etc) ... which aren't supported by the ARMv7-M or ARMv6-M architectures. They also presume a "struct arm" base type, which this code doesn't use. We haven't cleaned up the register handling enough to be able to share any of those "base" methods. Signed-off-by:
David Brownell <dbrownell@users.sourceforge.net>
-
Zachary T Welch authored
The nonce NAND driver provides a no-op implementation useful for testing the system independently of any driver side-effects.
-
Zachary T Welch authored
Prevent everything from crashing when exercising various commands.
-
Zachary T Welch authored
Eliminate the monolithic tcl_target_func by registering each of its commands using the new chained command registration mechanism. Also chains the target's commands under the CPU command, though these may not work properly without some further modification.
-
Zachary T Welch authored
The 'target' command group was implemented using its own command dispatching, which can be eliminated by using the new chained command registration mechanism. This patch splits the jim_target() function into individual handlers, which makes them to be visible to the help and usage commands. These one-trick handlers are much easier to understand.
-
Zachary T Welch authored
Moves the ID and IR-related option parsing to static helpers, removing two levels of indent.
-
Zachary T Welch authored
Splits bulk of the jtag_tap_configure into jtag_tap_configure_event, removing three or four levels of indentation in the process. The resulting code was stylistically improved in other ways, but it should be functionally identical.
-
Zachary T Welch authored
Use 'continue' to reduce identation levels and superfluous logic.
-
Zachary T Welch authored
Moves the tertiary jim handlers and required static helpers to the top of tcl.c, defining them in a new registration array that is chained in both the top-level context and under the jtag command. The top-level commands can be removed at some point in the future to reduce clutter.
-
Zachary T Welch authored
Explodes the 'jtag' into separate command handlers, which are easier to understand and extend. Makes the code much easier to understand, though further simplifications are possible. This patch tries to minimize the noise when viewed with 'git diff -w'. Gives these commands improved built-in help and usage information.
-
Zachary T Welch authored
Two 'rm' commands were implemented and registered. This removes the version that would have never been called prior to refactoring the command registration.
-
Zachary T Welch authored
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.
-
Zachary T Welch authored
Extends the help output to list the valid modes for each commands. Fixes a memory leak of the returned command_name() string.
-
Zachary T Welch authored
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.
-
Zachary T Welch authored
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.
-
Zachary T Welch authored
Allows scripts to behave different depending on the current mode. Also allows introspection of the mode required for commands.
-
Zachary T Welch authored
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.
-
Zachary T Welch authored
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.
-
Zachary T Welch authored
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).
-
David Brownell authored
Previous version of JTAG_DEBUG() macro hid this bug. Signed-off-by:
David Brownell <dbrownell@users.sourceforge.net>
-