kgdb debug kernel module 'Reading symbols from done,but still No symbol table info available'

0

PC with cygwin ,running gdb 7.6.2; Target arm64, building with gcc 4.9.3

Administrator@ZTE-20201110ABZ ~/gdb-7.6.2
$ ./gdb/gdb.exe
Python Exception <type 'exceptions.ImportError'> No module named gdb:

warning:
Could not load the Python gdb module from `/usr/local/share/gdb/python'.
Limited Python support is available from the _gdb module.
Suggest passing --data-directory=/path/to/gdb/data-directory.

GNU gdb (GDB) 7.6.2
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-unknown-cygwin --target=aarch64-linux".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.

lzy@user-R5300-G3:~/et3_git/et302/android-5.1.1$ /home/lzy/et3_git/et302/android-5.1.1/prebuilts/gcc/linux-x86/arm64/aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/home/lzy/et3_git/et302/android-5.1.1/prebuilts/gcc/linux-x86/arm64/aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/home/lzy/et3_git/et302/android-5.1.1/prebuilts/gcc/linux-x86/arm64/aarch64-linux-gnu/bin/../libexec/gcc/aarch64-linux-gnu/4.9.3/lto-wrapper
Target: aarch64-linux-gnu
Configured with: ../configure --target=aarch64-linux-gnu --prefix=/opt/zxic/toolchains/4.9.3/aarch64-linux-gnu --enable-__cxa_atexit --enable-languages=c,c++,fortran,lto --with-arch=armv8-a --with-build-sysroot=/opt/zxic/toolchains/4.9.3/aarch64-linux-gnu/aarch64-linux-gnu --with-sysroot=/opt/zxic/toolchains/4.9.3/aarch64-linux-gnu/aarch64-linux-gnu --with-gnu-as --with-gnu-ld --disable-libstdcxx-pch --disable-libmudflap --with-cloog=no --with-ppl=no --with-isl=no --disable-nls --enable-c99 --disable-multilib --enable-cmultiarch --enable-lto --enable-linker-build-id --enable-long-long --enable-checking=release --disable-bootstrap -with-bugurl=https://debbugs.gnu.org --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --disable-shared --enable-static --with-gmp=/opt/zxic/toolchains/4.9.3/aarch64-linux-gnu --with-mpfr=/opt/zxic/toolchains/4.9.3/aarch64-linux-gnu --with-mpc=/opt/zxic/toolchains/4.9.3/aarch64-linux-gnu
Thread model: posix
gcc version 4.9.3 (GCC)

I compile the module with -g and dwarf4

lzy@user-R5300-G3:~/et3/et302/android-5.1.1$ llvm-dwarfdump --debug-dump=info ./out/target/product/angle/obj/KERNEL/drivers/net/wireless/rtl8723DU/8723du.ko | grep Compile
0x00000000: Compile Unit: length = 0x000050ab version = 0x0004 abbr_offset = 0x0000 addr_size = 0x08 (next unit at 0x000050af)

lzy@user-R5300-G3:~/et3/et302/android-5.1.1$ readelf -S out/target/product/angle/obj/KERNEL/drivers/net/wireless/rtl8723DU/8723du.ko | grep debug
  [23] .debug_info       PROGBITS         0000000000000000  0012b2dc
  [24] .rela.debug_info  RELA             0000000000000000  0020dbe0
  [25] .debug_abbrev     PROGBITS         0000000000000000  0013038b
  [26] .debug_aranges    PROGBITS         0000000000000000  001306aa
  [27] .rela.debug_arang RELA             0000000000000000  00215cb0
  [28] .debug_line       PROGBITS         0000000000000000  001306ca
  [29] .debug_str        PROGBITS         0000000000000000  00130cda

After adding symbol from 8732du.ko, gdb tells us 'Reading symbols from done',but when i locals,it tells us 'No symbol table info available'

(gdb) set complaints 100
(gdb) add-symbol-file /cygdrive/d/debug/0111_wifi/8723du.ko 0xffffffbffc000000 -s .data 0xffffffbffc114c00 -s .bss 0xffffffbffc129218 -s .rodata 0xffffffbffc0ee860
add symbol table from file "/cygdrive/d/debug/0111_wifi/8723du.ko" at
        .text_addr = 0xffffffbffc000000
        .data_addr = 0xffffffbffc114c00
        .bss_addr = 0xffffffbffc129218
        .rodata_addr = 0xffffffbffc0ee860
(y or n) y
Reading symbols from /cygdrive/d/debug/0111_wifi/8723du.ko...Building psymtabs of objfile /cygdrive/d/debug/0111_wifi/8723du.ko ...
Psymtab for comp unit @0x0: 0xffffffbffc000000 - 0xffffffbffc000000, 2 global, 392 static syms
Done building psymtabs of /cygdrive/d/debug/0111_wifi/8723du.ko
done.
(gdb) bt
#0  0xffffffbffc011a08 in rtw_ieee802_11_parse_elems ()
#1  0xffffffbffc032204 in is_the_same_ch ()
#2  0xffffffbffc034b8c in validate_recv_mgnt_frame ()
#3  0xffffffbffc034da0 in validate_recv_frame ()
#4  0xffffffbffc035f38 in recv_func_prehandle ()
#5  0xffffffbffc0360c4 in recv_func ()
#6  0xffffffbffc036194 in rtw_recv_entry ()
#7  0xffffffbffc09afa4 in recvbuf2recvframe ()
#8  0xffffffbffc052804 in usb_recv_tasklet ()
..
(gdb) i locals
No symbol table info available.

Besides,i can print the varilbe in vmlinx.

Please suggest me what could be the problem, Thanks a lot.


I still cannot find out what the problem is, can somebody help? Thx...

debugging
gcc
gdb
kgdb
asked on Stack Overflow Jan 13, 2021 by Linxujia-zte • edited Jan 21, 2021 by Linxujia-zte

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0