This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] CCS/CCStudio:其中是 ti/ccsv8/ccs_base/DebugServer/packages/ti/dss/Java 中 JAR 的 Java 源代码

Guru**** 1937600 points
Other Parts Discussed in Thread: CCSTUDIO
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/753417/ccs-ccstudio-where-is-the-java-source-for-the-jars-in-ti-ccsv8-ccs_base-debugserver-packages-ti-dss-java

器件型号:CCStudio

工具/软件:Code Composer Studio

你(们)好

Java 源代码是否可用于 DebugServer (Java API)? 由于我找不到有关如何使用 Java 中的调试服务器的任何文档、因此欢迎使用源代码进行调试。

谢谢 Peter

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    尊敬的 Peter:
    您是否看过以下 wiki?
    processors.wiki.ti.com/.../Java_Scripting_with_DSS

    本文有点过时、但仍应与 CCSv8相关。

    谢谢
    Ki
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    你(们)好

    谢谢、是的、我看到了这一点、当我从命令行运行它时、它会起作用:

    !/bin/zsh
    封装="/media/p/nuage/dev/ti/ccsv8/ccs_base/DebugServer/packages/ti/dss/java
    cmd="$package/com.ti.ccstudio 脚本环境3.1.0.jar:$package/com.ti.debug.engine_1.0.0.jar:$PACKAGE/dss.jar"
    javac -CP $CMD hotbrix/dss/DssExample.java
    Java -CP ".:$package/dss.jar" hotbrix.dss.dssExample.

    顺便说一下、我不需要修改$path var。

    但是、当我从 eclipse 运行相同的代码时、我得到:

    严重:无法连接到 DebugServer。 未找到路径:'/media/bin '
    严重:无法启动服务器:DebugServer.1:无法连接到 DebugServer。 未找到路径:'/media/bin '

    有什么想法?

    谢谢
    Peter
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    我能否看到源(或仅相关代码段)?
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    你(们)好

    很抱歉、回复太晚了、不知怎么说、我没有收到您的回复通知。

    与此同时、我发现、只要我保留相关的 JAR ('com.ti.ccstudio。scripting.environment_3.1.0.jar'、
    'com.ti.debug.engine_1.0.0.jar')位于 TI 目录结构中' /ccsv8/ccs_base/DebugServer/packages/ti/dss/java'
    一切都很好。 但是,如果我要将此 jar 移动到本地 repo,我将收到所述的错误消息。 似乎是这些骗子
    依赖 dir 结构中的其他一些文件。 您能确认吗?

    谢谢 Peter



    以下是 Java 源代码(只要我不移动 DSS JAR,就可以正常工作):

    封装 hotbrix.dss;
    导入静态 softbrix.lib.list.ls.list;
    导入 com.ti.ccstudio 脚本编写环境脚本编写环境;
    导入 com.ti.ccstudio.scripting.environment.ScriptingException;
    导入 com.ti.debug.engine.scripting.BreakpointProperties;
    导入 com.ti.debug.engine.scripting.DebugServer;
    导入 com.ti.debug.engine.scripting.DebugSession;
    公共类 MainMSP{
    公共静态空 main (String[] args){
    字符串 deviceCCXMLFile =" /targetConfigs/both.ccxml;
    字符串 programToLoad =" /Debug/MSP432P4111-tutorial.out;
    //创建基本脚本环境。
    ScriptingEnvironment 脚本= ScriptingEnvironment.instance();

    DebugServer debugServer =空;
    DebugSession debugSession=空;
    尝试{
    script.traceBegin ("trace.xml"、" /ccsv8/ccs_base/scripting/examples/DebugServerExamples/DefaultStylesheet.xsl");
    debugServer =(DebugServer) script.getServer ("DebugServer.1");

    }捕获(ScriptingException se){
    system.out.println ("getServer:"+ se);

    debugServer.setConfig(deviceCCXMLFile);
    system.out.println (list (debugServer.getListOfCPUs ()).join ("\n"));
    尝试{
    debugSession = debugServer.openSession ("Texas Instruments XDS110 USB Debug Probe"、"Cortex_M4_0");
    }捕获(ScriptingException se){
    system.out.println ("openSession:"+ se);

    尝试{
    //加载程序

    debugSession.target.connect();
    debugSession.memory.loadProgram (programToLoad);
    BreakpointProperties break_Point_properties = debugSession.breakpoint.createProperties(1);
    Break_Point_properties.setString("Hardware Configuration.Type"、"Watchpoint");
    Break_Point_properties.setString("Hardware Configuration.Type.Location"、"&testResult");
    Break_Point_properties.setString("Hardware Configuration.Type.Memory"、"Write");
    debugSession.breakpoint.add(Break_Point_properties);
    //运行程序
    script.traceWrite ("run...");
    debugSession.target.run();
    //读取和写入数据
    long data = debugSession.expression.evaluate ("count");
    script.traceWrite ("evaluate:"+ data);
    long address = debugSession.symbol.getAddress ("testResult");
    数据= debugSession.memory.ReadData (0、地址、16);
    script.traceWrite ("ReadData:"+ data);
    debugSession.terminate();
    debugServer.stop();
    script.traceWrite ("已成功完成");
    }捕获(ScriptingException se){
    system.out.println (se);




    这里是* build.gradle*文件(我使用 gradle 5.0作为构建工具):

    插件{id 'application'}


    存储库{
    jcenter()
    /*
    *这不起作用、我们不能在 TI 目录树之外使用这些 JAR
    * flatDir{dirs }
    *
    flatDir {方向' /ccsv8/ccs_base/DebugServer/packages/ti/dss/java'}//<-这起作用



    依赖项{
    编译工程(':softbrix.lib')
    测试压线机'JUnit:JUnit:4.12'
    编译名称:'com.ti.ccstudio.scripting.environment_3.1'
    编译名称:'com.ti.debug.engine_1.0.0'
    //编译名称:'dss'


    mainClassName ='hotbrix.dss.MainMSP'
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    [引用 user="Peter Vittali">这些字符似乎是这样的
    依赖 dir 结构中的其他一些文件。 您能否确认此项?

    是的、这确实是事实。 移动它们肯定会导致问题。 我应在文件中对此加以说明。

    谢谢

    Ki

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    你(们)好
    谢谢你。
    我认为文档中的注释确实是一个好主意,因为我相信有些 Java 开发人员不会期望这些隐藏的 DEPS。

    我认为调试服务器脚本编写是一项很好的功能、我希望 TI 能在将来对此充满热情。
    此外,如果可能,源代码也会很有帮助。

    谢谢
    Peter
x 出现错误。请重试或与管理员联系。