This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DS-5/Jython: How to execute the functions of jython scripts on the debugger CLT?

Requirement: Develop a debug layer for new CPU based on DS-5.

1. Basically I want to use jython to develop that, and it could be easily loaded and run on debugger CLT by source command. (e.g. source debug.py).

2. The debugger jython interface enables to execute arbitrary DS-5 commands by ec.executeDSCommand. Therefore, in the jython script, we could easily execute the DS commands.

3. However, it's not easy to execute the fucntion of jython scripts.

One way is to just develop one function in the single .py file and then use define/end to realize the self-defined command. It could run on CLT directly.

Header 1

define echo-all

  source debug.py

end

However, it's not possible to do that if there are a lot of debug functions.

The other way is to develop a new CLT for debug scripts. It seems the debugger CTL disabled raw_input/input.

Any suggestions about that? Thanks a lot.

  • Hi,

    I must firstly apologise about the delay in getting back to you on this.

    I think the facilities offered by DS-5 'use-case' scripts might be what you are looking for, and should hopefully address your issues.

    You can mix Jython, DTSL and debugger commands within them, with multiple entry points within the one script. Which, if I have understood your use-case correctly, is what you require.

    More on use-case scripts can be found at Docs – ARM Developer

    It is also possible to pass arguments to the use-case scripts, so could do something like :

    define echo-all

      source debug.py do_echo

    end

    define dump-state

      source debug.py do_dump_state

    end

    to define 2 operations, 'echo-all' and 'dump-state'.

    debug.py would then look at sys.argv[1] to work out which action would need to be taken.

    Does that help you ?

    Regards,

    Stuart