Unable to lo load symbols table and perform symbolic debugging with Simics

Viewed 128

I'm trying to debug my custom kernel under Simics preview 6.0.43.
I'm able to boot the kernel, set a breakpoint on a memory address and to have the execution hit the breakpoint. Anyway I'm not able to load symbols for symbolic debugging.
This what I did:

simics> $disk0_image="/home/peppe/Scrivania/gpt.img"
simics> 
simics> run-command-file /opt/simics/simics-qsp-x86-6.0.43/targets/qsp-x86/qsp-h
dd-boot.simics

simics> enable-debugger
Debugger enabled.
simics> 
simics> add-symbol-file /home/peppe/Scrivania/g-os-grub2/g-os/kernel.bin
Context query * currently matches 6 contexts.
Symbol file added with id '1'.

simics> bp.source_location.break 0xc0000812
2: 0x2 (planted)
simics> bp.source_location.break kmain
3: 0x3 (not planted)
simics> list kamin.c
**At col 7: Cannot read symbol data. Invalid abbreviation table offset. Error reading DWARF data**

simics> run
running> 
[tcf] Breakpoint 2 on execution in context mb.cpu0.core[0][0]
Now debugging the x86QSP1 board.mb.cpu0.core[0][0]
??()
                                                  push ebp
simics> board.mb.cpu0.core[0][0].pregs

rip = 0x00000000c0000812

I compiled my source with:

CFLAGS         = -O0 -g -c -fno-builtin -m32
gcc version 11.2.1 20211203 (Red Hat 11.2.1-7) (GCC)

My question: why the error message

At col 7: Cannot read symbol data. Invalid abbreviation table offset. Error reading DWARF data

that seems to prevent correct accessing to symbols?

1 Answers

Simics is supposed to support Dwarf 5 but you need to upgrade to at least 6.0.116, and 6.0.126 was released on March 9.

Related