Intel: When debugging the Linux kernel, I get an error with the following message: What kind of things can you think of?

Embedded SW (OS)

<error message>
──────────────────────────────────────────────
Error (CMD685-IMG54):
! failed to load symbols for "vmlinux"
! Request to load DWARF debug info failed: section .debug_info at offset 0x49481
──────────────────────────────────────────────

Tools: SoC EDS
Device: Cyclone V


This error is displayed when the debug information format (DWARF) of the load target is not supported.
This error occurs due to a change in GCC version 4.7 → 4.8, which changed the default setting of debug information format from DWARF version 2 to DWARF version 4.

◎ This error does not occur if DS-5 attached to SoC EDS 14.0 or later is used.
(Except when you intentionally specify an unsupported debug format)

◎ When using the debug environment of SoC EDS 13.1 or earlier, the following countermeasures are required.

Specify the option -gdwarf-2 (DWARF version 2) as the debug information format when building the module/kernel to be debugged.
The above options should be added according to the configuration of the project to be debugged.
As an example, here is how to specify the -gdwarf-2 option for the 3.10ltsi kernel in "Yocto: Building Yocto 1.5 Dora with meta-altera" published on Rocketboards.
 http://www.rocketboards.org/foswiki/Documentation/YoctoDoraBuildWithMetaAltera

1. Command: Run "bitbake virtual/kernel -c devshell"
Another console will start with the environment variables for cross-compiling set.
(Current Directory is also moved to the build target kernel folder)

2. Add -gdwarf-2 option to Makefile (below) under kernel source directory
Target file: poky/build/tmp/work/socfpga_cyclone5-poky-linux-gnueabi/linux-altera-ltsi/3.10-r1/git/Makefile

Edit: Line 618
[Before editing] KBUILD_CFLAGS += -g
[After editing] KBUILD_CFLAGS += -gdwarf-2

3. Run build with make command from console
(I didn't need clean because it automatically recognizes change sources)

make clean (*if needed)
make menuconfig (*if needed)
make "$CCLD" modules zImage

4. Command: "bitbake virtual/kernel -c deploy"
Store the newly generated images in the /build/tmp/deploy/images folder


Experienced FAE
Free consultation is available.

From specific product specifications to parts selection, the Company FAE will answer your technical concerns free of charge. Please feel free to contact us.