debugging

  • Thread starter Thread starter Bonj
  • Start date Start date
B

Bonj

is there a way, using windbg.exe and dbgclr.exe together, to debug a mixed
DLL? (without using VS IDE)
i.e., to sort of make windbg "take over" when it gets to the unmanaged
part...
?
 
You can use windbg and SOS (Son Of Strike) together. Google the MSDN site
for instructions.

Ronald Laeremans
Visual C++ team
 
Is it possible to download this SOS thing?


Ronald Laeremans said:
You can use windbg and SOS (Son Of Strike) together. Google the MSDN site
for instructions.

Ronald Laeremans
Visual C++ team
 
Doesn't it not come already with the debugger package or with the framework
itself ?

D:\Program Files\Debugging Tools for Windows\clr10\sos.dll

D:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\sos.dll

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
 
Oh yes, I have got it. But it doesn't work.
Sorry for being a bit thick here, but if I take the following steps, am I
doing it right?

1) Open a command prompt, run the environment variables batch file, and
build the managed program in debug mode
2) Start windbg.exe, and open the source files
3) Go to 'File', 'Open Executable', and choose the program that I built
4) Type ".load sos" in the command window. (When I do this, it does nothing
great, but doesn't complain.)
5) Set a breakpoint, and press F5.... but it doesn't get hit and the program
carries on oblivious

Then should it be able to debug managed code?
Or is there a whole load of other things I need to do for it to succeed?
 
Ivan, I did exactly what it said in this article
http://msdn.microsoft.com/msdnmag/issues/03/06/Bugslayer/default.aspx
and it resulted in an error. The output was this:

Symbol search path is: C:\Documents and Settings\TheMagicBonj\My
Documents\Installers\DebuggingTools\bugslayer0306\bin\Debug

Microsoft (R) Windows Debugger Version 6.3.0017.0
Copyright (c) Microsoft Corporation. All rights reserved.

CommandLine: "C:\Documents and Settings\TheMagicBonj\My
Documents\Installers\DebuggingTools\bugslayer0306\bin\Debug\ExceptApp.exe"
Symbol search path is: C:\Documents and Settings\TheMagicBonj\My
Documents\Installers\DebuggingTools\bugslayer0306\bin\Debug
Executable search path is:
ModLoad: 00400000 00408000 ExceptApp.exe
ModLoad: 7c900000 7c9b0000 ntdll.dll
ModLoad: 78800000 7883a000 C:\WINDOWS\system32\mscoree.dll
ModLoad: 7c800000 7c8f4000 C:\WINDOWS\system32\KERNEL32.dll
ModLoad: 77dd0000 77e6b000 C:\WINDOWS\system32\ADVAPI32.dll
ModLoad: 77e70000 77f01000 C:\WINDOWS\system32\RPCRT4.dll
(d30.694): Break instruction exception - code 80000003 (first chance)
eax=00241eb4 ebx=7ffdc000 ecx=00000007 edx=00000080 esi=00241f48
edi=00241eb4
eip=7c901230 esp=0012fb20 ebp=0012fc94 iopl=0 nv up ei pl nz na pe
nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000
efl=00000202
*** ERROR: Symbol file could not be found. Defaulted to export symbols for
ntdll.dll -
ntdll!DbgBreakPoint:
7c901230 cc int 3
0:000> g
ModLoad: 77f60000 77fd6000 C:\WINDOWS\system32\SHLWAPI.dll
ModLoad: 77c10000 77c68000 C:\WINDOWS\system32\msvcrt.dll
ModLoad: 77f10000 77f56000 C:\WINDOWS\system32\GDI32.dll
ModLoad: 77d40000 77dd0000 C:\WINDOWS\system32\USER32.dll
ModLoad: 791b0000 793e2000
C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\mscorwks.dll
ModLoad: 7c000000 7c054000
C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\MSVCR70.dll
ModLoad: 79040000 79079000
C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\fusion.dll
ModLoad: 7c9c0000 7d1d4000 C:\WINDOWS\system32\SHELL32.dll
ModLoad: 773d0000 774d2000
C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll
ModLoad: 5d090000 5d127000 C:\WINDOWS\system32\comctl32.dll
ModLoad: 79780000 7996c000
c:\windows\microsoft.net\framework\v1.0.3705\mscorlib.dll
ModLoad: 79970000 79c98000
c:\windows\assembly\nativeimages1_v1.0.3705\mscorlib\1.0.3300.0__b77a5c561934e089_d3f49f0e\mscorlib.dll
ModLoad: 79510000 79521000
C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\mscorsn.dll
ModLoad: 79430000 7947a000
C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\MSCORJIT.DLL
ModLoad: 51820000 5188b000
C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\diasymreader.dll
ModLoad: 774e0000 7761c000 C:\WINDOWS\system32\ole32.dll
(d30.694): CLR exception - code e0434f4d (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
eax=0012f4fc ebx=00aae168 ecx=0014d648 edx=00002aba esi=00000000
edi=00000000
eip=7c81eb33 esp=0012f4f8 ebp=0012f54c iopl=0 nv up ei pl zr na po
nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000
efl=00000246
*** ERROR: Symbol file could not be found. Defaulted to export symbols for
C:\WINDOWS\system32\KERNEL32.dll -
KERNEL32!RaiseException+0x52:
7c81eb33 5e pop esi
0:000> .load sos
0:000> !threads
*** ERROR: Symbol file could not be found. Defaulted to export symbols for
C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\mscorwks.dll -
PDB symbol for mscorwks.dll not loaded
failed to load from resource.Failed to load SOS data.
No valid SOS data table found.
 
Yes, the symbol path was set to the same path that the exe is in, that also
contains the .pdb file that was created by csc.exe (it confirms this in the
first few lines of the output).
Do I need to set any other symbol paths that contain other .pdb files?
 
No - should it?
It looks like the one it is complaining about it mscorwks.
I've noticed on my work computer that it has got mscorwks.pdb in
C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\symbols
but I don't know whether that will work at home where I've only got the SDK
installed, not the full Visual Studio (the directory name seems a bit of a
contradiction in terms...)
but I'll see if I've got that when I get home
 
I found this not to be the problem.
I set my symbol path to have c:\program files\microsft.net\sdk\v2.0\symbols
and it did the same thing!
 
Back
Top