Code::Blocks

User forums => General (but related to Code::Blocks) => Topic started by: dubfreak on January 26, 2017, 08:59:08 am

Title: Debugger starts and stops instantly without starting the application
Post by: dubfreak on January 26, 2017, 08:59:08 am
Hi guys,

New here, just going through some C++ tuts and my program will not start with debugging enabled. I have set breakpoints, used step into and run to cursor. All of these attempts were unsuccessful.

Below is the Debbuger 'log':

"
Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: C:\Users\ldew\Documents\Programming\test\
Adding source dir: C:\Users\ldew\Documents\Programming\test\
Adding file: C:\Users\ldew\Documents\Programming\test\bin\Debug\test.exe
Changing directory to: C:/Users/ldew/Documents/Programming/test/.
Set variable: PATH=.;C:\Program Files (x86)\CodeBlocks\MinGW\bin;C:\Program Files (x86)\CodeBlocks\MinGW;C:\ProgramData\Oracle\Java\javapath;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\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn
Starting debugger: C:\Program Files\LLVM\bin\clang.exe -nx -fullname -quiet  -args C:/Users/ldew/Documents/Programming/test/bin/Debug/test.exe
done
Debugger finished with status 1
Selecting target:
Debug
Adding source dir: C:\Users\ldew\Documents\Programming\test\
Adding source dir: C:\Users\ldew\Documents\Programming\test\
Adding file: C:\Users\ldew\Documents\Programming\test\bin\Debug\test.exe
Changing directory to: C:/Users/ldew/Documents/Programming/test/.
Set variable: PATH=.;C:\Program Files (x86)\CodeBlocks\MinGW\bin;C:\Program Files (x86)\CodeBlocks\MinGW;C:\ProgramData\Oracle\Java\javapath;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\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn
Starting debugger: C:\Program Files\LLVM\bin\clang.exe -nx -fullname -quiet  -args C:/Users/ldew/Documents/Programming/test/bin/Debug/test.exe
done
Debugger finished with status 1
"

Any ideas what is causing this? I am using the IDE that comes pre-packaged with the debugger.

Title: Re: Debugger starts and stops instantly without starting the application
Post by: oBFusCATed on January 26, 2017, 10:29:12 am
Enable full logging in the Settings -> Debugger and try again.
Does this executable start fine if you use the Build -> Run command?
Title: Re: Debugger starts and stops instantly without starting the application
Post by: dubfreak on January 26, 2017, 12:07:01 pm
As requested here is the full log:
Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: C:\Users\ldew\Documents\Programming\test\
Adding source dir: C:\Users\ldew\Documents\Programming\test\
Adding file: C:\Users\ldew\Documents\Programming\test\bin\Debug\test.exe
Changing directory to: C:/Users/ldew/Documents/Programming/test/.
Set variable: PATH=.;C:\Program Files (x86)\CodeBlocks\MinGW\bin;C:\Program Files (x86)\CodeBlocks\MinGW;C:\ProgramData\Oracle\Java\javapath;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\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn

[debug]Command-line: C:\Program Files\LLVM\bin\clang.exe -nx -fullname -quiet  -args C:/Users/ldew/Documents/Programming/test/bin/Debug/test.exe
[debug]Working dir : C:\Users\ldew\Documents\Programming\test

Starting debugger: C:\Program Files\LLVM\bin\clang.exe -nx -fullname -quiet  -args C:/Users/ldew/Documents/Programming/test/bin/Debug/test.exe
done

[debug]clang.exe: error: unknown argument: '-nx'
[debug]clang.exe: error: unknown argument: '-fullname'
[debug]clang.exe: error: unknown argument: '-quiet'

Debugger finished with status 1
Selecting target:
Debug
Adding source dir: C:\Users\ldew\Documents\Programming\test\
Adding source dir: C:\Users\ldew\Documents\Programming\test\
Adding file: C:\Users\ldew\Documents\Programming\test\bin\Debug\test.exe
Changing directory to: C:/Users/ldew/Documents/Programming/test/.
Set variable: PATH=.;C:\Program Files (x86)\CodeBlocks\MinGW\bin;C:\Program Files (x86)\CodeBlocks\MinGW;C:\ProgramData\Oracle\Java\javapath;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\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn

[debug]Command-line: C:\Program Files\LLVM\bin\clang.exe -nx -fullname -quiet  -args C:/Users/ldew/Documents/Programming/test/bin/Debug/test.exe
[debug]Working dir : C:\Users\ldew\Documents\Programming\test

Starting debugger: C:\Program Files\LLVM\bin\clang.exe -nx -fullname -quiet  -args C:/Users/ldew/Documents/Programming/test/bin/Debug/test.exe
done

[debug]clang.exe: error: unknown argument: '-nx'
[debug]clang.exe: error: unknown argument: '-fullname'
[debug]clang.exe: error: unknown argument: '-quiet'

Debugger finished with status 1

Yes, the executable runs fine when you simply 'run' the program.
Title: Re: Debugger starts and stops instantly without starting the application
Post by: BlueHazzard on January 26, 2017, 02:30:58 pm
1) Please use code tags if you post a log (click on the # symbol int he new post editor and fill the log between the two tags)

2)
Quote
Starting debugger: C:\Program Files\LLVM\bin\clang.exe -nx -fullname -quiet  -args C:/Users/ldew/Documents/Programming/test/bin/Debug/test.exe
clang.exe is not a debugger. You have to set the correct executable in Settings->Debugger->GDB->Default->Executable path