Re: [Openocd-development] [patch/rfc] ETM: don't be ARM7/ARM9-specific

2009-11-11 Thread David Brownell
On Wednesday 11 November 2009, David Brownell wrote: > Framework updates to provide ETM access on ARM cores other > than the current set of just ARM7 and ARM9 based cores: The only real comment was to split it into smaller chunks, so that's what I did ... it's merged now, in five chunks.

Re: [Openocd-development] Methods on targets

2009-11-11 Thread Øyvind Harboe
On Thu, Nov 12, 2009 at 12:14 AM, David Brownell wrote: > On Wednesday 11 November 2009, Řyvind Harboe wrote: >> > And what happened to that more standard Tcl model I mentioned a >> > while back ... a series of interpreters, with the current target >> > object at the front of the series, and more

Re: [Openocd-development] Methods on targets

2009-11-11 Thread David Brownell
On Wednesday 11 November 2009, Zach Welch wrote: > > > On the other hand ... for big things, it's best to avoid > > turning fuzzy ideas into C.  There's a risk of tha fuzziness > > getting committed, and then getting hard to remove. > > Ah, but with git, it can be committed!  Refrain from pushing

Re: [Openocd-development] Methods on targets

2009-11-11 Thread David Brownell
On Wednesday 11 November 2009, Øyvind Harboe wrote: > > And what happened to that more standard Tcl model I mentioned a > > while back ... a series of interpreters, with the current target > > object at the front of the series, and more global stuff back at > > the end? > > I don't understand this

Re: [Openocd-development] Idea on embedded trace capability to use GDB

2009-11-11 Thread David Brownell
On Wednesday 11 November 2009, Øyvind Harboe wrote: > I must admit I have not read up on the embedded trace capability, > much, but one of the things that I've heard it can do is to > set a breakpoint and then capture the PC for N instructions > going forward. Depends on what you have hooked up to

Re: [Openocd-development] [PATCH] fix 'jtag interface' behavior

2009-11-11 Thread Zach Welch
Pushed on top of the command help cleanup series. --Z On Tue, 2009-11-10 at 23:22 -0800, Zachary T Welch wrote: > Without this patch, running "openocd -c 'jtag interface'" segfaults. > Now, it returns the string "undefined" when the interface is unset. > --- > Is there a better value that could b

Re: [Openocd-development] [PUSHED 5/5] improve command help

2009-11-11 Thread Zach Welch
On Wed, 2009-11-11 at 12:32 -0800, Zachary T Welch wrote: > This series begins to improve the built-in command help: > > * provides a full list of all registered commands, not just those that > define a handler function). > * allows arbitrary command nesting > * eliminates duplicate code, improv

Re: [Openocd-development] Methods on targets

2009-11-11 Thread Øyvind Harboe
On Wed, Nov 11, 2009 at 11:26 PM, David Brownell wrote: > On Wednesday 11 November 2009, Zach Welch wrote: >> Please restate this in the form of a problem that needs solving. >> You have stated a solution.  What was the original problem? >> Are there other possible solutions?  How does this solve

Re: [Openocd-development] Methods on targets

2009-11-11 Thread Zach Welch
On Wed, 2009-11-11 at 15:26 -0700, David Brownell wrote: > On Wednesday 11 November 2009, Zach Welch wrote: > > Please restate this in the form of a problem that needs solving. > > You have stated a solution. What was the original problem? > > Are there other possible solutions? How does this sol

Re: [Openocd-development] Methods on targets

2009-11-11 Thread David Brownell
On Wednesday 11 November 2009, Zach Welch wrote: > Please restate this in the form of a problem that needs solving. > You have stated a solution.  What was the original problem? > Are there other possible solutions?  How does this solve it better than > other alternatives? And what happened to tha

Re: [Openocd-development] Serial Wire Debug and git

