Skip to content
Advertisement

“add-symbol-file” can’t recognize .bss & .data symbols when using kgdb to debug kernel modules

I am trying to use gdb 8.3.1 for the kernel module on RPI-4 board.

When I use the command add-symbol-file to add .bss and .data sections, it doesn’t work.

The Kernel version is 5.4 and CONFIG_DEBUG_INFO is turned on. I list the simple code, dmesg and kgdb info below. If you have any idea, please give me some advice.

Module code:

JavaScript

dmesg output:

JavaScript

kgdb: bt, it recognize text:

JavaScript

kgdb: print

JavaScript

Advertisement

Answer

I use gdb10.1 and the problem is fixed.

JavaScript

I print variables and it works fine now.

JavaScript

Hope this information helps you.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement