[tbot] Testcase / Scripting JTAG Debugger

Stefano Babic sbabic at denx.de
Fri Dec 7 09:01:33 UTC 2018


On 06/12/18 14:51, Harald Seiler wrote:
> Hi Stefano,
> 
> On Thu, 2018-12-06 at 14:40 +0100, Stefano Babic wrote:
>> Hi,
>>
>> there are some ready to use testcases for the BDI debugger ?
> 
> No, unfortunately not ... Yet!
> 

ok, what a pity. I thought tbot uses it to rescue a board after
installing a broken bootloader.

>> The debugger does not allow scripting - anyway, this is something tbot
>> can really help.
> 
> Yes, this is exactly what tbot is supposed to automate for you.  I have had
> debugger support in the back of my head for a long time, but haven't yet
> had time to implement anything ...

ok - I have supposed there is something.

My current problem can be solved in other ways, Lukasz mentions one. I
have just to push BDI commands without checking the status of the board,
so I can use even ncat for it.

> 
>> I have an old processor where the Flash is not supported by the debugger
>> fw, but I can rescue the  board after bricking issueing a long list of
>> CFI commands. What I would like to have is a "BDI" board and a
>> @tbot.testcase where I can put in a list a set of commands.
>>
>> Is there something to be used ?
> 
> So, technically you would need to implement a new machine for this.  Like
> a BdiMachine, that has the ip address configurable.  I don't have any
> documentation up for how one would go about doing this I am afraid ...

It is like a new channel for a board. So board has console and can have
a BDI attached to it. Both can be used at the same time to control the
board.

More advanced testcases can use both of them. Board is started from BDI,
a breakpoint is set, command are sent via the console, when break is hit
some BDI commands are sent, then board runs againm and so on.

> 
> I might be able to hack something basic up tomorrow that you can expand
> on as you need.

Do not be in hurry.

> 
> Unfortunately I don't have much experience with bdi so I am not sure
> what would be needed.  As far as I understood it, we have two interfaces,
> the telnet console and a gdbserver.

Yes, they work at the same time - but this depends on JTAG debugger.
Other debuggers have a different interface.

For very low-level interaction as what I need now, telnet must be used.

>  I guess you need both to work with
> a BDI effectively?
> 
> In that case, we'd have something like:
> 
> 	with bdi.BdiMachine(lh) as dbg:
> 	    dbg.exec0("run", "something", "on", "telnet", "console")
> 	    dbg.gdb0("run", "something", "on", "gdb", "session")
> 
> Does that make sense?

Yes - this can become more complicate if debugger functionalities
(breakpoints,..) are used. This would require multithreading in tbot
(doing something while waiting that a breakpoint is hit). I do not want
to add so much stuff now, I think the main concern is to provide
functionalities and features present in the old tbot version.

Regards,
Stefano



-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================


More information about the tbot mailing list