Code::Blocks
September 18, 2014, 09:41:43 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: When registered with our forums, feel free to send a "here I am" post in http://forums.codeblocks.org/index.php/topic,14168.0.html to differ human beings from SPAM bots.
 
   Home   Help Search Login Register  :: WebsiteWiki  
Pages: [1]   Go Down
  Send this topic  |  Print  
Author Topic: Debugger unresponsive -- C::B 10.07 + MSVC 10 + msoft debugging tools  (Read 3068 times)
cellulose
Advanced newcomer
*
Offline Offline

Posts: 20



« on: January 09, 2012, 09:46:53 pm »

Hello fellow Codeblockians.  Longtime user and crossplatform dev here, though I don't visit the forums much.

I migrated my Windows/SDL project from cygwin to MSVC 10 as I switched computers recently.

Things are getting close to functional, but I've got a crash and the MSVC debugger is being rather uncooperative.  I've installed the downloadable version of the Windows 7 SP1 x64 symbols, but it doesn't seem to change my symptoms:

Code: (debugger output)
Building to ensure sources are up-to-date
Build succeeded
Selecting target:
Debug
Adding source dir: C:\Projects\Plaidgadget\dev\
Adding source dir: C:\Projects\Plaidgadget\dev\
Changing directory to: game/
Adding file: build\win\Savior-dbg.exe
Starting debugger:
done
Setting breakpoints
Microsoft (R) Windows Debugger Version 6.12.0002.633 AMD64
Copyright (c) Microsoft Corporation. All rights reserved.
CommandLine: build/win/Savior-dbg.exe
Symbol search path is: C:/Projects/Plaidgadget/dev/
Executable search path is:
ModLoad: 00000000`010f0000 00000000`01d77000   Savior-dbg.exe
ModLoad: 00000000`77780000 00000000`77929000   ntdll.dll
ModLoad: 00000000`77960000 00000000`77ae0000   ntdll32.dll
ModLoad: 00000000`73710000 00000000`7374f000   C:\Windows\SYSTEM32\wow64.dll
ModLoad: 00000000`736b0000 00000000`7370c000   C:\Windows\SYSTEM32\wow64win.dll
ModLoad: 00000000`736a0000 00000000`736a8000   C:\Windows\SYSTEM32\wow64cpu.dll
(18a8.42c): Break instruction exception - code 80000003 (first chance)
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for ntdll.dll -
ntdll!CsrSetPriorityClass+0x40:
00000000`7782cb60 cc              int     3

(the printout halts here and I'm unable to terminate the debugger or start a new session without closing Code::Blocks)


Notable weird things about my setup:
- My debug DLLs and EXE are in a separate location from the program's working directory.
- I use SCONS (a makefile replacement) to build the project rather than Code::Blocks' build system.



EDIT:  I set the _NT_SYMBOL_PATH variable (to my installed symbols' location) which solved the failure to load NTDLL.dll symbols, but the hang persists:

Code: (debugger output)
Building to ensure sources are up-to-date
Build succeeded
Selecting target:
Debug
Adding source dir: C:\Projects\Plaidgadget\dev\
Adding source dir: C:\Projects\Plaidgadget\dev\
Changing directory to: game/
Adding file: build\win\Savior-dbg.exe
Starting debugger:
done
Setting breakpoints
Microsoft (R) Windows Debugger Version 6.12.0002.633 AMD64
Copyright (c) Microsoft Corporation. All rights reserved.
CommandLine: build/win/Savior-dbg.exe
Symbol search path is: C:/Projects/Plaidgadget/dev/;C:\Symbols\
Executable search path is:
ModLoad: 00000000`010f0000 00000000`01d77000   Savior-dbg.exe
ModLoad: 00000000`77780000 00000000`77929000   ntdll.dll
ModLoad: 00000000`77960000 00000000`77ae0000   ntdll32.dll
ModLoad: 00000000`73710000 00000000`7374f000   C:\Windows\SYSTEM32\wow64.dll
ModLoad: 00000000`736b0000 00000000`7370c000   C:\Windows\SYSTEM32\wow64win.dll
ModLoad: 00000000`736a0000 00000000`736a8000   C:\Windows\SYSTEM32\wow64cpu.dll
(16f4.df0): Break instruction exception - code 80000003 (first chance)
ntdll!LdrpDoDebuggerBreak+0x30:
00000000`7782cb60 cc              int     3

Next theory:  Is it because it's breaking in SDLmain, and it can't find the source for that function?
« Last Edit: January 09, 2012, 10:03:41 pm by cellulose » Logged
oBFusCATed
Developer
Lives here!
*****
Offline Offline

Posts: 7599


« Reply #1 on: January 09, 2012, 10:15:00 pm »

Are you sure you have debugging info embedded in the executable?
Also do you use the same arch for debugger and executable.
I'd trouble debugging my test 32bit apps with 64 bit debugger.
So, I advise you to keep them in sync.
Also you can try the latest debugger branch nightly build, it has some improvements in regard to CDB.

BTW, does debugging symple hello world apps work?
Logged

<debugger plugin maintainer>
(most of the time I ignore long posts)
cellulose
Advanced newcomer
*
Offline Offline

Posts: 20



« Reply #2 on: January 09, 2012, 10:30:40 pm »

Speak of the devil.  I'd just seen this on the wiki:

Quote
It seems that debugging a 32bit program with 64bit CDB doesn't work on Windows 7, but 32bit CDB works perfectly.

Tried a quick hello world program and it did not work.  I'll look for a 32-bit version of CDB...

EDIT: getting one through the Windows SDK installer.  My fingers are crossed~!
« Last Edit: January 09, 2012, 10:33:02 pm by cellulose » Logged
cellulose
Advanced newcomer
*
Offline Offline

Posts: 20



« Reply #3 on: January 09, 2012, 10:54:34 pm »

Mind the doublepost.

So.  Installed the x86 version of the debugging tools and configured C::B to use them.  Still hanging, still can't terminate, but!  I think installing the symbols from here might be a fix.

In the meantime, does anyone know how I can set the debugger to skip its initial breakpoint?

Code: (debugger output)
Building to ensure sources are up-to-date
Build succeeded
Selecting target:
Debug
Adding source dir: C:\Projects\Plaidgadget\dev\
Adding source dir: C:\Projects\Plaidgadget\dev\
Changing directory to: game/
Adding file: build\win\Savior-dbg.exe
Starting debugger:
done
Setting breakpoints
Microsoft (R) Windows Debugger Version 6.12.0002.633 X86
Copyright (c) Microsoft Corporation. All rights reserved.
CommandLine: build/win/Savior-dbg.exe
Symbol search path is: C:/Projects/Plaidgadget/dev/;C:\Symbols\
Executable search path is:
ModLoad: 012e0000 01f67000   Savior-dbg.exe
ModLoad: 77960000 77ae0000   ntdll.dll
ModLoad: 76eb0000 76fc0000   C:\Windows\syswow64\kernel32.dll
ModLoad: 75310000 75356000   C:\Windows\syswow64\KERNELBASE.dll
ModLoad: 723d0000 72404000   C:\Program Files\AVAST Software\Avast\snxhk.dll
ModLoad: 69890000 6991c000   C:\Projects\Plaidgadget\dev\build\win\SDL_net.dll
ModLoad: 73470000 73477000   C:\Windows\SysWOW64\WSOCK32.dll
ModLoad: 76e70000 76ea5000   C:\Windows\syswow64\WS2_32.dll
ModLoad: 750a0000 7514c000   C:\Windows\syswow64\msvcrt.dll
ModLoad: 768b0000 769a0000   C:\Windows\syswow64\RPCRT4.dll
ModLoad: 75040000 750a0000   C:\Windows\syswow64\SspiCli.dll
ModLoad: 75030000 7503c000   C:\Windows\syswow64\CRYPTBASE.dll
ModLoad: 76fc0000 76fd9000   C:\Windows\SysWOW64\sechost.dll
ModLoad: 75420000 75426000   C:\Windows\syswow64\NSI.dll
ModLoad: 65be0000 65cd7000   C:\Projects\Plaidgadget\dev\build\win\SDL.dll
ModLoad: 72250000 72282000   C:\Windows\SysWOW64\WINMM.dll
ModLoad: 75430000 75530000   C:\Windows\syswow64\USER32.dll
ModLoad: 75280000 75310000   C:\Windows\syswow64\GDI32.dll
ModLoad: 76e60000 76e6a000   C:\Windows\syswow64\LPK.dll
ModLoad: 76a40000 76add000   C:\Windows\syswow64\USP10.dll
ModLoad: 769a0000 76a40000   C:\Windows\syswow64\ADVAPI32.dll
ModLoad: 10000000 10148000   C:\Projects\Plaidgadget\dev\build\win\mpir.dll
ModLoad: 697c0000 69888000   C:\Windows\SysWOW64\OPENGL32.dll
ModLoad: 6cbc0000 6cbe2000   C:\Windows\SysWOW64\GLU32.dll
ModLoad: 747e0000 748c7000   C:\Windows\SysWOW64\DDRAW.dll
ModLoad: 747d0000 747d6000   C:\Windows\SysWOW64\DCIMAN32.dll
ModLoad: 76470000 7660d000   C:\Windows\syswow64\SETUPAPI.dll
ModLoad: 76fe0000 77007000   C:\Windows\syswow64\CFGMGR32.dll
ModLoad: 77010000 7709f000   C:\Windows\syswow64\OLEAUT32.dll
ModLoad: 76610000 7676c000   C:\Windows\syswow64\ole32.dll
ModLoad: 76890000 768a2000   C:\Windows\syswow64\DEVOBJ.dll
ModLoad: 747b0000 747c3000   C:\Windows\SysWOW64\dwmapi.dll
(1100.2158): Break instruction exception - code 80000003 (first chance)
eax=00000000 ebx=00000000 ecx=13880000 edx=0025de18 esi=fffffffe edi=00000000
eip=77a00f3b esp=0039fa44 ebp=0039fa70 iopl=0         nv up ei pl zr na pe nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00000246
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for ntdll.dll -
ntdll!LdrVerifyImageMatchesChecksum+0x96c:
77a00f3b cc              int     3
Logged
oBFusCATed
Developer
Lives here!
*****
Offline Offline

Posts: 7599


« Reply #4 on: January 09, 2012, 11:02:18 pm »

Does it work, from the command line?
Logged

<debugger plugin maintainer>
(most of the time I ignore long posts)
cellulose
Advanced newcomer
*
Offline Offline

Posts: 20



« Reply #5 on: January 09, 2012, 11:10:08 pm »

It appears to work from the command line, though I need to input the "g" command twice before it gets to running the program.  Once on a warning about C:/symbols missing (as I've uninstalled the x64 symbols and am downloading the x86 ones) and once on an initial breakpoint.

After that it proceeds promptly to my program's crash.  Smiley


EDIT:  Using 'g' on Code::Blocks' command prompt sadly has no effect...


EDIT 2: This looks foreboding considering my separate-build-and-working-directory setup:  http://forums.codeblocks.org/index.php?topic=14085.0


EDIT 3:  here's my command-line run, prior to the second 'g' command which starts my program:

Code: (cmd.exe)
C:\Projects\Plaidgadget\dev\game>"C:/Program Files (x86)/Debugging tools for windows (x86)/cdb.exe" cdb ../build/win/Sav
ior-dbg.exe

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

CommandLine: cdb ../build/win/Savior-dbg.exe
WARNING: Inaccessible path: 'C:\Symbols\'
Symbol search path is: C:\Symbols\
Executable search path is:
ModLoad: 00ee0000 00f40000   cdb.exe
ModLoad: 77960000 77ae0000   ntdll.dll
ModLoad: 76eb0000 76fc0000   C:\Windows\syswow64\kernel32.dll
ModLoad: 75310000 75356000   C:\Windows\syswow64\KERNELBASE.dll
ModLoad: 723d0000 72404000   C:\Program Files\AVAST Software\Avast\snxhk.dll
ModLoad: 750a0000 7514c000   C:\Windows\syswow64\msvcrt.dll
ModLoad: 65530000 658cb000   C:\Program Files (x86)\Debugging tools for windows (x86)\dbgeng.dll
ModLoad: 653e0000 65521000   C:\Program Files (x86)\Debugging tools for windows (x86)\dbghelp.dll
ModLoad: 73460000 73469000   C:\Windows\SysWOW64\VERSION.dll
ModLoad: 769a0000 76a40000   C:\Windows\syswow64\ADVAPI32.dll
ModLoad: 76fc0000 76fd9000   C:\Windows\SysWOW64\sechost.dll
ModLoad: 768b0000 769a0000   C:\Windows\syswow64\RPCRT4.dll
ModLoad: 75040000 750a0000   C:\Windows\syswow64\SspiCli.dll
ModLoad: 75030000 7503c000   C:\Windows\syswow64\CRYPTBASE.dll
(21e4.21a8): Break instruction exception - code 80000003 (first chance)
eax=00000000 ebx=00000000 ecx=33870000 edx=001adf88 esi=fffffffe edi=00000000
eip=77a00f3b esp=0021f490 ebp=0021f4bc iopl=0         nv up ei pl zr na pe nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00000246
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for ntdll.dll -
ntdll!LdrVerifyImageMatchesChecksum+0x96c:
77a00f3b cc              int     3
0:000> g

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

CommandLine: ../build/win/Savior-dbg.exe
ModLoad: 746a0000 746ec000   C:\Windows\SysWOW64\apphelp.dll
(21e4.21a8): Illegal instruction - code c000001d (first chance)
ModLoad: 63d70000 64069000   C:\Program Files (x86)\Debugging tools for windows (x86)\winext\ext.dll
ModLoad: 68a10000 68a85000   C:\Program Files (x86)\Debugging tools for windows (x86)\WINXP\exts.dll
ModLoad: 697d0000 697ed000   C:\Program Files (x86)\Debugging tools for windows (x86)\winext\uext.dll
ModLoad: 67c00000 67c16000   C:\Program Files (x86)\Debugging tools for windows (x86)\WINXP\ntsdexts.dll
ModLoad: 697c0000 697cb000   C:\Program Files (x86)\Debugging tools for windows (x86)\WINXP\wow64exts.dll
WARNING: Inaccessible path: 'C:\Symbols\'
Symbol search path is: C:\Symbols\
Executable search path is:
ModLoad: 012e0000 01f67000   Savior-dbg.exe
ModLoad: 77960000 77ae0000   ntdll.dll
ModLoad: 76eb0000 76fc0000   C:\Windows\syswow64\kernel32.dll
ModLoad: 75310000 75356000   C:\Windows\syswow64\KERNELBASE.dll
ModLoad: 723d0000 72404000   C:\Program Files\AVAST Software\Avast\snxhk.dll
ModLoad: 65990000 65a1c000   C:\Projects\Plaidgadget\dev\build\win\SDL_net.dll
ModLoad: 73470000 73477000   C:\Windows\SysWOW64\WSOCK32.dll
ModLoad: 76e70000 76ea5000   C:\Windows\syswow64\WS2_32.dll
ModLoad: 750a0000 7514c000   C:\Windows\syswow64\msvcrt.dll
ModLoad: 768b0000 769a0000   C:\Windows\syswow64\RPCRT4.dll
ModLoad: 75040000 750a0000   C:\Windows\syswow64\SspiCli.dll
ModLoad: 75030000 7503c000   C:\Windows\syswow64\CRYPTBASE.dll
ModLoad: 76fc0000 76fd9000   C:\Windows\SysWOW64\sechost.dll
ModLoad: 75420000 75426000   C:\Windows\syswow64\NSI.dll
ModLoad: 63c70000 63d67000   C:\Projects\Plaidgadget\dev\build\win\SDL.dll
ModLoad: 72250000 72282000   C:\Windows\SysWOW64\WINMM.dll
ModLoad: 75430000 75530000   C:\Windows\syswow64\USER32.dll
ModLoad: 75280000 75310000   C:\Windows\syswow64\GDI32.dll
ModLoad: 76e60000 76e6a000   C:\Windows\syswow64\LPK.dll
ModLoad: 76a40000 76add000   C:\Windows\syswow64\USP10.dll
ModLoad: 769a0000 76a40000   C:\Windows\syswow64\ADVAPI32.dll
ModLoad: 10000000 10148000   C:\Projects\Plaidgadget\dev\build\win\mpir.dll
ModLoad: 63ba0000 63c68000   C:\Windows\SysWOW64\OPENGL32.dll
ModLoad: 67bd0000 67bf2000   C:\Windows\SysWOW64\GLU32.dll
ModLoad: 747e0000 748c7000   C:\Windows\SysWOW64\DDRAW.dll
ModLoad: 747d0000 747d6000   C:\Windows\SysWOW64\DCIMAN32.dll
ModLoad: 76470000 7660d000   C:\Windows\syswow64\SETUPAPI.dll
ModLoad: 76fe0000 77007000   C:\Windows\syswow64\CFGMGR32.dll
ModLoad: 77010000 7709f000   C:\Windows\syswow64\OLEAUT32.dll
ModLoad: 76610000 7676c000   C:\Windows\syswow64\ole32.dll
ModLoad: 76890000 768a2000   C:\Windows\syswow64\DEVOBJ.dll
ModLoad: 747b0000 747c3000   C:\Windows\SysWOW64\dwmapi.dll
(2298.208c): Break instruction exception - code 80000003 (first chance)
ModLoad: 76ae0000 76ae5000   C:\Windows\SysWOW64\psapi.dll
ModLoad: 65a20000 65a68000   C:\Program Files (x86)\Debugging tools for windows (x86)\symsrv.dll
eax=00000000 ebx=00000000 ecx=29b50000 edx=001be168 esi=fffffffe edi=00000000
eip=77a00f3b esp=0015f9f0 ebp=0015fa1c iopl=0         nv up ei pl zr na pe nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00000246
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for ntdll.dll -
ntdll!LdrVerifyImageMatchesChecksum+0x96c:
77a00f3b cc              int     3
0:000>
« Last Edit: January 09, 2012, 11:18:08 pm by cellulose » Logged
oBFusCATed
Developer
Lives here!
*****
Offline Offline

Posts: 7599


« Reply #6 on: January 09, 2012, 11:44:05 pm »

Have you tried a debugger's branch nightly build then?
Logged

<debugger plugin maintainer>
(most of the time I ignore long posts)
cellulose
Advanced newcomer
*
Offline Offline

Posts: 20



« Reply #7 on: January 09, 2012, 11:55:40 pm »

Not just yet.  :\  If I run out of other avenues of investigation, I will.

I noticed just now that my command-line debug was actually two debug sessions, nested.  I'm installing the x86 symbols now to see if they remedy that; it seems like something that would definitely throw C::B through a loop.

...

Okay, so this is very strange.  CDB is debugging ITSELF, debugging my executable, when I start it on the command line.  Is this normal?

And installing the symbol package removed the errors, but did not fix the unresponsive debug terminal.

Some more info:
- I'm using a custom compiler/debugger config for MSVC 2010, as it was not among the available options initially.
- When I close Code::Blocks to halt the debugging, it displays an "unable to stop the debug process!" dialog, twice.


EDIT:  Out of ideas; I'll try out that nightly build...
« Last Edit: January 09, 2012, 11:58:23 pm by cellulose » Logged
cellulose
Advanced newcomer
*
Offline Offline

Posts: 20



« Reply #8 on: January 10, 2012, 12:12:44 am »

The debugger branch version works!  Does this mean RC2 (by which I mean 10.07) doesn't support CDB?


Anyway, I'll remark that while MSVC 2010 autodetection works very well, the fact that I need to navigate into a menu labeled "GDB ONLY!" to configure CDB, and thereafter tell MSVC's configuration to use "GDB", is super unintuitive.  But it does the job and I appreciate this very much.  <3
« Last Edit: January 10, 2012, 12:34:38 am by cellulose » Logged
oBFusCATed
Developer
Lives here!
*****
Offline Offline

Posts: 7599


« Reply #9 on: January 10, 2012, 01:40:37 am »

I don't know what 10.07 is, the last official release was 10.05, and it support some version of CDB is some way.
What I know is that I've fixed some things related to CDB support and I'm happy that it works for you, too.
Logged

<debugger plugin maintainer>
(most of the time I ignore long posts)
cellulose
Advanced newcomer
*
Offline Offline

Posts: 20



« Reply #10 on: January 10, 2012, 04:03:45 am »

10.05, I meant.

Nightly builds work a lot more naturally than I expected them to, though.  Consider me impressed.
Logged
Pages: [1]   Go Up
  Send this topic  |  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!