Type: Answers

Area: Embedded

Area: Tools



Why does Lauterbach Trace32 not find the source code for my elf image?

Description

The cygwin C compiler/linker tools build an elf file with '/cygdrive/c'.  You will need to strip out the /cygdrive/c from the elf file, using parameters for the Lauterbach Trace32 data.load.elf command.

Load your elf into Lauterbach Trace32, specifying the following parameters:

data.load.elf <elf_image> /PLUSVM /StripPART 3 /PATH C:\

<elf_image> should contain the drive, path, and file name for your elf image.  For example, <elf_image> could be:

C:\NEEK\mictor_test\software\hello_world_mictor\Release\hello_world_small.elf

/StripPART does the stripping, and /PATH does the replacement of the stripped portion of the path, providing a root directory for searching for source code.

The StripPART value of "3" specifies that the drive letter (first part) and first two subdirectories (parts two and three, "cygdrive" and "c", respectively) be removed from all source file paths indicated in the .elf file.

The speed with which Lauterbach is able to find files is proportional to the number of files and directories located under the directory specified via /PATH.  In the data.load.elf example above, the entire C:\ drive is specified as the source code repository. 

If you strip additional parts (directories) off of the elf specified source code locations, and add the corresponding directory to the /PATH switch, the size of the source file tree is reduced.  However, any source code not located under the /PATH directory will not be found.

For example, modify the above data.load.elf command to increase /StripPART parameter to 4, and changing the /PATH parameter to include the NEEK directory:

data.load.elf <elf_image> /PLUSVM /StripPART 4 /PATH C:\NEEK\

would not locate any source code not under the C:\NEEK directory, such as Altera® HAL device drivers.