Kernel Debugging with QEMU: Difference between revisions

Raboof (talk | contribs)
link to PR that fixes building the gdb integration script
Axka (talk | contribs)
m Add link for more info about patching and configuring the kernel
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Set up the QEMU VM ==
== Set up the QEMU VM ==


=== With a Nix kernel ===
=== With a Nix-built kernel ===
Use a NixOS config like this:
Use a NixOS config like below. See [[Linux kernel#Custom configuration]] for more information about patching and configuring the kernel's build.


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
Line 21: Line 21:
       name = "enable debugging information";
       name = "enable debugging information";
       patch = null;
       patch = null;
       extraConfig = ''
       structuredExtraConfig = {
         GDB_SCRIPTS y
         GDB_SCRIPTS = lib.kernel.yes;
         DEBUG_INFO y
         DEBUG_INFO = lib.kernel.yes;
         KALLSYMS y
         KALLSYMS = lib.kernel.yes;
       '';
       };
     }
     }
     {
     {