Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Log struct variable to file in trace32

Tags:

trace32

I am trying to log the contents of a structure to a file with a practice script.

I would rather not use Var.VALUE for every field of the struct and so far I have found the Var.PRINT command which displays all the information contained in the struct.

However I do not know if I can output this to a file, or if there is any other solution I'm not aware of for logging the values of a struct.

like image 479
user3256844 Avatar asked Jun 26 '26 02:06

user3256844


1 Answers

These three scripts can log the contents of a structure.

cmm1

PRinTer.FILE c:\temp\temp1.txt
WinPrint.v.v struct_name
TYPE c:\temp\temp1.txt
ENDDO

cmm2

PRinTer.FILE c:\temp\temp2.txt
WinPrint.v.v %all struct_name
TYPE c:\temp\temp2.txt
ENDDO

cmm3

PRinTer.FILE c:\temp\temp3.txt
WinPrint.v.v %m.4 %r.5 struct_name
TYPE c:\temp\temp3.txt
ENDDO

The cmm1 script will save the first level content.

The cmm2 script will save the first level content along with data type.

The cmm3 script will save the pointer value recursively.

m stands for multiline. It displays the structure elements in multiple line format. If the elements are in a multidimensional array, the numeric parameter defines the number of levels displayed.

r stands for recursive. This optional number defines the depth of recursion to be displayed. The command SETUP.VarPtr defines the valid address range for pointers. The contents of pointers outside this range are not displayed.

like image 152
Amal Roshan Avatar answered Jul 01 '26 06:07

Amal Roshan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!