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.

Read float variable using DSS

Hi 

All the readData APIs in debug sever scripting returns either long or long[]. My question is how do I read a float variable? Is there any specific API to read a float variable?

Regards,

Bhavin


  • Unfortuantely, it is currently not supported.

  • There is no specific API to read a float variable but it is possible to read a float (or any data type) using some java.

    Edit your main module to have a void* pointed to the float.

    float a;
    void* ptr = &a;

    Now in DSS, find the address ptr is pointed to and readData from that address. Finally, convert int bits to a float.

    var address = debugSession.expression.evaluate("ptr");
    var result = debugSession.memory.readData(0, address, 32);
    result = Float.intBitsToFloat(result);