2009-11-11 Thread Zach Welch
On Wed, 2009-11-11 at 21:32 +, Andrew Rogers wrote: > Hi All, > > I am working a few hours a week trying to get SWD working for the STM32 > Primer2 (R-Link interface). I am happy making changes to the source code > to accomplish this. The problem is that my changes span many files > because Op

Re: [Openocd-development] Methods on targets

2009-11-11 Thread Øyvind Harboe
On Wed, Nov 11, 2009 at 11:00 PM, Zach Welch wrote: > On Wed, 2009-11-11 at 21:49 +0100, Øyvind Harboe wrote: >> Here is an idea: >> >> make mdw/mww family of commands a method on the >> target. >> >> foo.cpu mdw => returns array >> >> write a small mdw proc in Tcl that invokes the above method >>

Re: [Openocd-development] Serial Wire Debug and git

2009-11-11 Thread David Brownell
On Wednesday 11 November 2009, Andrew Rogers wrote: > Hi All, > > I am working a few hours a week trying to get SWD working for the STM32 > Primer2 (R-Link interface). I am happy making changes to the source code > to accomplish this. The problem is that my changes span many files > because OpenOC

[Openocd-development] Serial Wire Debug and git

2009-11-11 Thread Andrew Rogers
Hi All, I am working a few hours a week trying to get SWD working for the STM32 Primer2 (R-Link interface). I am happy making changes to the source code to accomplish this. The problem is that my changes span many files because OpenOCD is pretty well married up to JTAG. I am taking the opportunity

Re: [Openocd-development] Methods on targets

2009-11-11 Thread Zach Welch
On Wed, 2009-11-11 at 21:49 +0100, Øyvind Harboe wrote: > Here is an idea: > > make mdw/mww family of commands a method on the > target. > > foo.cpu mdw => returns array > > write a small mdw proc in Tcl that invokes the above method > on the currently active target. > > Consider the mrc/mcr ca

Re: [Openocd-development] [PATCH 0/5] improve command help

2009-11-11 Thread Øyvind Harboe
On Wed, Nov 11, 2009 at 10:47 PM, Zach Welch wrote: > On Wed, 2009-11-11 at 21:40 +0100, Øyvind Harboe wrote: >> On Wed, Nov 11, 2009 at 9:32 PM, Zachary T Welch >> wrote: >> > This series begins to improve the built-in command help: >> > >> > * provides a full list of all registered commands, n

Re: [Openocd-development] [PATCH 5/5] improve command registration

2009-11-11 Thread Zach Welch
On Wed, 2009-11-11 at 13:54 -0700, David Brownell wrote: > On Wednesday 11 November 2009, Zachary T Welch wrote: > > + for (cc = *head; cc && cc->next; cc = cc->next) ; > > Style point: such unadorned empty statements are worth avoiding. > They're not quickly apparent when scanning code ...

Re: [Openocd-development] [PATCH 0/5] improve command help

2009-11-11 Thread Zach Welch
On Wed, 2009-11-11 at 21:40 +0100, Øyvind Harboe wrote: > On Wed, Nov 11, 2009 at 9:32 PM, Zachary T Welch > wrote: > > This series begins to improve the built-in command help: > > > > * provides a full list of all registered commands, not just those that > > define a handler function). > > * al

Re: [Openocd-development] [patch] finish removing deprecated/obsolete commands

2009-11-11 Thread David Brownell
On Tuesday 10 November 2009, Jonas Horberg wrote: > I do not know why you belive that jtag_speed is a NOP for parport > interfaces. Perhaps it is by code inspection and the following > nasty thing confused you: Right; looking more closely, I see how it did its thing. So we'll be wanting that parp

[Openocd-development] Idea on embedded trace capability to use GDB

2009-11-11 Thread Øyvind Harboe
I must admit I have not read up on the embedded trace capability, much, but one of the things that I've heard it can do is to set a breakpoint and then capture the PC for N instructions going forward. The trick is how to present that in a GUI Could we modify the GDB server to be able to "step

Re: [Openocd-development] [PATCH 5/5] improve command registration

2009-11-11 Thread David Brownell
On Wednesday 11 November 2009, Zachary T Welch wrote: > +   for (cc = *head; cc && cc->next; cc = cc->next) ; Style point: such unadorned empty statements are worth avoiding. They're not quickly apparent when scanning code ... either their presence or their absence. That translates to being

[Openocd-development] Methods on targets

2009-11-11 Thread Øyvind Harboe
Here is an idea: make mdw/mww family of commands a method on the target. foo.cpu mdw => returns array write a small mdw proc in Tcl that invokes the above method on the currently active target. Consider the mrc/mcr case. If we treat it in the same way, then we're in "c land" when we're trying t

[Openocd-development] [patch/rfc] ETM: don't be ARM7/ARM9-specific

2009-11-11 Thread David Brownell
Framework updates to provide ETM access on ARM cores other than the current set of just ARM7 and ARM9 based cores: - Rename "struct armv4_5_common_s" as "struct arm". It needs a bit more work to be properly generic, but it's the best start we have at that today. - In "struct arm" provide

Re: [Openocd-development] [PATCH 0/5] improve command help

2009-11-11 Thread Øyvind Harboe
On Wed, Nov 11, 2009 at 9:32 PM, Zachary T Welch wrote: > This series begins to improve the built-in command help: > > * provides a full list of all registered commands, not just those that >  define a handler function). > * allows arbitrary command nesting What does this mean? Shouldn't we move

[Openocd-development] [PATCH 5/5] improve command registration

2009-11-11 Thread Zachary T Welch
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. Signed-off-by: Zachary T Welch --- src/helper/command.c | 75 + 1

[Openocd-development] [PATCH 4/5] add help regardless of callback

2009-11-11 Thread Zachary T Welch
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 paren

[Openocd-development] [PATCH 2/5] add command_name helper

2009-11-11 Thread Zachary T Welch
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. Signed-off-by: Zachary T Welch --- src/he

[Openocd-development] [PATCH 1/5] wrap help command

2009-11-11 Thread Zachary T Welch
Use continuation characters to wrap the help command into 80 columns. Signed-off-by: Zachary T Welch --- src/helper/startup.tcl | 26 +- 1 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/helper/startup.tcl b/src/helper/startup.tcl index 2c90972..73c4cf

[Openocd-development] [PATCH 3/5] eliminate duplicate helptext management

2009-11-11 Thread Zachary T Welch
Add helpers to manage adding entries to the helptext list. Adds support for arbitrarily nested commands. Signed-off-by: Zachary T Welch --- src/helper/command.c | 61 - 1 files changed, 30 insertions(+), 31 deletions(-) diff --git a/src/helper/c

[Openocd-development] [PATCH 0/5] improve command help

2009-11-11 Thread Zachary T Welch
This series begins to improve the built-in command help: * provides a full list of all registered commands, not just those that define a handler function). * allows arbitrary command nesting * eliminates duplicate code, improves error checking, fixes wrapping Based on the current master, though

Re: [Openocd-development] [PUSHED 10/10] random cleaning in the tree

2009-11-11 Thread Zach Welch
On Wed, 2009-11-11 at 06:11 -0800, Zachary T Welch wrote: > These patches perform a bunch of random cleanups that fell out of > the next series. I have pushed these patches to SF.net, except I got an error from the post-commit hook: sendmail: Could not find password entry for UID 15 error:

Re: [Openocd-development] [PATCH 10/20] nand: add NAND_DEVICE_COMMAND_HANDLER macro

2009-11-11 Thread Zach Welch
On Wed, 2009-11-11 at 12:09 -0700, David Brownell wrote: > On Wednesday 11 November 2009, Zachary T Welch wrote: > > - nand->controller_priv = info; > > + device->controller_priv = info; > > Given there are so many different devices involved, > it's better to use descriptive names ("na

Re: [Openocd-development] [PATCH 02/20] add COMMAND_HANDLER and COMMAND_HELPER macros

2009-11-11 Thread Zach Welch
On Wed, 2009-11-11 at 12:04 -0700, David Brownell wrote: > > +#define CALL_COMMAND_HANDLER(name, extra...) \ > > + name(cmd_ctx, cmd, args, argc, ##extra) > > That one I don't like. It relies on lexical capture > for most parameters, and doesn't even use "name". name is right up there

Re: [Openocd-development] Openocd config files for Omap-l137 and Omap-l138

2009-11-11 Thread David Brownell
On Wednesday 11 November 2009, Balbir Singh Dhanoa wrote: > > Hi, > > Does anyone know if Openocd configuration files exist for the > OMAP-L137 and OMAP-L138. I don't believe anyone's posted such yet. They'd look much like the target/ti_dm6446.cfg file though ... key differences being they ha

Re: [Openocd-development] [PATCH 08/10] cortex_a8: remove declarations, use static keyword

2009-11-11 Thread Zach Welch
On Wed, 2009-11-11 at 11:57 -0700, David Brownell wrote: > Yeah, I like those patches ... as you could tell! :) > > The "static" stuff also lets the compiler generate more > compact code; it enables inlining and some broader-scoped > optimizations. And that's on top of making it clear that > suc

Re: [Openocd-development] [PATCH 06/10] change argv to args in command handlers

2009-11-11 Thread Zach Welch
On Wed, 2009-11-11 at 11:54 -0700, David Brownell wrote: > On Wednesday 11 November 2009, Zachary T Welch wrote: > > Subsequent patches expect all command handlers to use a uniform > > parameter naming scheme. In the entire tree, these two files used > > non-standard 'argv' instead of 'args'. Thi

Re: [Openocd-development] RFC: command handler restructuring

2009-11-11 Thread Zach Welch
On Wed, 2009-11-11 at 18:03 +, John Devereux wrote: > Zach Welch writes: > > > On Wed, 2009-11-11 at 08:40 +0100, Øyvind Harboe wrote: > >> I've read over the branch and improving types is always a good thing, > >> even if I don't have a specific opinions on whether to use > >> unsigned or in

Re: [Openocd-development] [PATCH 10/20] nand: add NAND_DEVICE_COMMAND_HANDLER macro

2009-11-11 Thread David Brownell
On Wednesday 11 November 2009, Zachary T Welch wrote: > -   nand->controller_priv = info; > +   device->controller_priv = info; Given there are so many different devices involved, it's better to use descriptive names ("nand") not generic ones ("device"). __

Re: [Openocd-development] [PATCH 02/20] add COMMAND_HANDLER and COMMAND_HELPER macros

2009-11-11 Thread David Brownell
> +#define CALL_COMMAND_HANDLER(name, extra...) \ > + name(cmd_ctx, cmd, args, argc, ##extra) That one I don't like. It relies on lexical capture for most parameters, and doesn't even use "name". Lexical capture is one of the classic Things To Avoid for C macros ... a Dirty Trick, wh

Re: [Openocd-development] [PATCH 08/10] cortex_a8: remove declarations, use static keyword

2009-11-11 Thread David Brownell
Yeah, I like those patches ... as you could tell! :) The "static" stuff also lets the compiler generate more compact code; it enables inlining and some broader-scoped optimizations. And that's on top of making it clear that such-and-such a routine has no other callers. _

Re: [Openocd-development] [PATCH 06/10] change argv to args in command handlers

2009-11-11 Thread David Brownell
On Wednesday 11 November 2009, Zachary T Welch wrote: > Subsequent patches expect all command handlers to use a uniform > parameter naming scheme.  In the entire tree, these two files used > non-standard 'argv' instead of 'args'.  This patch reduces noise > required to unify all command handlers wi

Re: [Openocd-development] What's the best way to use OpenOCD with Eclipse?!

