I am trying to debug running kernel by extracting vmlinux using extract-vmlinux, here is my list of steps
- extracted the vmlinux from vmlinuz using ~/script/extract-vmlinux
./extract-vmlinux bzImage > vmlinuxobjdump -DS vmlinux |lessDisassembly of section .text:ffffffff80200000 <.text>:ffffffff80200000: 48 8d 25 f1 3f 40 01 lea 0x1403ff1(%rip),%rsp # 0xffffffff81603ff8ffffffff80200007: e8 9d 01 00 00 callq 0xffffffff802001a9ffffffff8020000c: 48 8d 2d ed ff ff ff lea -0x13(%rip),%rbp # 0xffffffff80200000ffffffff80200013: 48 81 ed 00 00 20 00 sub $0x200000,%rbpffffffff8020001a: f7 c5 ff ff 1f 00 test $0x1fffff,%ebpffffffff80200020: 0f 85 8f 02 00 00 jne 0xffffffff802002b5ffffffff80200026: 48 8d 05 d3 ff ff ff lea -0x2d(%rip),%rax # 0xffffffff80200000ffffffff8020002d: 48 c1 e8 2e shr $0x2e,%raxffffffff80200031: 0f 85 7e 02 00 00 jne 0xffffffff802002b5ffffffff80200037: 48 01 2d ba ef 60 01 add %rbp,0x160efba(%rip) # 0xffffffff8180eff8ffffffff8020003e: 48 01 2d ab bf 40 01 add %rbp,0x140bfab(%rip) # 0xffffffff8160bff0ffffffff80200045: 48 01 2d ac bf 40 01 add %rbp,0x140bfac(%rip) # 0xffffffff8160bff8ffffffff8020004c: 48 01 2d 7d df 40 01 add %rbp,0x140df7d(%rip) # 0xffffffff8160dfd0ffffffff80200053: 48 8d 3d a6 ff ff ff lea -0x5a(%rip),%rdi # 0xffffffff80200000ffffffff8020005a: 48 8d 1d 9f df 60 01 lea 0x160df9f(%rip),%rbx # 0xffffffff8180e000ffffffff80200061: 48 89 f8 mov %rdi,%raxffffffff80200064: 48 c1 e8 27 shr $0x27,%raxffffffff80200068: 48 8d 93 63 10 00 00 lea 0x1063(%rbx),%rdxffffffff8020006f: 48 89 14 c3 mov %rdx,(%rbx,%rax,8)ffffffff80200073: 48 89 54 c3 08 mov %rdx,0x8(%rbx,%rax,8)2) Used this vmlinux to load into gdb and use /proc/kcore has core file gdb ./vmlinux /proc/kcoreGNU gdb (GDB) 8.0.1Copyright (C) 2017 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 "x86_64-poky-linux".Type "show configuration" for configuration details.For bug reporting instructions, please see:<http://www.gnu.org/software/gdb/bugs/>.Find the GDB manual and other documentation resources online at:<http://www.gnu.org/software/gdb/documentation/>.For help, type "help".Type "apropos word" to search for commands related to "word"...Reading symbols from ./vmlinux...(no debugging symbols found)...done.[New process 1]Core was generated by `BOOT_IMAGE=/junos-evo-install-acx-x86-64-20.4I20200915151620-EVO_raghuh/bzImage'.#0 0x0000000000000000 in ?? ()(gdb) (gdb) add-symbol-file /proc/kallsyms 0xffffffff80200000add symbol table from file "/proc/kallsyms" at .text_addr = 0xffffffff80200000(y or n) y`/proc/kallsyms': can't read symbols: File format not recognized.(gdb)
I have tried it on multiple systems and I am getting this `/proc/kallsyms': can't read symbols: File format not recognized. error
Whats the issue here?