Kernel debugger + user-mode CLR debugger

I know that there are currently problems using a CLR / .NET debugger on a
machine whose kernel is also being debugged. (i.e. it just doesn’t work)
But it is very hard to find any information about why this is the case, or
when it will be fixed.

Can someone point me to an article describing why CLR debugging is
incompatible with kernel debugging? Also, the version of DbgCLR.exe that
comes with the .Net 2.0 Framework SDK hints that there is documentation that
describes how to configure the kernel debugger to allow user-mode debugging
to work. WHERE?!?!? I’ve searched MSDN (online and local), and everywhere
I can find, and I can’t find this info.

Any help is greatly appreciated. I really don’t want to go back to printf
(errr, Debug.WriteLine) debugging.

Thanks.

– arlie

Things aren’t incompatible, just inconvenient. The CLR debugging
support inserts break instructions to cause breaks and causes
single-steps like any usual debugger. It needs to get the resulting
exceptions to function. However, it doesn’t attach to the debuggee as a
Win32 debugger and instead relies on the CLR in-proc catching the
exceptions and forwarding them to the debugger. If you have a kernel
debugger active on the machine the kernel debugger will get these
exceptions, see that the process has no user-mode debugger and will
break in. You can ‘gn’ in kd to have these exceptions sent on. You
can’t really use the ‘gn’ much, though, as Visual Studio makes a
specific check for kd and fails to avoid having users hit this.

If you install a Windows Debugger package you’ll get a tool called
kdbgctrl.exe. On Windows Server 2003 and newer you can use kdbgctrl -du
to stop kd from handling any UM exceptions. You can also use kdbgctrl
-d to suspend kd entirely. I’m not an expert on Visual Studio but I
believe that will allow it to run.


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Arlie Davis
Sent: Wednesday, November 09, 2005 3:09 PM
To: Kernel Debugging Interest List
Subject: [windbg] Kernel debugger + user-mode CLR debugger

I know that there are currently problems using a CLR / .NET debugger on
a machine whose kernel is also being debugged. (i.e. it just doesn’t
work) But it is very hard to find any information about why this is the
case, or when it will be fixed.

Can someone point me to an article describing why CLR debugging is
incompatible with kernel debugging? Also, the version of DbgCLR.exe
that comes with the .Net 2.0 Framework SDK hints that there is
documentation that describes how to configure the kernel debugger to
allow user-mode debugging to work. WHERE?!?!? I’ve searched MSDN
(online and local), and everywhere I can find, and I can’t find this
info.

Any help is greatly appreciated. I really don’t want to go back to
printf (errr, Debug.WriteLine) debugging.

Thanks.

– arlie


You are currently subscribed to windbg as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

I’ve run into this problem in the past myself and I came up with a workaround. I don’t know if this works with .NET 2.0 but it worked with .NET 1.1. See http://www.osronline.com/showThread.cfm?link=64493 for a possible solution to this problem.

  • Steve -

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Arlie Davis
Sent: Wednesday, November 09, 2005 6:09 PM
To: Kernel Debugging Interest List
Subject: [windbg] Kernel debugger + user-mode CLR debugger

I know that there are currently problems using a CLR / .NET debugger on a machine whose kernel is also being debugged.? (i.e. it just doesn’t work)? But it is very hard to find any information about why this is the case, or when it will be fixed.
?
Can someone point me to an article describing why CLR debugging is incompatible with kernel debugging?? Also, the version of DbgCLR.exe that comes with the .Net 2.0 Framework SDK hints that there is documentation that describes how to configure the kernel debugger to allow user-mode debugging to work.? WHERE?!?!?? I’ve searched MSDN (online and local), and everywhere I can find, and I can’t find this info.
?
Any help is greatly appreciated.? I really don’t want to go back to printf (errr, Debug.WriteLine) debugging.
?
Thanks.
?
– arlie
?


You are currently subscribed to windbg as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

Ahhhhh, that worked. Simply enabling mixed-mode debugging solved the
problem.

Microsoft: Please provide better documentation for this! We all want to
move to managed languages, right? And you guys want us to move to managed
languages, right? A decent, *findable* KB article, or a help link on the
dialog box that warns you about managed debugging, would have prevented a
lot of wasted time for me, and probably for other developers.

Thanks, Steve.

– arlie

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Whitman, Steve
Sent: Thursday, November 10, 2005 9:33 AM
To: Kernel Debugging Interest List
Subject: RE: [windbg] Kernel debugger + user-mode CLR debugger

I’ve run into this problem in the past myself and I came up with a
workaround. I don’t know if this works with .NET 2.0 but it worked with
.NET 1.1. See http://www.osronline.com/showThread.cfm?link=64493 for a
possible solution to this problem.

  • Steve -