2009-11-11 Thread Dirk Behme
Thomas Kindler wrote: > Hi! > > Now that the reset problem is solved for me, I'm trying to optimize my > eclipse setup for my STM32 target. > > Basically, I'm using gnuarmeclipse.sf.net for project settings and > makefile generation, CodeSourcery Lite as the toolchain, and the > "Eclipse C/C++

[Openocd-development] Openocd config files for Omap-l137 and Omap-l138

2009-11-11 Thread Balbir Singh Dhanoa
Hi, Does anyone know if Openocd configuration files exist for the OMAP-L137 and OMAP-L138. I'm using - OMAP-L137 evm board from TI & Spectrum Digital Inc. - Zoom OMAP-L138 evm board from Logic. - Amontec JTAGKey2 and JTAGKey. I haven't found the config files yet, and have not received any inf

Re: [Openocd-development] RFC: command handler restructuring

2009-11-11 Thread John Devereux
Zach Welch writes: > On Wed, 2009-11-11 at 08:40 +0100, Øyvind Harboe wrote: >> I've read over the branch and improving types is always a good thing, >> even if I don't have a specific opinions on whether to use >> unsigned or int for iteration variables, etc. > > There is almost always a correct

[Openocd-development] [PATCH 09/10] remove more useless declarations

2009-11-11 Thread Zachary T Welch
Removes forward declarations by moving command registration after defintion of the command handlers. Signed-off-by: Zachary T Welch --- src/flash/lpc288x.c | 11 --- src/flash/mx3_nand.c | 47 --- src/pld/pld.c| 35 ++

[Openocd-development] [PATCH 18/20] add src/hello.c to augment new command tutorial

2009-11-11 Thread Zachary T Welch
The hello module provides the 'hello' command, printing a greetings to the command console. It can grow to serve as pedagogical example of services that OpenOCD developers should use: a runnable style guide. Signed-off-by: Zachary T Welch --- src/Makefile.am |4 ++- src/hello.c | 57 +

[Openocd-development] [PATCH 10/10] remove obsolete doxygen comments

2009-11-11 Thread Zachary T Welch
Documenting command handler parameters is redundant and pointless. Signed-off-by: Zachary T Welch --- src/flash/flash.h |6 -- src/flash/lpc2900.c | 44 +--- 2 files changed, 1 insertions(+), 49 deletions(-) diff --git a/src/flash/flash.h b/sr

[Openocd-development] [PATCH 14/20] command_handler_t: make argc unsigned

2009-11-11 Thread Zachary T Welch
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. Signed-off-by: Zachary T Welch --- src/flash/cfi.c |5 + src/flash/nand.c

[Openocd-development] [PATCH 19/20] add documention for writing built-in commands

2009-11-11 Thread Zachary T Welch
This documentation update provides an introduction to the command handling facilities provided by command.[ch]. A primer walks the user through the elements of a pointedly pedantic module: src/hello.c. A summary of the API is provided in the OpenOCD Architecture section. Signed-off-by: Zachary T

[Openocd-development] [PATCH 20/20] add command_name helper

2009-11-11 Thread Zachary T Welch
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 syntax errors. Signed-off-by: Zachary T Welch --- src/helper/command.c | 38 +++--- s

[Openocd-development] [PATCH 15/20] command_handler_t: make cmd parameter const

2009-11-11 Thread Zachary T Welch
Prevents the command name from being modified in command handlers. Again, this has cascading effects, but the patches are fairly minimal. Signed-off-by: Zachary T Welch --- src/helper/command.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/helper/command.h b/src/h

[Openocd-development] [PATCH 17/20] command_handler_t: make cmd an indirect parameter

2009-11-11 Thread Zachary T Welch
This patch removes 'cmd' from the list of direct parameters, moving that pointer to args[-1] (by way of the new COMMAND_NAME macro). Signed-off-by: Zachary T Welch --- src/helper/command.c | 16 +--- src/helper/command.h |6 +++--- 2 files changed, 12 insertions(+), 10 deletion

[Openocd-development] [PATCH 13/20] add COMMAND_NAME macro for command handlers

2009-11-11 Thread Zachary T Welch
By introducing the COMMAND_NAME macro, this parameter may be integrated as args[-1] in command.[ch], without touching any other call sites. Signed-off-by: Zachary T Welch --- src/flash/flash.c |2 +- src/helper/command.h |6 ++ src/jtag/tcl.c |2 +- src/target/arm7

[Openocd-development] [PATCH 12/20] use CALL_COMMAND_HANDLER instead of direct calls

2009-11-11 Thread Zachary T Welch
By using CALL_COMMAND_HANDLER, parameters can be reordered, added, or even removed in inherited signatures, without requiring revisiting all of the various call sites. Signed-off-by: Zachary T Welch --- src/flash/flash.c |3 ++- src/flash/nand.c |3 ++- src/jtag/tcl.c

[Openocd-development] [PATCH 16/20] command_handler_t: make args parameter const

2009-11-11 Thread Zachary T Welch
This patch prevents command handlers from modifying the strings passed in the 'args' array. Signed-off-by: Zachary T Welch --- src/helper/command.c | 10 ++ src/helper/command.h |2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/helper/command.c b/src/helper/

[Openocd-development] [PATCH 09/20] use FLASH_BANK_COMMAND_HANDLER macro

2009-11-11 Thread Zachary T Welch
Defines all flash_bank_command handlers using the new macro. Signed-off-by: Zachary T Welch --- src/flash/aduc702x.c |2 +- src/flash/at91sam3.c |7 +-- src/flash/at91sam7.c |2 +- src/flash/avrf.c |2 +- src/flash/cfi.c |2 +- src/flash/ecos.c |2 +

[Openocd-development] [PATCH 11/20] add PLD_DEVICE_COMMAND_HANDLER macro

2009-11-11 Thread Zachary T Welch
Update virtex module to use abstracted PLD command handling. Signed-off-by: Zachary T Welch --- src/pld/pld.h |7 ++- src/pld/virtex2.c |6 +++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/pld/pld.h b/src/pld/pld.h index 3db4bad..22f2c13 100644 --- a/src/

[Openocd-development] [PATCH 05/20] use COMMAND_HELPER for command helper functions

2009-11-11 Thread Zachary T Welch
Define the numerous helpers that inherit command handler parameters using the COMMAND_HELPER macro. Signed-off-by: Zachary T Welch --- src/server/server.c |3 +-- src/server/server.h | 12 ++-- src/target/arm11.c |5 ++--- src/target/etm.c|7 +++ src/target/target.

[Openocd-development] [PATCH 10/20] nand: add NAND_DEVICE_COMMAND_HANDLER macro

2009-11-11 Thread Zachary T Welch
Abstracts the extended NAND command handling to allow the function signature to be controlled by __COMMAND_HANDLER. Signed-off-by: Zachary T Welch --- src/flash/davinci_nand.c|6 ++ src/flash/lpc3180_nand_controller.c |2 +- src/flash/mx3_nand.c|4 +---

[Openocd-development] [PATCH 07/20] s3c24xx: use COMMAND_HANDLER with command helper

2009-11-11 Thread Zachary T Welch
Add S3C24XX_DEVICE_COMMAND macros to abstract common command handler conventions. Signed-off-by: Zachary T Welch --- src/flash/s3c2410_nand.c |6 +- src/flash/s3c2412_nand.c |6 +- src/flash/s3c2440_nand.c |6 +- src/flash/s3c2443_nand.c |6 +- src/flash/s3c24xx_n

[Openocd-development] [PATCH 02/20] add COMMAND_HANDLER and COMMAND_HELPER macros

2009-11-11 Thread Zachary T Welch
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

[Openocd-development] [PATCH 08/20] add FLASH_BANK_COMMAND_HANDLER macro

2009-11-11 Thread Zachary T Welch
The FLASH_BANK_COMMAND_HANDLER provides an extended command handler using the __COMMAND_HANDLER macro, whereby changing that macro is sufficient to update flash handlers with the new signature. It also enforces uniform style and scope when implementing this handler. Signed-off-by: Zachary T Welch

[Openocd-development] [PATCH 06/20] arm_adi, armv7[am]: use COMMAND_HELPER for helpers

2009-11-11 Thread Zachary T Welch
Rewrites the dap_* command helpers to use the COMMAND_HELPER paradigm. Uses CALL_COMMAND_HELPER to hide inherited calling conventions. Signed-off-by: Zachary T Welch --- src/target/arm_adi_v5.c | 12 src/target/arm_adi_v5.h | 15 +++ src/target/armv7a.c |8 ++

[Openocd-development] [PATCH 01/20] add command_output_handler_t

2009-11-11 Thread Zachary T Welch
Signed-off-by: Zachary T Welch --- src/helper/command.c |3 ++- src/helper/command.h | 11 --- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/helper/command.c b/src/helper/command.c index c632702..fb9faaa 100644 --- a/src/helper/command.c +++ b/src/helper/comma

[Openocd-development] [PATCH 03/20] add command_handler_t type

2009-11-11 Thread Zachary T Welch
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. Signed-off-by: Zachary T Welch --- src/helper/command.c |4 +++- src/helper/command.h |9

[Openocd-development] [PATCH 0/20] update command handlers

2009-11-11 Thread Zachary T Welch
This series systematically updates the command handlers signature: int (*foo)(cmd_ctx, cmd, args, argc) to int (*foo)(cmd_ctx, args, argc) It does this by unifying all definitions of the signature to a single location in command.h, using a set of relatively simple macros. It fil

[Openocd-development] [PATCH 08/10] cortex_a8: remove declarations, use static keyword

2009-11-11 Thread Zachary T Welch
Signed-off-by: Zachary T Welch --- src/target/cortex_a8.c | 188 +--- src/target/cortex_a8.h |6 -- 2 files changed, 82 insertions(+), 112 deletions(-) diff --git a/src/target/cortex_a8.c b/src/target/cortex_a8.c index 141b439..a8cb37d 100644 ---

[Openocd-development] [PATCH 07/10] add const keyword to some APIs

2009-11-11 Thread Zachary T Welch
Add 'const' keyword to 'char *' parameters to allow command handlers to pass constant string arguments. These changes allow the 'args' command handler to be changed to 'const' in a subsequent patch. Signed-off-by: Zachary T Welch --- src/flash/flash.c |2 +- src/flash/flash.h |2

[Openocd-development] [PATCH 05/10] script_debug(): improve types

2009-11-11 Thread Zachary T Welch
Use unsigned type for number of arguments. Signed-off-by: Zachary T Welch --- src/helper/command.c |8 src/helper/command.h |3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/helper/command.c b/src/helper/command.c index 2b8f646..c632702 100644 --- a/src/

[Openocd-development] [PATCH 03/10] log: improve log_callback_fn signature

2009-11-11 Thread Zachary T Welch
Use unsigned type for line number in log_callback_fn signature. Signed-off-by: Zachary T Welch --- src/helper/command.c |4 ++-- src/helper/log.h |2 +- src/server/gdb_server.c|4 ++-- src/server/telnet_server.c |2 +- 4 files changed, 6 insertions(+), 6 delet

[Openocd-development] [PATCH 06/10] change argv to args in command handlers

2009-11-11 Thread Zachary T Welch
Subsequent patches expect all command handlers to use a uniform parameter naming scheme. In the entire tree, these two files used non-standard 'argv' instead of 'args'. This patch reduces noise required to unify all command handlers with a single definition. Signed-off-by: Zachary T Welch ---

[Openocd-development] [PATCH 04/10] command.c: make private routines static

