On 2009-12-24 21:55, David Brownell wrote:
> On Thursday 24 December 2009, Freddie Chopin wrote:
>> On 2009-12-24 08:34, David Brownell wrote:
>>> That's a bunch of very off-topic messages for what looks
>>> more like "you mis-spelled 'address'" ...
>>
>> Ups [; Isn't there a way to thorow something like "unknown sub-command"?
>
> Surely.  "Someone" would need to write that though.
>
> I think it should happen before 0.4 finalizes ...

The source of that mess is (probably...):

> # All commands are registered with an 'ocd_' prefix, while the "real"
> # command is a wrapper that calls this function.  Its primary purpose is
> # to discard 'handler' command output,
> proc ocd_bouncer {name args} {
>       set cmd [format "ocd_%s" $name]
>       set type [eval ocd_command type $cmd $args]
>       if {$type == "native"} {
>               return [eval $cmd $args]
>       } else {if {$type == "simple"} {
>               if {[catch {eval $cmd $args}] == 0} {
>                       return ""
>               } else {
>                       set errmsg "Command handler execution failed"
>               }
>       } else {if {$type == "group"} {
>               catch {eval ocd_usage $name $args}
>               set errmsg [format "%s: command requires more arguments" \
>                       [concat $name " " $args]]
>       } else {
>               set errmsg [format "Unknown command type: %s" $type]
>       }}}
>       return -code error $errmsg
> }

from src/helper/startup.tcl

I think that something is seriously wrong with it, but... I don't know 
how to fix that

When the command is "native" its executed, when the command is "simple" 
this procedure tries to execute it, but when the command is "group" its 
only passed through ocd_usage (and not executed probably). There is no 
case of "unknown command" and failure of "group" type is always because 
of "too few parameters".

"usage" for "group" always returns something - for known and unknown 
commands the output is pointless as:

>> usage reset halt
> add_usage_text <command> [...] <usage_text>]
> usage [<command> ...]
> Command handler execution failed
> in procedure 'usage' called at file "command.c", line 637
> called at file "command.c", line 352
>> usage reset blah
> add_usage_text <command> [...] <usage_text>]
> usage [<command> ...]
> Command handler execution failed
> in procedure 'usage' called at file "command.c", line 637
> called at file "command.c", line 352

I'd like to help, but I don't know how - I suppose that some deeper 
knowledge of OpenOCD is required here.

4\/3!!
_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to