Finding difference in Datastructures

Hello,

i wan’t to check a data-structure for any difference.

Let’s say i have two variable of the same datatype

Variable 1:
dummyStructure1.test1 := 2;
dummyStructure1.test2 := 3;
dummyStructure1.test3 := 4;

Variable 2:
dummyStructure2.test1 := 2;
dummyStructure2.test2 := 3;
dummyStructure2.test3 := 5;

Now i want to check if there is a difference in the structure. For that i could use memcmp(). But i would like to find either the starting addess of the variable that is different or (ideally) the name of the variable that is different.

So in this case i would like to find the address of the variable dummyStructure1.test3.
I recently saw a function with which you can read the name of a variable at a specific address. Unfortunately I have forgotten the name of the function, but it would be ideal here if you could also use it to return the name “dummyStructure1.test3”.

Does anyone have any idea whether it is possible to find the differences in a data structure in this way or does anyone have any other ideas?

A structure has also a default alignment so there could be dummy bytes inserted depending on the datatype.

You can use the functions PV_ninfo(), PV_item() and PV_xgetadr(). In AS6\AR6 you could also use PV_lkaddr() to get the string name of PV variable.

1 Like