Contents
How do I enable debugging in Linux?
Linux Agent – Enable Debug mode
- # Enable Debug mode (comment or remove debug line to disable) Debug=1. Now restart the CDP Host Agent module:
- /etc/init.d/cdp-agent restart. To test this you can ‘tail’ the CDP Agent log file to see the new [Debug] lines that are added to the logs.
- tail /usr/sbin/r1soft/log/cdp.log.
How do you debug a kernel?
Setup
- Build the kernel with CONFIG_GDB_SCRIPTS enabled, but leave CONFIG_DEBUG_INFO_REDUCED off. …
- Install that kernel on the guest, turn off KASLR if necessary by adding “nokaslr” to the kernel command line. …
- Enable the gdb stub of QEMU/KVM, either. …
- cd /path/to/linux-build.
- Start gdb: gdb vmlinux. …
- Attach to the booted guest: