Search code examples
armjtagtrace32lauterbach

How to print Trace32 terminal view to a file?


I have a script that initializes terminal and prints information in it in Trace32 terminal and I cannot edit that file. I am using term.write command to log the contents in terminal window to a file. But it does log the information that were written before executing this command.

So, I tried to Printer.file and winprint.term.view commands. Now I get this error.

terminal window with this configuration already open

What should I do to log all the contents of terminal (including contents that were already written and will be written in the terminal) to a file?


Solution

  • If you want to get the content from a window in TRACE32 while using the debugger interactively, click on the context menu, and choose "To Clipboard all". Then open a text editor and paste your clipboard to an empty document (Ctrl+V).


    If you want to get the content of a window in TRACE32 via a PRACTICE script use the command PRinTer.FILE <FilenName> ASCIIE (as you did) and then the command WinPRT <WindowName> /ALL.

    The pre-command WinPRINT creates a new window on the printer, which will not give what you want with Terminal windows. The command WinPRT however, actually sends the content of an open window to the printer (and the printer can be redirected to a file).

    The tricky thing with WinPRT is to know the name of your window. The command WinPOS allows you set the name for next opening window. So I recommend to use WinPOS in the script opening your terminal window. But since you can't change that script use the command WinPAGE.List to get the names of all open windows.

    E.g. In the following WinPAGE.List you can see that the window opened with TERM.VIEW has the window-name "W000".

    Thus, I can get the content of my terminal window with

    PRinTer.FILE "C:\temp\mywindow.txt ASCIIE
    WinPRT W000 /ALL
    

    Note, that window names are case sensitive.

    The window names starting with a capital 'W' followed by three decimal digits are set by TRACE32 in the order they appear. So if you want to be sure that your terminal window always gets the same name, ensure that no window is open before opening your terminal window with your script. You can close all windows with WinPAGE.RESet.

    So all together you get:

    WinPAGE.RESet
    DO "C:\T32\user\my_script_to_open_the_terminal.cmm"
    PRinTer.FILE "C:\temp\mywindow.txt ASCIIE
    WinPRT W000 /ALL
    

    If you script is only opening one terminal window and no other window, I recommend to do this:

    WinPOS ,,,,,,myTerminal    
    DO "C:\T32\user\my_script_to_open_the_terminal.cmm"
    PRinTer.FILE "C:\temp\mywindow.txt ASCIIE
    WinPRT myTerminal /ALL