trace32 - Memory dump of multiple address ranges to a single binary file

sdmello picture sdmello · Jan 7, 2017 · Viewed 10.5k times · Source

I'm using the Lauterbach debugger to dump from different memory sections to binary files. So far I've managed to generate a binary file for each address range using

data.save.binary output1.txt var.Range(sDummyArray[startRange1..endRange1])

data.save.binary output2.txt var.Range(sDummyArray[startRange2..endRange2]) 

...

Is there a way for me to "stitch" multiple binary(memory dump) files together to give one binary file OR append each memory dump to a file using a trace32 command that I have missed?

Answer

Holger picture Holger · Jan 9, 2017

To save multiple address ranges from target memory to the same binary file use the command Data.SAVE.Binary with its option "/Append". The option appends the new data at the end of the given file.

E.g.:

Data.SAVE.Binary output1.txt Var.RANGE(sDummyArray[startRange1..endRange1])
Data.SAVE.Binary output1.txt Var.RANGE(sDummyArray[startRange2..endRange2]) /Append

For TRACE32 older build 63378 you can use the debugger's virtual memory (if not used for other things) like this:

PRIVATE &size1 &size2   
&size1=Var.VALUE((sDummyArray+endRange1)-(sDummyArray+startRange1))
&size2=Var.VALUE((sDummyArray+endRange2)-(sDummyArray+startRange2))
Data.COPY Var.RANGE(sDummyArray[startRange1..endRange1]) VM:0
Data.COPY Var.RANGE(sDummyArray[startRange2..endRange2]) VM:&size1
Data.SAVE.Binary output1.txt VM:0++(&size1+&size2-1)

So the idea is here to collect all the data via Data.COPY in the virtual memory and save it from there to a binary file.