How do you debug a custom KD extension dll, given that it IS the debugger?
Or is it possible to have multiple debug ports active at the same time?
Regards,
George.
How do you debug a custom KD extension dll, given that it IS the debugger?
Or is it possible to have multiple debug ports active at the same time?
Regards,
George.
You debug it with another debugger attached to the debugger process that
loaded your KDEXT.
The debugger controlling your KM target and running your KDTEXT is a UM
‘target’ for you other debugger instance.
It may seem a bit strange but you can start Windbg with a command line to
start Windbg (a new instance as the debugee) and have it attach to the KD
target.
Good Luck,
Dave Cattley
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of George M. Garner Jr.
Sent: Saturday, October 23, 2010 9:57 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Debugging custom KD extension DLL [was Re: custom debug
host driver]
How do you debug a custom KD extension dll, given that it IS the debugger?
Or is it possible to have multiple debug ports active at the same time?
Regards,
George.
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
I generally debug extensions using that miracle of debugging
technology “printf”.
Mark Roddy
On Sat, Oct 23, 2010 at 10:43 AM, David R. Cattley wrote:
> You debug it with another debugger attached to the debugger process that
> loaded your KDEXT.
>
> The debugger controlling your KM target and running your KDTEXT is a UM
> ‘target’ for you other debugger instance.
>
> It may seem a bit strange but you can start Windbg with a command line to
> start Windbg (a new instance as the debugee) and have it attach to the KD
> target.
>
> Good Luck,
> Dave Cattley
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of George M. Garner Jr.
> Sent: Saturday, October 23, 2010 9:57 AM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Debugging custom KD extension DLL [was Re: custom debug
> host driver]
>
> How do you debug a custom KD extension dll, given that it IS ?the debugger?
> Or is it possible to have multiple debug ports active at the same time?
>
> Regards,
>
> George.
>
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>
Thanks. I was thinking of something more along the lines of this:
http://www.jnode.org/node/2750#comment-13298.
If you run KVM with the -S switch it will halt the debugger right after
poweron (before the OS loads). Don’t know if Xen has a similar feature. It
seems to me that the approach taken by Skywing for VMWare assumes that you
do not have the source for the VM. See http://www.nynaeve.net/?p=167;
http://www.nynaeve.net/?p=169; http://www.nynaeve.net/?p=170; and
http://www.nynaeve.net/?p=171.
Since the OP has the source to the VM a cleaner solution would be to
integrate a KD stub into the VM similar to the GDB stub that many VM’s
currently have. The KD packet format is described here:
http://articles.sysprogs.org/kdvmware/kdcom.shtml. Since the stub would
have complete control over the VM’s address space, the stub could by-pass
kdcom.dll or alternately forward some requests on to kdcom.dll, as
appropriate. It is a little more work, of course.
Regards,
George.
“David R. Cattley” wrote in message news:xxxxx@ntdev…
> You debug it with another debugger attached to the debugger process that
> loaded your KDEXT.
>
Sorry, I completely miss-understood. I thought you were writing a debugger
extension. Not a debug transport extension. Huge difference and my (not
enough coffee) response was a complete miss.
I would write a simple output routine that wrote directly to COM port
(virtual) hardware and spit out printfs() like Mr. Roddy suggests capturing
them in the host environment in a console window. Crude but effective.
Cheers,
Dave Cattley
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of George M. Garner Jr.
Sent: Saturday, October 23, 2010 12:15 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Debugging custom KD extension DLL [was Re: custom debug
host driver]
Thanks. I was thinking of something more along the lines of this:
http://www.jnode.org/node/2750#comment-13298.
If you run KVM with the -S switch it will halt the debugger right after
poweron (before the OS loads). Don’t know if Xen has a similar feature. It
seems to me that the approach taken by Skywing for VMWare assumes that you
do not have the source for the VM. See http://www.nynaeve.net/?p=167;
http://www.nynaeve.net/?p=169; http://www.nynaeve.net/?p=170; and
http://www.nynaeve.net/?p=171.
Since the OP has the source to the VM a cleaner solution would be to
integrate a KD stub into the VM similar to the GDB stub that many VM’s
currently have. The KD packet format is described here:
http://articles.sysprogs.org/kdvmware/kdcom.shtml. Since the stub would
have complete control over the VM’s address space, the stub could by-pass
kdcom.dll or alternately forward some requests on to kdcom.dll, as
appropriate. It is a little more work, of course.
Regards,
George.
“David R. Cattley” wrote in message news:xxxxx@ntdev…
> You debug it with another debugger attached to the debugger process that
> loaded your KDEXT.
>
—
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
In fact, there’s even a convenient “.dbgdbg” command which will launch a new debugger which is configured to debug the current debugger, supplied exactly for this sort of scenario.
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of David R. Cattley
Sent: Saturday, October 23, 2010 7:44 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Debugging custom KD extension DLL [was Re: custom debug host driver]
You debug it with another debugger attached to the debugger process that loaded your KDEXT.
The debugger controlling your KM target and running your KDTEXT is a UM ‘target’ for you other debugger instance.
It may seem a bit strange but you can start Windbg with a command line to start Windbg (a new instance as the debugee) and have it attach to the KD target.
Good Luck,
Dave Cattley
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of George M. Garner Jr.
Sent: Saturday, October 23, 2010 9:57 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Debugging custom KD extension DLL [was Re: custom debug host driver]
How do you debug a custom KD extension dll, given that it IS the debugger?
Or is it possible to have multiple debug ports active at the same time?
Regards,
George.
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>miracle of debugging technology “printf”.
I also use this miracle of debugging, and not for debugging extensions, but for the usual code (or KdPrint in kernel).
–
Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com
All very nice but not on topic. If you have extraneous comments could you
please start a new thread. (I know how difficult this may be for the list,
but I ask your indulgence.)
Regards,
George.
“Skywing” wrote in message
news:xxxxx@ntdev…
In fact, there’s even a convenient “.dbgdbg” command which will launch a new
debugger which is configured to debug the current debugger, supplied exactly
for this sort of scenario.
- S