Author Topic: Debug not work ,seems hang(Annoying)  (Read 14958 times)

Offline marcus1877

  • Single posting newcomer
  • *
  • Posts: 8
Debug not work ,seems hang(Annoying)
« on: June 17, 2014, 02:30:59 pm »
Environment: Win7 Ultimate 64bit , CS
                  codeblocks-13.12mingw-setup.exe
CodeBlocks Path: (Default Path)C:\Program Files (x86)\CodeBlocks
Compiler: MSVC2010
Debugger: cdb.exe
CDB.exe path:(Default) C:\Program Files\Debugging Tools for Windows (x64)
Microsoft SDK:  C:\Program Files (x86)\Microsoft SDKs
Project Path: O:\sourceCode\codeblocksDemo


Issue: When i started debugging , it started and hang , no breakpoint work
I tried with GCC , all work well.

Steps:
1. Download CodeBlocks and install with default setting
2. Install VS2012 Express from Microsoft (I googled and knew CDB and SDK would be installed)
3. Launch CodeBlocks and create my console project "codeblocksDemo"
4. Settings=>Debugger , create a new config and set to CDB , then choose cdb.exe at where it is
5. Settings=>Compiler , let CodeBlock search for compiler by default path and success
                                add SDK path at "Search Directories"=>Compiler and Linker
6. Build project and debug
A console window emerge and stopped , I can't terminate it either by close window nor click "Stop Debugger"
No output
The only way to stop is close CodeBlocks !!!


Build Log:

-------------- Build: Debug in codeblocksDemo (compiler: Microsoft Visual C++ 2010)---------------

Target is up to date.
Nothing to be done (all items are up-to-date).

Build Message:
||=== Build: Debug in codeblocksDemo (compiler: Microsoft Visual C++ 2010) ===|


Debugger Output:

Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: O:\sourceCode\codeblocksDemo\
Adding source dir: O:\sourceCode\codeblocksDemo\
Adding file: O:\sourceCode\codeblocksDemo\bin\Debug\codeblocksDemo.exe
Changing directory to: O:/sourceCode/codeblocksDemo/.
Set variable: PATH=.;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE;C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x86;C:\Program Files (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit;C:\Program Files\Microsoft SQL Server\110\Tools\Binn;C:\Program Files\Microsoft Windows Performance Toolkit;C:\Program Files (x86)\CodeBlocks\MinGW\bin
Starting debugger: C:\Program Files\Debugging Tools for Windows (x64)\cdb.exe -G -lines -2 -y O:/sourceCode/codeblocksDemo/; -srcpath O:/sourceCode/codeblocksDemo/; O:/sourceCode/codeblocksDemo/bin/Debug/codeblocksDemo.exe
done
Setting breakpoints
« Last Edit: June 17, 2014, 02:32:56 pm by marcus1877 »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debug not work ,seems hang(Annoying)
« Reply #1 on: June 17, 2014, 08:47:54 pm »
Enable full debugger's log (in the settings of the debugger) and post again.

And please use code or quote tags for long pastes.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline marcus1877

  • Single posting newcomer
  • *
  • Posts: 8
Re: Debug not work ,seems hang(Annoying)
« Reply #2 on: June 18, 2014, 06:31:12 am »
Enable full debugger's log (in the settings of the debugger) and post again.

And please use code or quote tags for long pastes.
I'm trying some ways to solve this problem.
My issue is exactly the same as http://forums.codeblocks.org/index.php?topic=14165.0
ERROR: Symbol file could not be found.  Defaulted to export symbols for ntdll.dll -

Code
Reference:
http://forums.codeblocks.org/index.php?topic=8454.0
http://support.microsoft.com/kb/311503/zh-cn
http://msdn.microsoft.com/en-us/library/windows/hardware/ff558829%28v=vs.85%29.aspx

Quote
f you use CDB.EXE in the commandline without any parameters, it will print many useful informations, one of which is

Environment Variables:

    _NT_SYMBOL_PATH=[Drive:][Path]
        Specify symbol image path.

Now you can add the environment variable _NT_SYMBOL_PATH with value :

SRV*C:\MyLocalSymbols*http://msdl.microsoft.com/download/symbols

Here the folder C:\MyLocalSymbols is used by CDB.EXE to download symbols from Internet, you can change it to any other locations as you wish.
If you think it terrible to wait for downloading necessary symbols when you are debugging. You can download all symle packages once and install and set the install folder to the environment variable _NT_SYMBOL_PATH. The download link is http://www.microsoft.com/whdc/devtools/debugging/symbolpkg.mspx.
Have fun with CodeBlocks!
[/color]

« Last Edit: June 18, 2014, 07:57:49 am by marcus1877 »

Offline marcus1877

  • Single posting newcomer
  • *
  • Posts: 8
Re: Debug not work ,seems hang(Annoying)
« Reply #3 on: June 18, 2014, 07:52:25 am »
All right , This problem is solved by above 2 reference !!!!!!
 Set  _NT_SYMBOL_PATH in My Computer=>Property=>Advanced System Settings=>Environment Variables

Now a new issue is standing in front of me : First Chance Exception !!!
Code
[debug](1ff4.1e6c): WOW64 breakpoint - code 4000001f (first chance)
[debug]First chance exceptions are reported before any exception handling.
[debug]This exception may be expected and handled.

I've refered to http://msdn.microsoft.com/en-us/library/windows/hardware/ff550949%28v=vs.85%29.aspx
and tried to attached a -g to CodeBlocks at Settings=>Debugger=>Select my 'CDB' =>enter "-g" into "Arguments"

However , this -g is not passed to debugger , all command given to CDB in "Debugger" window is
Code
Starting debugger: C:\Program Files\Debugging Tools for Windows (x64)\cdb.exe -G -lines -2 -y O:/sourceCode/codeblocksDemo/; -srcpath O:/sourceCode/codeblocksDemo/; O:/sourceCode/codeblocksDemo/bin/Debug/codeblocksDemo.exe
Then I tried /g or -g -g -g -g , no effect !!!
What's going on???

PS:
I enter command prompt and run with -g , the result is ok!!


Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debug not work ,seems hang(Annoying)
« Reply #4 on: June 18, 2014, 10:47:02 am »
The user arguments are ignored for CDB, unfortunately. Probably I'll have to fix it.

A user I don't remember his nickname has started a separate implmentation of a CDB debugger plugin. You can probably try it and see if it works better.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline marcus1877

  • Single posting newcomer
  • *
  • Posts: 8
Re: Debug not work ,seems hang(Annoying)
« Reply #5 on: June 18, 2014, 02:03:24 pm »
Searched Code::Blocks > Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development ,
however only 2 posts are related cdb。 If it's not implemented on formal version , i'll use Gdb first . Looking forward new version with fixed feature.


Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debug not work ,seems hang(Annoying)
« Reply #6 on: June 18, 2014, 08:49:08 pm »
This is the topic http://forums.codeblocks.org/index.php?topic=16885.0 I think, you can ask there and you'll probably get help.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

faund

  • Guest
Re: Debug not work ,seems hang(Annoying)
« Reply #7 on: December 05, 2014, 04:46:02 pm »
I encounter this problem too, and I find the way out.

I used the 64 bit Debugging Tools for Windows comes with windows SDK install, and experience the same problem as you, the debug started, and press the buttons relate to debug have no action, even the started process for debug can not stop or kill by the task manager, only way to stop the program is to shutdown the codeblocks.

As wiki sayshttp://wiki.codeblocks.org/index.php?title=Debugging_with_Code::Blocks#Use_32bit_CDB_for_32bit_programs_and_64bit_CDB_for_64bit_programs
Quote
It seems that debugging a 32bit program with 64bit CDB doesn't work on Windows 7, but 32bit CDB works perfectly.

But on 64bit debugging tools installed with the windows sdk install, so I download the WDK iso file from http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=11800, and installed the 32bit version by running the setup program below.
Quote
\Debuggers\setup_x86.exe
, then I got a 32bit cdb.exe in "C:\Program Files (x86)\Debugging Tools for Windows (x86)".

Go Code::Blocks Settings->Debugger->Default set the "Executable path" to C:\Program Files (x86)\Debugging Tools for Windows (x86)\cdb.exe, problem gone.