Search code examples
gdbkernelqemugdbserver

how to make gdbserver accept more than one connection?


I'm debugging an operating system (kernel + one user space application) within qemu, using gdb connected to gdbserver. Since i'm in presence of two binaries, i would like to connect to gdbserver firstly with the kernel binary, and secondly with the user space binary so that i could switch from kernel tracing to user space tracing smoothly. But, it seems that gdbserver can not accept more than one connection. Is it possible to get around this?


Solution

  • I found out that the best way is to use the gdb command add-symbol-file to add userspace applications debugging information; provided you know their loading address. so to be precise, you have to launch the kernel debugging by connecting gdb to gdbserver as usual; and then, you can add those applications debugging information. You can also use .gdbinit script though. Read this