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

How to translate CMM-style command Data.Long(ZSD:&regAddr) in jython script

Hi,

I 'm translating a cmm script to  a jython script . Need to translate CMM-style command Data.Long(ZSD:&regAddr) .Not sure how to do it, especially about this flag ZSD. Would somebody guide me how to do it? Thanks.

Jerry

Parents
  • Hi Jerry,

    According to the Lauterbach docs on the web:
    Data.Long() reads a long value (32-bit) value from memory.
    and
    ZSD means access the data in secure supervisor mode at virtual address location.

    The Arm Debugger (DS-5 or Arm DS) offers a number of "address prefixes" to allow you to qualify an address, as described at:
    developer.arm.com/.../address-space-prefixes

    To read in Secure mode, specify the S: prefix on the address.  The Arm Debugger will access virtual addresses by default, unless you've used the SP: or NP: address prefixes that turn off the MMU temporarily.

    So the corresponding lines in Jython for
    Data.Long(ZSD:&regAddr)
    would be:
     
    ec = debugger.getCurrentExecutionContext()
    value = ec.getMemoryService().readMemory32(S:address)

    Or the equivalent:

    value = debugger.readMemory(S:address, 4)

    Hope this helps,

Reply
  • Hi Jerry,

    According to the Lauterbach docs on the web:
    Data.Long() reads a long value (32-bit) value from memory.
    and
    ZSD means access the data in secure supervisor mode at virtual address location.

    The Arm Debugger (DS-5 or Arm DS) offers a number of "address prefixes" to allow you to qualify an address, as described at:
    developer.arm.com/.../address-space-prefixes

    To read in Secure mode, specify the S: prefix on the address.  The Arm Debugger will access virtual addresses by default, unless you've used the SP: or NP: address prefixes that turn off the MMU temporarily.

    So the corresponding lines in Jython for
    Data.Long(ZSD:&regAddr)
    would be:
     
    ec = debugger.getCurrentExecutionContext()
    value = ec.getMemoryService().readMemory32(S:address)

    Or the equivalent:

    value = debugger.readMemory(S:address, 4)

    Hope this helps,

Children
  • Hi Stephen,

    Thanks a lot for replying.

    There is Syntax Error. 

    source "init.py"
    ERROR(?): SyntaxError: no viable alternative at input ':'
    File "init.py", line 21
    status = debugger.readMemory(S:regAddr, 4)
    ^
    ERROR(CMD656): The script init.py failed to complete due to an error during execution of the script
    source "init.py"
    ERROR(?): SyntaxError: no viable alternative at input ':'
    File "init.py", line 23
    status = ec.getMemoryService().readMemory32(S:regaddr)
    ^
    ERROR(CMD656): The script init.py failed to complete due to an error during execution of the script
    
    

    Seems we can fix like this:

    a = "S:" + str(regaddr)
    ec = debugger.getCurrentExecutionContext()
    status = ec.getMemoryService().readMemory32(a)

    BTW, if we use debugger.readMemory. It's:

    value = debugger.readMemory(S:address, 32)

    not

    value = debugger.readMemory(S:address, 4)

    right?

    Jerry