thread-aware gdb for the Linux kernel

前端 未结 3 1116
礼貌的吻别
礼貌的吻别 2020-12-21 14:00

I am using gdb attached to a serial port of a virtual machine to debug linux kernel.

I am wondering, if there is any patches/plugins which can make the gdb understa

3条回答
  •  太阳男子
    2020-12-21 14:53

    pyvmidbg developer here.

    I will add some clarifications: yes the goal of the project is indeed to have a cross-platform, guest-aware GDB stub.

    Most of the implementation is already done for Windows, where we are aware of processes and their threads context. It's possible to intercept a specific process (cmd.exe in the demo) and singlestep its execution (this is limited to 1 process with 1 thread for now), as well as attaching to a new process's entrypoint.

    Regarding Linux, I looked at the internals and the resources that I could find, but I'm lacking the whole picture to figure out how I can: - intercept a task when it's being scheduled (core/sched.c:switch_to() ?) - read the task state (Windows's KTRAP_FRAME equivalent for Linux ?)

    I asked a question on SO, but nobody answered :/ Linux context switch internals: how does a process goes back to userland after the switch?

    If you can help with this, I can guide you through the implementation :)

    Regarding the hypervisor support, only Xen is fully supported in the Libvmi interface at the moment. I added a section in the README to describe where we are in terms of VMI APIs with other hypervisors.

    Thanks !

提交回复
热议问题