Search code examples
debuggingdwarfgnu-toolchaintrace32lauterbach

Build Linux kernel image (vmlinux) to use DWARF3 instead of DWARF4


I am working on a project that depends on Lauterbach JTAG debugger hardware and software, and the support on the target JTAG cable ended in July 2011. We using a Linux 2.6.33 kernel on an omap2 processor. We are using gcc 4.9.2 to build the kernel image (not sure what version of bintools).

For those unfamiliar with how Lauterbach licenses its software, the target cable (connects between the debug pod and the target) carries the support contract dates. Any version of the Lauterbach Trace-32 software before and up to the end of the support period may be used, however anything after the end of support for the cable may not except for a 30 minute per session demo period. We are working through our purchasing process to renew the support contract for the cables, but until that is done (may take months), we're stuck with what we have.

It appears that the debug information produced by the toolchain we are using is too new for the last version of the Trace-32 debugger software released before July, 2017. Attempts to load the symbols for the kernel image (vmlinux) using the command:

data.load.elf \\path\to\vmlinux /nocode

fail with a message similar to:

error: entry near offset 5432100. in file \\path\to\vmlinux (use DUMP)

The easiest solution, of course, is to update to the first version of Trace-32 software that supports whatever ELF/DWARF combination that our toolchain produces. We know the most recent release works, but our cable does not support that version and won't until our procurement folks work out whether this is test equipment or software (they come out of different budgets).

For the next few months, we need a work-around. I'm looking for one of the following:

  1. Some way to tell the toolchain to produce debug information compatible with the debugger software
  2. Some way to convert the vmlinux ELF/DWARF file produced by our toolchain to an earlier ELF/DWARF format revision that is compatible with the Trace-32 build we are forced to use (R.2010.11.000028724).
  3. Any other solution to the problem that we've not thought of

I thank everyone in advance for any help.

Edit: I'm not 100% sure whether the toolchain is producing DWARF3 or DWARF4, so it may be that I need to make a ELF/DWARF2 "vmlinux"


Solution

  • To your three ideas:

    1. I suggest to try GCC's options: -g -gdwarf-2 -gstrict-dwarf
      Or maybe you can try a gcc version 4.4 (or older), which seem to fit to the year 2011.
    2. I think you have no chance at all to transfer the DWARF info of an ELF to something else. (Or at least not in some easy way.)
    3. Go to the Lauterbach website. At support > registration you can request a temporary maintenance key for one month. This should give your sales guys the time to buy a new key.