Author Topic: Debugger unresponsive -- C::B 10.07 + MSVC 10 + msoft debugging tools  (Read 5477 times)

Offline cellulose

  • Multiple posting newcomer
  • *
  • Posts: 20
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: Text
  1. Building to ensure sources are up-to-date
  2. Build succeeded
  3. Selecting target:
  4. Debug
  5. Adding source dir: C:\Projects\Plaidgadget\dev\
  6. Adding source dir: C:\Projects\Plaidgadget\dev\
  7. Changing directory to: game/
  8. Adding file: build\win\Savior-dbg.exe
  9. Starting debugger:
  10. done
  11. Setting breakpoints
  12. Microsoft (R) Windows Debugger Version 6.12.0002.633 AMD64
  13. Copyright (c) Microsoft Corporation. All rights reserved.
  14. CommandLine: build/win/Savior-dbg.exe
  15. Symbol search path is: C:/Projects/Plaidgadget/dev/
  16. Executable search path is:
  17. ModLoad: 00000000`010f0000 00000000`01d77000   Savior-dbg.exe
  18. ModLoad: 00000000`77780000 00000000`77929000   ntdll.dll
  19. ModLoad: 00000000`77960000 00000000`77ae0000   ntdll32.dll
  20. ModLoad: 00000000`73710000 00000000`7374f000   C:\Windows\SYSTEM32\wow64.dll
  21. ModLoad: 00000000`736b0000 00000000`7370c000   C:\Windows\SYSTEM32\wow64win.dll
  22. ModLoad: 00000000`736a0000 00000000`736a8000   C:\Windows\SYSTEM32\wow64cpu.dll
  23. (18a8.42c): Break instruction exception - code 80000003 (first chance)
  24. *** ERROR: Symbol file could not be found.  Defaulted to export symbols for ntdll.dll -
  25. ntdll!CsrSetPriorityClass+0x40:
  26. 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: Text
  1. Building to ensure sources are up-to-date
  2. Build succeeded
  3. Selecting target:
  4. Debug
  5. Adding source dir: C:\Projects\Plaidgadget\dev\
  6. Adding source dir: C:\Projects\Plaidgadget\dev\
  7. Changing directory to: game/
  8. Adding file: build\win\Savior-dbg.exe
  9. Starting debugger:
  10. done
  11. Setting breakpoints
  12. Microsoft (R) Windows Debugger Version 6.12.0002.633 AMD64
  13. Copyright (c) Microsoft Corporation. All rights reserved.
  14. CommandLine: build/win/Savior-dbg.exe
  15. Symbol search path is: C:/Projects/Plaidgadget/dev/;C:\Symbols\
  16. Executable search path is:
  17. ModLoad: 00000000`010f0000 00000000`01d77000   Savior-dbg.exe
  18. ModLoad: 00000000`77780000 00000000`77929000   ntdll.dll
  19. ModLoad: 00000000`77960000 00000000`77ae0000   ntdll32.dll
  20. ModLoad: 00000000`73710000 00000000`7374f000   C:\Windows\SYSTEM32\wow64.dll
  21. ModLoad: 00000000`736b0000 00000000`7370c000   C:\Windows\SYSTEM32\wow64win.dll
  22. ModLoad: 00000000`736a0000 00000000`736a8000   C:\Windows\SYSTEM32\wow64cpu.dll
  23. (16f4.df0): Break instruction exception - code 80000003 (first chance)
  24. ntdll!LdrpDoDebuggerBreak+0x30:
  25. 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 »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 8378
Re: Debugger unresponsive -- C::B 10.07 + MSVC 10 + msoft debugging tools
« 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?
<debugger plugin maintainer>
(most of the time I ignore long posts)

Offline cellulose

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: Debugger unresponsive -- C::B 10.07 + MSVC 10 + msoft debugging tools
« 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 »

Offline cellulose

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: Debugger unresponsive -- C::B 10.07 + MSVC 10 + msoft debugging tools
« 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: Text
  1. Building to ensure sources are up-to-date
  2. Build succeeded
  3. Selecting target:
  4. Debug
  5. Adding source dir: C:\Projects\Plaidgadget\dev\
  6. Adding source dir: C:\Projects\Plaidgadget\dev\
  7. Changing directory to: game/
  8. Adding file: build\win\Savior-dbg.exe
  9. Starting debugger:
  10. done
  11. Setting breakpoints
  12. Microsoft (R) Windows Debugger Version 6.12.0002.633 X86
  13. Copyright (c) Microsoft Corporation. All rights reserved.
  14. CommandLine: build/win/Savior-dbg.exe
  15. Symbol search path is: C:/Projects/Plaidgadget/dev/;C:\Symbols\
  16. Executable search path is:
  17. ModLoad: 012e0000 01f67000   Savior-dbg.exe
  18. ModLoad: 77960000 77ae0000   ntdll.dll
  19. ModLoad: 76eb0000 76fc0000   C:\Windows\syswow64\kernel32.dll
  20. ModLoad: 75310000 75356000   C:\Windows\syswow64\KERNELBASE.dll
  21. ModLoad: 723d0000 72404000   C:\Program Files\AVAST Software\Avast\snxhk.dll
  22. ModLoad: 69890000 6991c000   C:\Projects\Plaidgadget\dev\build\win\SDL_net.dll
  23. ModLoad: 73470000 73477000   C:\Windows\SysWOW64\WSOCK32.dll
  24. ModLoad: 76e70000 76ea5000   C:\Windows\syswow64\WS2_32.dll
  25. ModLoad: 750a0000 7514c000   C:\Windows\syswow64\msvcrt.dll
  26. ModLoad: 768b0000 769a0000   C:\Windows\syswow64\RPCRT4.dll
  27. ModLoad: 75040000 750a0000   C:\Windows\syswow64\SspiCli.dll
  28. ModLoad: 75030000 7503c000   C:\Windows\syswow64\CRYPTBASE.dll
  29. ModLoad: 76fc0000 76fd9000   C:\Windows\SysWOW64\sechost.dll
  30. ModLoad: 75420000 75426000   C:\Windows\syswow64\NSI.dll
  31. ModLoad: 65be0000 65cd7000   C:\Projects\Plaidgadget\dev\build\win\SDL.dll
  32. ModLoad: 72250000 72282000   C:\Windows\SysWOW64\WINMM.dll
  33. ModLoad: 75430000 75530000   C:\Windows\syswow64\USER32.dll
  34. ModLoad: 75280000 75310000   C:\Windows\syswow64\GDI32.dll
  35. ModLoad: 76e60000 76e6a000   C:\Windows\syswow64\LPK.dll
  36. ModLoad: 76a40000 76add000   C:\Windows\syswow64\USP10.dll
  37. ModLoad: 769a0000 76a40000   C:\Windows\syswow64\ADVAPI32.dll
  38. ModLoad: 10000000 10148000   C:\Projects\Plaidgadget\dev\build\win\mpir.dll
  39. ModLoad: 697c0000 69888000   C:\Windows\SysWOW64\OPENGL32.dll
  40. ModLoad: 6cbc0000 6cbe2000   C:\Windows\SysWOW64\GLU32.dll
  41. ModLoad: 747e0000 748c7000   C:\Windows\SysWOW64\DDRAW.dll
  42. ModLoad: 747d0000 747d6000   C:\Windows\SysWOW64\DCIMAN32.dll
  43. ModLoad: 76470000 7660d000   C:\Windows\syswow64\SETUPAPI.dll
  44. ModLoad: 76fe0000 77007000   C:\Windows\syswow64\CFGMGR32.dll
  45. ModLoad: 77010000 7709f000   C:\Windows\syswow64\OLEAUT32.dll
  46. ModLoad: 76610000 7676c000   C:\Windows\syswow64\ole32.dll
  47. ModLoad: 76890000 768a2000   C:\Windows\syswow64\DEVOBJ.dll
  48. ModLoad: 747b0000 747c3000   C:\Windows\SysWOW64\dwmapi.dll
  49. (1100.2158): Break instruction exception - code 80000003 (first chance)
  50. eax=00000000 ebx=00000000 ecx=13880000 edx=0025de18 esi=fffffffe edi=00000000
  51. eip=77a00f3b esp=0039fa44 ebp=0039fa70 iopl=0         nv up ei pl zr na pe nc
  52. cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00000246
  53. *** ERROR: Symbol file could not be found.  Defaulted to export symbols for ntdll.dll -
  54. ntdll!LdrVerifyImageMatchesChecksum+0x96c:
  55. 77a00f3b cc              int     3

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 8378
Re: Debugger unresponsive -- C::B 10.07 + MSVC 10 + msoft debugging tools
« Reply #4 on: January 09, 2012, 11:02:18 pm »
Does it work, from the command line?
<debugger plugin maintainer>
(most of the time I ignore long posts)

