Master the fundamental concepts of debugging mastery through this focused micro-challenge.
You have read the whole brief, and the concepts above stay free on every task. Writing and running the code needs a plan.
Three hints are available for this task, revealed one at a time inside the code workspace so you can struggle productively before seeing them.
Every task includes starter code, theory, and hidden tests so you can implement and verify locally in the browser.
How it worksQEMU includes a built-in GDB stub that allows remote debugging of operating systems and kernel code without physical hardware. Kernel developers and security researchers use this workflow daily.
Start QEMU with the GDB stub:
-s: Shorthand for -gdb tcp::1234-S: Pause CPU at startup until GDB connectsConnect from GDB:
cLoading…
Once connected, you can examine registers with info registers, step through boot code with stepi, and inspect memory at known addresses with x/10x 0x100000.
You will document the QEMU + GDB remote debugging workflow for kernel development. This exercise asks you to explain how to set breakpoints in kernel code and load module symbols, skills you will need when analyzing OS behavior or developing kernel modules.
After the guest boots, load a module with insmod and find its base address in /proc/modules. In GDB, use add-symbol-file module.ko 0xaddress to load debug symbols at the correct relocation. Without this step, breakpoints in module code miss because GDB only knows the kernel's main symbol table. QEMU's stub exposes the full guest register set as if you were debugging bare metal.
Write a C program that implements the framing layer of the GDB Remote Serial Protocol used by QEMU's GDB stub.
Requirements: