Re: KGDB support over network for Virtual Machine
Doug Anderson <[email protected]> Thu, 4 Sep 2025 08:52:13 -0700
| Newsgroups | org.kernel.vger.linux-debuggers |
|---|---|
| Message-ID | <CAD=FV=UCoGVYXDiCwMZvajx2kPXLqNETD3FNaBAkCYVXzxUHFg@mail.gmail.com> |
Hi, On Wed, Sep 3, 2025 at 6:56 PM Sahil Khan <[email protected]> wrote: > > Hii Doug, Thanks for the reply. > I am aware about the stop mode debugging of kgdb/kdb. I have worked with kgdb/kdb on > 1. Qemu hypervisor. > 2. VMware esxi/vcentre. > > Now, I know that on Qemu ( if you have access to the machine on which it is running) Virtual machine serial ports are generally mapped to some tty device on the host machine. Data can be relayed by socat(ing) the ttys of the 2 virtual machines( target and debugger). But the vm serial port to tty mapping is not persistent on reboots, tty is reassigned most of the time. The problem of the tty being reassigned feels like a very solvable problem. > Now for VMware based virtual machines, we do not have the access to the machine running the hypervisor. So the above method generally does not work. Things are made more difficult when the serial device support for virtual machines is disabled by the hypervisor. Figuring out how to get access to this serial port also feels like a solvable problem, but perhaps there are politics involved so who knows... > What I think should be considered for kgdb/kdb is : > 1. Provide nework debugging support similar to serial device based debugging. If you feel like you can write patches to make this work in a way that's not too hacky then feel free to post them. This feels like it would be quite difficult, though I suppose if you're trying to constrain yourself to some network device that's exposed by some VM then maybe it's not impossible. Almost certainly this would be impossible for 99% of network devices. No way are you going to get any large percentage of network devices to work under a stop mode debugger. > 2. Allow user to choose the frontend b/d kdb and kgdb, since kdb is the default from unless we want to switch but that switcj requires kdb prompt running. I'm not quite sure what the big deal is here. If you just start GDB when the kdb prompt is up then it auto-transitions over, doesn't it? I seem to remember there are a bunch of options around this too. ...but if what's there doesn't work for you then feel free to submit a patch. If the patch looks good/useful then it can be landed. -Doug