Offline cellulose

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: Debugger unresponsive -- C::B 10.07 + MSVC 10 + msoft debugging tools
« 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.  :)


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: Text
  1. C:\Projects\Plaidgadget\dev\game>"C:/Program Files (x86)/Debugging tools for windows (x86)/cdb.exe" cdb ../build/win/Sav
  2. ior-dbg.exe
  3.  
  4. Microsoft (R) Windows Debugger Version 6.12.0002.633 X86
  5. Copyright (c) Microsoft Corporation. All rights reserved.
  6.  
  7. CommandLine: cdb ../build/win/Savior-dbg.exe
  8. WARNING: Inaccessible path: 'C:\Symbols\'
  9. Symbol search path is: C:\Symbols\
  10. Executable search path is:
  11. ModLoad: 00ee0000 00f40000   cdb.exe
  12. ModLoad: 77960000 77ae0000   ntdll.dll
  13. ModLoad: 76eb0000 76fc0000   C:\Windows\syswow64\kernel32.dll
  14. ModLoad: 75310000 75356000   C:\Windows\syswow64\KERNELBASE.dll
  15. ModLoad: 723d0000 72404000   C:\Program Files\AVAST Software\Avast\snxhk.dll
  16. ModLoad: 750a0000 7514c000   C:\Windows\syswow64\msvcrt.dll
  17. ModLoad: 65530000 658cb000   C:\Program Files (x86)\Debugging tools for windows (x86)\dbgeng.dll
  18. ModLoad: 653e0000 65521000   C:\Program Files (x86)\Debugging tools for windows (x86)\dbghelp.dll
  19. ModLoad: 73460000 73469000   C:\Windows\SysWOW64\VERSION.dll
  20. ModLoad: 769a0000 76a40000   C:\Windows\syswow64\ADVAPI32.dll
  21. ModLoad: 76fc0000 76fd9000   C:\Windows\SysWOW64\sechost.dll
  22. ModLoad: 768b0000 769a0000   C:\Windows\syswow64\RPCRT4.dll
  23. ModLoad: 75040000 750a0000   C:\Windows\syswow64\SspiCli.dll
  24. ModLoad: 75030000 7503c000   C:\Windows\syswow64\CRYPTBASE.dll
  25. (21e4.21a8): Break instruction exception - code 80000003 (first chance)
  26. eax=00000000 ebx=00000000 ecx=33870000 edx=001adf88 esi=fffffffe edi=00000000
  27. eip=77a00f3b esp=0021f490 ebp=0021f4bc iopl=0         nv up ei pl zr na pe nc
  28. cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00000246
  29. *** ERROR: Symbol file could not be found.  Defaulted to export symbols for ntdll.dll -
  30. ntdll!LdrVerifyImageMatchesChecksum+0x96c:
  31. 77a00f3b cc              int     3
  32. 0:000> g
  33.  
  34. Microsoft (R) Windows Debugger Version 6.12.0002.633 X86
  35. Copyright (c) Microsoft Corporation. All rights reserved.
  36.  
  37. CommandLine: ../build/win/Savior-dbg.exe
  38. ModLoad: 746a0000 746ec000   C:\Windows\SysWOW64\apphelp.dll
  39. (21e4.21a8): Illegal instruction - code c000001d (first chance)
  40. ModLoad: 63d70000 64069000   C:\Program Files (x86)\Debugging tools for windows (x86)\winext\ext.dll
  41. ModLoad: 68a10000 68a85000   C:\Program Files (x86)\Debugging tools for windows (x86)\WINXP\exts.dll
  42. ModLoad: 697d0000 697ed000   C:\Program Files (x86)\Debugging tools for windows (x86)\winext\uext.dll
  43. ModLoad: 67c00000 67c16000   C:\Program Files (x86)\Debugging tools for windows (x86)\WINXP\ntsdexts.dll
  44. ModLoad: 697c0000 697cb000   C:\Program Files (x86)\Debugging tools for windows (x86)\WINXP\wow64exts.dll
  45. WARNING: Inaccessible path: 'C:\Symbols\'
  46. Symbol search path is: C:\Symbols\
  47. Executable search path is:
  48. ModLoad: 012e0000 01f67000   Savior-dbg.exe
  49. ModLoad: 77960000 77ae0000   ntdll.dll
  50. ModLoad: 76eb0000 76fc0000   C:\Windows\syswow64\kernel32.dll
  51. ModLoad: 75310000 75356000   C:\Windows\syswow64\KERNELBASE.dll
  52. ModLoad: 723d0000 72404000   C:\Program Files\AVAST Software\Avast\snxhk.dll
  53. ModLoad: 65990000 65a1c000   C:\Projects\Plaidgadget\dev\build\win\SDL_net.dll
  54. ModLoad: 73470000 73477000   C:\Windows\SysWOW64\WSOCK32.dll
  55. ModLoad: 76e70000 76ea5000   C:\Windows\syswow64\WS2_32.dll
  56. ModLoad: 750a0000 7514c000   C:\Windows\syswow64\msvcrt.dll
  57. ModLoad: 768b0000 769a0000   C:\Windows\syswow64\RPCRT4.dll
  58. ModLoad: 75040000 750a0000   C:\Windows\syswow64\SspiCli.dll
  59. ModLoad: 75030000 7503c000   C:\Windows\syswow64\CRYPTBASE.dll
  60. ModLoad: 76fc0000 76fd9000   C:\Windows\SysWOW64\sechost.dll
  61. ModLoad: 75420000 75426000   C:\Windows\syswow64\NSI.dll
  62. ModLoad: 63c70000 63d67000   C:\Projects\Plaidgadget\dev\build\win\SDL.dll
  63. ModLoad: 72250000 72282000   C:\Windows\SysWOW64\WINMM.dll
  64. ModLoad: 75430000 75530000   C:\Windows\syswow64\USER32.dll
  65. ModLoad: 75280000 75310000   C:\Windows\syswow64\GDI32.dll
  66. ModLoad: 76e60000 76e6a000   C:\Windows\syswow64\LPK.dll
  67. ModLoad: 76a40000 76add000   C:\Windows\syswow64\USP10.dll
  68. ModLoad: 769a0000 76a40000   C:\Windows\syswow64\ADVAPI32.dll
  69. ModLoad: 10000000 10148000   C:\Projects\Plaidgadget\dev\build\win\mpir.dll
  70. ModLoad: 63ba0000 63c68000   C:\Windows\SysWOW64\OPENGL32.dll
  71. ModLoad: 67bd0000 67bf2000   C:\Windows\SysWOW64\GLU32.dll
  72. ModLoad: 747e0000 748c7000   C:\Windows\SysWOW64\DDRAW.dll
  73. ModLoad: 747d0000 747d6000   C:\Windows\SysWOW64\DCIMAN32.dll
  74. ModLoad: 76470000 7660d000   C:\Windows\syswow64\SETUPAPI.dll
  75. ModLoad: 76fe0000 77007000   C:\Windows\syswow64\CFGMGR32.dll
  76. ModLoad: 77010000 7709f000   C:\Windows\syswow64\OLEAUT32.dll
  77. ModLoad: 76610000 7676c000   C:\Windows\syswow64\ole32.dll
  78. ModLoad: 76890000 768a2000   C:\Windows\syswow64\DEVOBJ.dll
  79. ModLoad: 747b0000 747c3000   C:\Windows\SysWOW64\dwmapi.dll
  80. (2298.208c): Break instruction exception - code 80000003 (first chance)
  81. ModLoad: 76ae0000 76ae5000   C:\Windows\SysWOW64\psapi.dll
  82. ModLoad: 65a20000 65a68000   C:\Program Files (x86)\Debugging tools for windows (x86)\symsrv.dll
  83. eax=00000000 ebx=00000000 ecx=29b50000 edx=001be168 esi=fffffffe edi=00000000
  84. eip=77a00f3b esp=0015f9f0 ebp=0015fa1c iopl=0         nv up ei pl zr na pe nc
  85. cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00000246
  86. *** ERROR: Symbol file could not be found.  Defaulted to export symbols for ntdll.dll -
  87. ntdll!LdrVerifyImageMatchesChecksum+0x96c:
  88. 77a00f3b cc              int     3
  89. 0:000>
« Last Edit: January 09, 2012, 11:18:08 pm by cellulose »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 8378
Re: Debugger unresponsive -- C::B 10.07 + MSVC 10 + msoft debugging tools
« Reply #6 on: January 09, 2012, 11:44:05 pm »
Have you tried a debugger's branch nightly build then?
<debugger plugin maintainer>
(most of the time I ignore long posts)

Offline cellulose

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: Debugger unresponsive -- C::B 10.07 + MSVC 10 + msoft debugging tools
« 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 »

Offline cellulose

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: Debugger unresponsive -- C::B 10.07 + MSVC 10 + msoft debugging tools
« 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 »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 8378
Re: Debugger unresponsive -- C::B 10.07 + MSVC 10 + msoft debugging tools
« 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.
<debugger plugin maintainer>
(most of the time I ignore long posts)

Offline cellulose

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: Debugger unresponsive -- C::B 10.07 + MSVC 10 + msoft debugging tools
« 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.