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:如何更改 DSS API 中的数字、debugSession.expression.evaluateToString ("peak_error_input_i32");

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

https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/737526/ccs-how-change-the-number-in-dss-api-debugsession-expression-evaluatetostring-peak_error_input_i32

工具/软件:Code Composer Studio

您好 DS/CCS 社区、

我使用的是 Java 和 DSS API,其中 Java 从 debugSession.expression.evaluateToString 中捕获字符串,并以.csv 格式呈现这些字符串。 以下是一个示例、  

string peak_error_input_i32  = debugSession.expression.evaluateToString ("peak_error_input_i32");

peak_error_input_i32是 C28xx、C 测试用例中的 uint32_t 类型变量。 目前,我将获得一个 Java 字符串,它是 我要以十六进制格式更改的十进制格式的 peak_error_input_i32值。 在 CCS GUI 中、我知道如何更改 Expressions 窗口中数字的格式、因此也希望通过 DSS API。这可以通过 Java/MS Excel 来实现、但在此之前、我想检查 DSS 中是否存在任何内容。

谢谢  

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    您好!
    没有内置的 API。 从 DSS 获取十进制值后、需要处理此问题(例如:"ToString (16)"、带 javascript)。

    谢谢
    Ki
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    导入 java.lang.*;

    字符串 peak_error_input_i32="0x"+long.toHexString (debugSession.expression.evaluate ("peak_error_input_i32"));

    转换为十六进制格式