On Mon, Jul 7, 2008 at 8:43 PM, Duane Ellis <[EMAIL PROTECTED]> wrote:

> Øyvind > I want that same protocol to be available via the GDB mon command.
>
> I do not think I have explained the problem well.
>
> I believe what you want exists right now.
>
> Today - in GDB, any command works - at the GDB prompt, you prefix it with
> "mon" so GDB knows to pass it through.
>
> Today - in the telnet interface - any command works. The port requires no
> prefix, and executes both tcl & openocd commands.
> If both mistakenly define the same command - one of the two wins, I forget
> who.
>
> Today - with the tcl port - all commands are assumed to be tcl by default.
> You must explicitly prefix openocd commands with "openocd".
>
> =======
>
> Here is the problem:
>
> How would you propose handling errors, success, and those types of things.


My first instinct is to write a new proc in tcl/commands.tcl that uses catch
to
format the result in a defined manner for the successful and failing case.

Additionally, the existing command set returns human-readable output,
so I'd want to define tcl implementations of those commands where anything
but human readable output or an error message is required.

The output from mww is probably fine and we can tell if it failed, so it's
fine as-is.

mdw is unsuitable and should have a more tcl friendly version(which I
believe you
added already).



>
>
> As Pavel Chromy put it differently.
>
> Pavel>It is absolutely true that using GDB mon is not much suitable for
> Pavel> real scripting from external application, e.g. it lacks passing a
> Pavel> machine readable error code to the caller.
>
> My question is (and suggestions are about) how can that be simplified and
> standardized?
>

I think we need one wrapper proc in tcl/commands.tcl that defines the format
and
then we need enough tcl commands w/machine readable output to make the
interface useful.

I haven't come up with a magical way of making the existing code which has
human readable
output friendly towards computers. Certainly parsing the output of e.g.
"flash banks" looks
like a pretty awful task, compared to writing a new tcl command that outputs
the
info in tcl friendly manner in the first place.



>
> ======
>
>
>
>
>


-- 
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 XScale Cortex
JTAG debugger and flash programmer
_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to