WinDBG extensions on VC7.1

Is there a way to execute a WinDBG extensions on VC7.1 ? I imagine no, but
I’m just wondering.
There is a dbgeng.dll in C:\Program Files\Microsoft Visual Studio .NET
2003\Common7\Packages\Debugger, a thunk, that redirects the DebugCreate()
call to natdbgde.dll. There is one in %windir%\system32 on XP that list as
“Symbolic Debug Engine for Windows 2000”, v 5.1.2600, but I don’t have
dbgeng.dll on my Windows 2000 machine… :slight_smile:

I tried the assert sample in the WinDBG SDK. Here are the results:
dbgeng.dll included with WinDBG does support assert (normal)
dbgeng.dll included with XP does not support assert = AttachProcess failed,
0x8007057 (Invalid parameter)
Probably has to do with non-invasive debugging?
dbgeng.dll included with VC7.1 does not support assert = DebugCreate
failed, 0x8007000E (Insuffisant memory)
Don’t know why DebugCreate fails. Probably it must be done in the context of
VS.NET.

I haven’t looked at the interfaces supported by them, I mean the interface
versions, for instance IDebugClient4 and al.

So the next logical step is to check why the XP version does not support
what I want (Do we have to ship dbgeng to all our customers? Is dbgeng
redistribuable? Don’t think so) and if I can inject my DLL in VC7.1, by
clean ways :), is it possible to use the VC7.1 debugger with the samples
included in the WinDBG SDK ? That’d be nice. (I need to try this).

By using an add-in, maybe it would be possible to use the command window
during debugging to call our extension? That would make Visual Studio much
more powerfull! Does the VB.NET macro system of VS.NET 2003 support a way of
loading and calling a DLL? I don’t know .NET so I’m glad if someone can
answer this.

If anyone knows so easy way to load and call WinDBG extensions DLL in VC7.1,
please go ahead and tell me.

M-A

I don’t know if it interrest anyone but I found out how to load a WinDBG
extension in VC7.1. The thing that told me I was on the right track was this
web page:
http://msdn.microsoft.com/library/en-us/vsdebug/html/vxtsksosdebugging.asp
They explicitly tell that you load a debugger extension inside Visual Studio
but no more.

So here it is:
First,
set _NT_DEBUGGER_EXTENSION_PATH environment variable to the path where you
hold your famous extensions.

Second,
Start up some project and debug it. Do a break.

Third,
In the command window, in *immediate mode*, type with your extension dll
name (no .dll necessary)
.load myext

Then you can call your extensions with
!my_fn

Here are the supported interface (those I looked for):
IDebugClient
IDebugControl
IDebugSymbols2
IDebugSymbols
IDebugDataSpaces2
IDebugDataSpaces
IDebugAdvanced
IDebugRegisters
IDebugSystemObjects

For instance, the newer versions of IDebugClient are not supported. I have
tested almost nothing but at least basic output works. That opens up a whole
new world to me :slight_smile: Specifically, I haven’t tested the usermode extension dll
shiped with windbg. That’s for tomorrow.

M-A

“Marc-Antoine Ruel” wrote in message news:xxxxx@windbg…
> Is there a way to execute a WinDBG extensions on VC7.1 ? I imagine no, but
> I’m just wondering.
> There is a dbgeng.dll in C:\Program Files\Microsoft Visual Studio .NET
> 2003\Common7\Packages\Debugger, a thunk, that redirects the DebugCreate()
> call to natdbgde.dll. There is one in %windir%\system32 on XP that list as
> “Symbolic Debug Engine for Windows 2000”, v 5.1.2600, but I don’t have
> dbgeng.dll on my Windows 2000 machine… :slight_smile:
>
> I tried the assert sample in the WinDBG SDK. Here are the results:
> dbgeng.dll included with WinDBG does support assert (normal)
> dbgeng.dll included with XP does not support assert = AttachProcess
failed,
> 0x8007057 (Invalid parameter)
> Probably has to do with non-invasive debugging?
> dbgeng.dll included with VC7.1 does not support assert = DebugCreate
> failed, 0x8007000E (Insuffisant memory)
> Don’t know why DebugCreate fails. Probably it must be done in the context
of
> VS.NET.
>
> I haven’t looked at the interfaces supported by them, I mean the interface
> versions, for instance IDebugClient4 and al.
>
> So the next logical step is to check why the XP version does not support
> what I want (Do we have to ship dbgeng to all our customers? Is dbgeng
> redistribuable? Don’t think so) and if I can inject my DLL in VC7.1, by
> clean ways :), is it possible to use the VC7.1 debugger with the samples
> included in the WinDBG SDK ? That’d be nice. (I need to try this).
>
> By using an add-in, maybe it would be possible to use the command window
> during debugging to call our extension? That would make Visual Studio much
> more powerfull! Does the VB.NET macro system of VS.NET 2003 support a way
of
> loading and calling a DLL? I don’t know .NET so I’m glad if someone can
> answer this.
>
> If anyone knows so easy way to load and call WinDBG extensions DLL in
VC7.1,
> please go ahead and tell me.
>
> M-A
>
>