www.digitalmars.com         C & C++   DMDScript  

c++.windows.32-bits - WinDBG questions

reply =?iso-8859-1?Q?Robert_M=2E_M=FCnch?= <robert.muench robertmuench.de> writes:
Hi, I try to use WinDBG to see how it works and made a "hello world"  
program to test it. I compiled with the -g compiler option. When  
opening the EXE in WinDBG I get this:

CommandLine: C:\Develop\metakit-2.4.9.3\demos\hello-world.exe
Symbol search path is: C:\Develop\metakit-2.4.9.3\demos
Executable search path is:
ModLoad: 00400000 00419000   image00400000
ModLoad: 7c910000 7c9c7000   ntdll.dll
ModLoad: 7c800000 7c906000   C:\WINDOWS\system32\kernel32.dll
ModLoad: 77d10000 77da0000   C:\WINDOWS\system32\USER32.DLL
ModLoad: 77ef0000 77f36000   C:\WINDOWS\system32\GDI32.dll
(1380.a98): Break instruction exception - code 80000003 (first chance)
eax=00251eb4 ebx=7ffd9000 ecx=00000007 edx=00000080 esi=00251f48  
edi=00251eb4
eip=7c911230 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:
7c911230 cc               int     3

So no symbols are found. Well, I thought the symbols are included in  
the EXE if compiled with -g. What do I need to do to get WinDBG  
compatible symbol files?

-- 
Robert M. Münch
Management & IT Freelancer
http://www.robertmuench.de
Sep 03 2005
next sibling parent =?iso-8859-1?Q?Robert_M=2E_M=FCnch?= <robert.muench robertmuench.de> writes:
Hi, one additon the "lm" command gives this:

0:000> lm
start    end        module name
00400000 00419000   image00400000 T (codeview symbols)      
C:\Develop\metakit-2.4.9.3\demos\hello-world.exe
77d10000 77da0000   USER32     (export symbols)        
C:\WINDOWS\system32\USER32.DLL
77ef0000 77f36000   GDI32      (export symbols)        
C:\WINDOWS\system32\GDI32.dll
7c800000 7c906000   kernel32   (export symbols)        
C:\WINDOWS\system32\kernel32.dll
7c910000 7c9c7000   ntdll      (export symbols)        
C:\WINDOWS\system32\ntdll.dll

So it looks like there are symbols in the EXE. But I don't see any  
source code pointer nor function names.

-- 
Robert M. Münch
Management & IT Freelancer
http://www.robertmuench.de
Sep 03 2005
prev sibling next sibling parent "Walter Bright" <newshound digitalmars.com> writes:
Try this:
    windbg hello-world.exe
then set a breakpoint on _main and run to the breakpoint.
Sep 05 2005
prev sibling parent Scott Michel <scottm aero.org> writes:
Robert:

You need to install the debugging symbols for the various system 
libraries. This is or should be part of the Windows Debugging package 
you installed. Of course, installation gets complicated by the various 
upgrades and patches and the version of Windows you're running.

Actually, you can just safely ignore the message, and as Walter pointed 
out, set a breakpoint in _main.


-scooter

Robert M. Münch wrote:
 Hi, I try to use WinDBG to see how it works and made a "hello world"  
 program to test it. I compiled with the -g compiler option. When  
 opening the EXE in WinDBG I get this:
 
 CommandLine: C:\Develop\metakit-2.4.9.3\demos\hello-world.exe
 Symbol search path is: C:\Develop\metakit-2.4.9.3\demos
 Executable search path is:
 ModLoad: 00400000 00419000   image00400000
 ModLoad: 7c910000 7c9c7000   ntdll.dll
 ModLoad: 7c800000 7c906000   C:\WINDOWS\system32\kernel32.dll
 ModLoad: 77d10000 77da0000   C:\WINDOWS\system32\USER32.DLL
 ModLoad: 77ef0000 77f36000   C:\WINDOWS\system32\GDI32.dll
 (1380.a98): Break instruction exception - code 80000003 (first chance)
 eax=00251eb4 ebx=7ffd9000 ecx=00000007 edx=00000080 esi=00251f48  
 edi=00251eb4
 eip=7c911230 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:
 7c911230 cc               int     3
 
 So no symbols are found. Well, I thought the symbols are included in  
 the EXE if compiled with -g. What do I need to do to get WinDBG  
 compatible symbol files?
 
Sep 12 2005