2

I am using RCL for controlling Trace32 remotely. It is well-known that when running any PRACTICE command interactively (e.g. cd.do my_script.cmm) the command itself completes immediately, while the CMM script continues to run.

Same applies when executing command remotely.

My question: if there any function in Trace32 that I could call and determine if any CMM is currently running? Not code (that one is STATE.RUN()), but PRACTICE script.

Noob
  • 335
  • 1
  • 8

2 Answers2

4

Use the function

int T32_GetPracticeState ( int *pstate );

to find out if a PRACTICE script is currently running. See api_remote_c.pdf for details and possible values of pstate.

Reinhard Weiss
  • 426
  • 2
  • 4
  • Unfortunately is not supported by RCL... thanks anyway – Noob Apr 17 '23 at 12:03
  • 1
    It is a little bit hidden, because normally you shouldn't need it. You can access it by using `dbg.library.t32_getpracticestate()`. – dev15 Apr 18 '23 at 07:51
  • Maybe you are using InterCom instead of RCL? Sending commands from one PowerView instance to another one? Like `InterCom.execute CD.DO my_script.cmm`? – Reinhard Weiss Apr 18 '23 at 13:09
  • @dev15 man you are my savior!!! Put your comment as answer, i'll reward you points. I even contacted Lauterbach support about it and they were helpless. – Noob Apr 20 '23 at 17:16
2

Answer provided by @dev15:

There is hidden API dbg.library.t32_getpracticestate() which is similar to T32_GetPracticeState.

Couldn't accept previous as answer because my question was specifically for RCL, not ctype DLL.

Also can be used addition check of stack depth dbg.fnc.practice_stackdepth() to determine if Trace32 is in middle of CMM script or not.

Noob
  • 335
  • 1
  • 8