Discussion:
[win-pv-devel] How to debug windows drivers
c***@schulzalex.de
2018-11-27 23:19:49 UTC
Permalink
Hello @all,

is there a howto for debugging the PV-Drivers in Visual Studio? I tried
in Visual Studio 2012 and 2017 (Windows Kernel Mode Debuggers) but had
no luck so far. It seems that MS doesn't have a easy way to do this. I
read and tried all the stuff on MSDN (KDNET, WinDbg, etc.), but ... :-(

How do you debug these drivers?

Thanks for any advice or pointers!
--
Alexander Schulz
XCP-ng Project Member

Maintainer of: XCP-ng Center and XCP-ng PV-Tools


XCP-ng Project
--------------
web: https://xcp-ng.org
Github: https://github.com/xcp-ng
IRC: #xcp-ng on Freenode
Paul Durrant
2018-11-28 16:52:20 UTC
Permalink
-----Original Message-----
Sent: 27 November 2018 23:20
Subject: [win-pv-devel] How to debug windows drivers
is there a howto for debugging the PV-Drivers in Visual Studio? I tried
in Visual Studio 2012 and 2017 (Windows Kernel Mode Debuggers) but had
no luck so far. It seems that MS doesn't have a easy way to do this. I
read and tried all the stuff on MSDN (KDNET, WinDbg, etc.), but ... :-(
How do you debug these drivers?
What I normally do is set up a virtual serial port in QEMU and then set up Windows to debug via serial.

On your client machine you then need to use something to map a local pipe or serial port to that virtual serial device. There are several ways of doing it but the one I normally use is to have QEMU map the virtual serial port to a TCP socket and then I run a small daemon on my client machine that connects to that socket and pumps data between that and a named pipe. I then connect WinDbg to the named pipe.

HTH,

Paul
Thanks for any advice or pointers!
--
Alexander Schulz
XCP-ng Project Member
Maintainer of: XCP-ng Center and XCP-ng PV-Tools
XCP-ng Project
--------------
web: https://xcp-ng.org
Github: https://github.com/xcp-ng
IRC: #xcp-ng on Freenode
_______________________________________________
win-pv-devel mailing list
https://lists.xenproject.org/mailman/listinfo/win-pv-devel
Alexander Schulz
2018-11-28 23:25:28 UTC
Permalink
Hello @all, Hello Paul,

I tried this on XCP-ng, but without luck as you can read here:
https://xcp-ng.org/forum/topic/681/serial-port-from-vm

So I assume that you (Paul) just develop on plain XEN? Do you or someone
else know a proper way to do the debugging under XenServer/XCP-ng?
I wonder how Citrix devs do this ;-)

Thanks!

Alex
Post by Paul Durrant
-----Original Message-----
Sent: 27 November 2018 23:20
Subject: [win-pv-devel] How to debug windows drivers
is there a howto for debugging the PV-Drivers in Visual Studio? I tried
in Visual Studio 2012 and 2017 (Windows Kernel Mode Debuggers) but had
no luck so far. It seems that MS doesn't have a easy way to do this. I
read and tried all the stuff on MSDN (KDNET, WinDbg, etc.), but ... :-(
How do you debug these drivers?
What I normally do is set up a virtual serial port in QEMU and then set up Windows to debug via serial.
On your client machine you then need to use something to map a local pipe or serial port to that virtual serial device. There are several ways of doing it but the one I normally use is to have QEMU map the virtual serial port to a TCP socket and then I run a small daemon on my client machine that connects to that socket and pumps data between that and a named pipe. I then connect WinDbg to the named pipe.
HTH,
Paul
Thanks for any advice or pointers!
--
Alexander Schulz
XCP-ng Project Member
Maintainer of: XCP-ng Center and XCP-ng PV-Tools
XCP-ng Project
--------------
web: https://xcp-ng.org
Github: https://github.com/xcp-ng
IRC: #xcp-ng on Freenode
_______________________________________________
win-pv-devel mailing list
https://lists.xenproject.org/mailman/listinfo/win-pv-devel
_______________________________________________
win-pv-devel mailing list
https://lists.xenproject.org/mailman/listinfo/win-pv-devel
Paul Durrant
2018-11-29 10:46:27 UTC
Permalink
-----Original Message-----
Behalf Of Alexander Schulz
Sent: 28 November 2018 23:25
Subject: Re: [win-pv-devel] How to debug windows drivers
https://xcp-ng.org/forum/topic/681/serial-port-from-vm
So I assume that you (Paul) just develop on plain XEN? Do you or someone
else know a proper way to do the debugging under XenServer/XCP-ng?
I wonder how Citrix devs do this ;-)
I do indeed develop on plan Xen because I don't want anything XenServer-specific to leak into the upstream PV driver implementation. If you want to debug on XenServer then you're at the mercy of the XAPI toolstack and the fact it runs QEMU in a sandbox with a separate network namespace, and you'll need to find a way to turn that off.

Paul
Alexander Schulz
2018-11-29 23:21:11 UTC
Permalink
Thanks for your response Paul, I got it working in the latest version of
XCP-ng (7.6) :-)
Post by Paul Durrant
-----Original Message-----
Behalf Of Alexander Schulz
Sent: 28 November 2018 23:25
Subject: Re: [win-pv-devel] How to debug windows drivers
https://xcp-ng.org/forum/topic/681/serial-port-from-vm
So I assume that you (Paul) just develop on plain XEN? Do you or someone
else know a proper way to do the debugging under XenServer/XCP-ng?
I wonder how Citrix devs do this ;-)
I do indeed develop on plan Xen because I don't want anything XenServer-specific to leak into the upstream PV driver implementation. If you want to debug on XenServer then you're at the mercy of the XAPI toolstack and the fact it runs QEMU in a sandbox with a separate network namespace, and you'll need to find a way to turn that off.
Paul
_______________________________________________
win-pv-devel mailing list
https://lists.xenproject.org/mailman/listinfo/win-pv-devel
Loading...