2009-11-11 Thread Zachary T Welch
This patch also improves the signature of run_command function. Signed-off-by: Zachary T Welch --- src/helper/command.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/helper/command.c b/src/helper/command.c index 5f3c88d..2b8f646 100644 --- a/src/helper/command

[Openocd-development] [PATCH 02/10] time_support: improve use of types

2009-11-11 Thread Zachary T Welch
Update timeval_add_time to use long int; implement timeval_add with it. Update timeval_ms to check gettimeofday return value, return int64_t. Signed-off-by: Zachary T Welch --- src/helper/time_support.c | 37 + src/helper/time_support.h |4 ++-- 2 files

[Openocd-development] [PATCH 01/10] makefiles: improve build order

2009-11-11 Thread Zachary T Welch
Separates various groups of files to be built in logical succession. In each layer, the core module (target.c, nand.c, etc.) is built _after_ their helper modules (e.g. image.c, nand_ecc.c) but _before_ any of their drivers (e.g. arm966e.c, mx3_nand.c). This allows problems introduced at the botto

[Openocd-development] [PATCH 0/10] random cleaning in the tree

2009-11-11 Thread Zachary T Welch
These patches perform a bunch of random cleanups that fell out of the next series. Cheers, Zach ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development

Re: [Openocd-development] RFC: command handler restructuring

2009-11-11 Thread Øyvind Harboe
On Wed, Nov 11, 2009 at 1:58 PM, Zach Welch wrote: > On Wed, 2009-11-11 at 08:40 +0100, Øyvind Harboe wrote: >> I've read over the branch and improving types is always a good thing, >> even if I don't have a specific opinions on whether to use >> unsigned or int for iteration variables, etc. > > T

Re: [Openocd-development] RFC: command handler restructuring

2009-11-11 Thread Zach Welch
On Wed, 2009-11-11 at 08:40 +0100, Øyvind Harboe wrote: > I've read over the branch and improving types is always a good thing, > even if I don't have a specific opinions on whether to use > unsigned or int for iteration variables, etc. There is almost always a correct choice. Most of the time, t

Re: [Openocd-development] What's the best way to use OpenOCD with Eclipse?!

2009-11-11 Thread Øyvind Harboe
On Wed, Nov 11, 2009 at 1:30 PM, Thomas Kindler wrote: > Hi! > > Now that the reset problem is solved for me, I'm trying to optimize my > eclipse setup for my STM32 target. > > Basically, I'm using gnuarmeclipse.sf.net for project settings and > makefile generation, CodeSourcery Lite as the toolch

[Openocd-development] What's the best way to use OpenOCD with Eclipse?!

2009-11-11 Thread Thomas Kindler
Hi! Now that the reset problem is solved for me, I'm trying to optimize my eclipse setup for my STM32 target. Basically, I'm using gnuarmeclipse.sf.net for project settings and makefile generation, CodeSourcery Lite as the toolchain, and the "Eclipse C/C++ GDB Hardware Debugging" Plug-In from

Re: [Openocd-development] arm11 etm commands pushed

2009-11-11 Thread Øyvind Harboe
> It is merely an additional feature that does not preclude anyone from > integrating arm11 into the openocd etm/etb drivers. We're very much appreciative of the time you put into getting the low level stuff sorted here. Really what I wanted to get committed was the tested low level stuff as I ti

Re: [Openocd-development] arm11 etm commands pushed

2009-11-11 Thread Michael Bruck
On Tue, Nov 10, 2009 at 21:38, Øyvind Harboe wrote: > On Tue, Nov 10, 2009 at 9:35 PM, David Brownell wrote: >> On Tuesday 10 November 2009, Øyvind Harboe wrote: >>> On Tue, Nov 10, 2009 at 8:14 PM, David Brownell wrote: >>> > On Tuesday 10 November 2009, Ųyvind Harboe wrote: >>> >> I've pushed