Kernel debugging
Erik Moe
e.moe at rcn.com
Tue Apr 5 21:32:09 UTC 2016
I’ve been playing around with JTAG on the RPI B, for no other reason but a learning experience. I’d had some early success with setting breakpoints and stepping through the kernel. However, I just recently updated my sources and now I can’t load the debug kernel into gdb:
Dwarf Error: wrong version in compilation unit header (is 0, should be 2, 3, or 4)
I’m not very savvy in this area. Has something changed recently that would cause this? It seems like some of the debug information is not valid:
arm-none-eabi-objdump: Warning: Compilation Unit @ offset 0x1363b:
Invalid pointer size (46) in compunit header, using 4 instead
Length: 0x0 (32-bit)
Version: 0
arm-none-eabi-objdump: Warning: CU at offset 1363f contains corrupt or unsupported version number: 32896.
--
arm-none-eabi-objdump: Warning: Compilation Unit @ offset 0x1363f:
Invalid pointer size (128) in compunit header, using 4 instead
Length: 0x0 (32-bit)
Version: 32896
arm-none-eabi-objdump: Warning: Debug info is corrupted, length of CU at 13643 extends beyond end of section (length = f808080)
--
Compilation Unit @ offset 0x13643:
Length: 0xf808080 (32-bit)
Version: 54025
arm-none-eabi-objdump: Warning: Unable to load/parse the .debug_info section, so cannot interpret the .debug_loc section.
arm-none-eabi-objdump: Warning: Unable to load/parse the .debug_info section, so cannot interpret the .debug_ranges section.
Do I need to update my arm-none-eabi-gdb ?
Thanks,
Erik
$ /usr/local/bin/arm-none-eabi-gdb /home/emoe/Projects/ARM/rpi-b/obj/arm.armv6hf/usr/home/emoe/Projects/ARM/rpi-b/src/sys/RPI-B/kernel.debug
Exception caught while booting Guile.
Error in function "open-file":
No such file or directory: "/usr/local/share/gdb/guile/gdb/boot.scm"
/usr/local/bin/arm-none-eabi-gdb: warning: Could not complete Guile gdb module initialization from:
/usr/local/share/gdb/guile/gdb/boot.scm.
Limited Guile support is available.
Suggest passing --data-directory=/path/to/gdb/data-directory.
Python Exception <type 'exceptions.ImportError'> No module named gdb:
/usr/local/bin/arm-none-eabi-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.10
Copyright (C) 2015 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=amd64-portbld-freebsd11.0 --target=arm-none-eabi".
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"...
warning: A handler for the OS ABI "FreeBSD ELF" is not built into this configuration
of GDB. Attempting to continue with the default arm settings.
Reading symbols from /home/emoe/Projects/ARM/rpi-b/obj/arm.armv6hf/usr/home/emoe/Projects/ARM/rpi-b/src/sys/RPI-B/kernel.debug...Dwarf Error: wrong version in compilation unit header (is 0, should be 2, 3, or 4) [in module /usr/home/emoe/Projects/ARM/rpi-b/obj/arm.armv6hf/usr/home/emoe/Projects/ARM/rpi-b/src/sys/RPI-B/kernel.debug]
(no debugging symbols found)...done.
(gdb)
More information about the freebsd-arm
mailing list