To get details about the state of the target and/or debugger from a PRACTICE script (aka. "cmm-script") use the PRACTICE functions. Those functions are described in http://www.lauterbach.com/pdf/ide_func.pdf and http://www.lauterbach.com/pdf/general_func.pdf. (The stuff you are looking for is in general_func.pdf)
Here are the functions to return the values form the State Line:
- The address in the left corner is usually the program counter. You can get it with the function
PP()
and the symbol next to the program counter with sYmbol.NAME(PP())
.
- If you click on an item with an associated address, the status line will show that address instead of the program counter. You'll get the address which was selected last with
TRACK.ADDRESS()
and its symbol with sYmbol.NAME(TRACK.ADDRESS())
- If you have an SMP multicore scenario the next field is the the core number. It shows the currently selected logical core. You can get the number with the function
CORE()
.
- If you have an active OS awareness, then the next field shows the active task. You get its name with the function
TASK()
.
- The field "Debug" is a little bit more tricky. I don't think that there is a function to return that string directly. However
SYStem.Up()
returns FALSE in case of "system down" (which means that the debugger is not connected to your target core) and STATE.RUN()
returns TRUE if your target core is running.
- The field next to "Debug" shows the state of the trace recorder. You can get the state in as a numeric value with
Trace.STATE()
.
- There is small field called "Debugger Activity". It is red if the debugger does some run/stop activity not explicitly requested. E.g. a temporary stop to update memory dumps or when executing some algorythm on the target hardware for flash programming or user defined memory access. Unfortunately there seems to be no function to get this state.
- The field before the last one shows the debug-mode, which is set to Assembler, High Level Language or a mixed mode with assembler and HLL. The shown string is availalbe also via
DEBUGMODE()
.
- The last field shows the system mode. Related functions are
SYStem.MODE()
and SYStem.Up()
.
Messages like "application outputs, error messages, fatal errors" are not shown in the "State Line" but in the "Message Line": At the bottom of the TRACE32 main window you have the command line (usually starting with B::), below that there's the "Message line" (showing errors and other messages) and below the Sofkeys (helping you to find commands) and finally the "State Line".
Almost all messages displayed in the "Message Line" are also shown in the AREA window. (command AREA
). You can get the last line of the AREA window with the function AREA.LINE(A000,0)
where "A000" is the name of the default AREA and the 0 means the last line of the AREA.