That is the intention is to do "board" foo thru the TCL extension
since on some boards you need to set GPIOs or put other chips in reset
before getting GDB to work correctly - like the one board I am staring
at right now and really want to throw out the window. Currently, we
bounce tools when I just need a script to beat the board into
submission.

As far as the protocol - there are a few choices...

ABNF for a Single Line both request and respo

OCTET      = <any 8-bit sequence of data>
CTL           = <any US-ASCII control character
                       (octets 0 - 31) and DEL (127)>
CR             = <US-ASCII CR, carriage return (13)>
LF             = <US-ASCII LF, linefeed (10)>
SP             = <US-ASCII SP, space (32)>
HT             = <US-ASCII HT, horizontal-tab (9)>
TEXT           = <any OCTET except CTLs, but including HT>
tcl-request    = TEXT LF
tcl-response   = TEXT LF

Biggest issue is that the response is assumed to only be one-line,
which is not that bad a constraint in my opinion and easier for folks
to get right at times...

If you want to go multiple line, then can probably just do a CHUNK
state machine without too much trouble - but, this might be more
trouble then it is worth...

ABNF for a Multi Line (Chunk)

OCTET          = <any 8-bit sequence of data>
CTL            = <any US-ASCII control character
                  (octets 0 - 31) and DEL (127)>
CR             = <US-ASCII CR, carriage return (13)>
LF             = <US-ASCII LF, linefeed (10)>
SP             = <US-ASCII SP, space (32)>
HT             = <US-ASCII HT, horizontal-tab (9)>
CRLF           = CR LF
TEXT           = <any OCTET except CTLs, but including HT>
DIGIT          = <any US-ASCII digit "0".."9">
HEX            = "A" | "B" | "C" | "D" | "E" | "F"
                 | "a" | "b" | "c" | "d" | "e" | "f" | DIGIT
tcl-chunk-size = 1*HEX
tcl-chunk-data = tcl-chunk-size(OCTECT)
tcl-chunk      = tcl-chunk-size CRLF chunk-data CRLF
tcl-last-chunk = 1*("0") CRLF
tcl-request    = *tcl-chunk tcl-last-chunk CRLF
tcl-response   = *tcl-chunk tcl-last-chunk CRLF

This allows the response to be multiple line and just strip off the
chunk formatting around it... But, this might be more complicated then
people desire...

Dunno, haven't needed to do multi line so far...

As far as the complexity line - my intention is to not replicate or
replace anything that GDB can do, but to only add TCL for things that
GDB cannot do... Like board specific gunk...

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

Reply via email to