User forums > Help

Debug pb

<< < (2/2)

syp:
I didn't intend or feel rude. It's my bad and you'r right I should have clarified my experience.


--- Quote ---1) Open codeblocks
2) Create new project
3) Paste the code from top
4) Hit compile and run
5) Console window pops up but closes immediately. I expect that it remains open...

for me step 1 to 5 work without problems, in step 5 the console stays open

--- End quote ---

step 1 to 5 is fine for me too. but step 5 my console closes.


--- Quote ---1) Open codeblocks
2) Create new project
3) Paste code form the top
4) place a breakpoint in line 3
5) Hit debug
6) Program exits, but it should stop in line 3

Also this works for me for step 1 to 6. But on step 6 for me the debugger stops and whaits for next instruction

--- End quote ---

step 1 to 6 is fine too, the debugger stops on the BP as expected, but continuing debug the console closes.


--- Quote ---1) Open codeblocks
2) Create new project
3) Paste code from the top
4) Hit compile and run
5) close codeblocks
6) go to the project bin folder
7) Double click my program
8) Black window pops up for a short time. But i expect to read some assert text
Again steps 1-8 work for me and step 8 should be the black window poping up but closing fast

--- End quote ---

All is fine but step 8 there is no message.


--- Code: ---C:\Dev\cpp\test\bin\Debug>test
C:\Dev\cpp\test\bin\Debug>echo %errorlevel%
-1073741515

--- End code ---

however it can be noted that the execution did not reach the 'return 0', as expected.

what makes me think that the problems come from CB is that they appeared right after a CB crash.
However we will never know what the problem is or its solution, I will take out the hammer and do a relatively recent restoration of my drive.

And I'll add a startup script to save the CB settings. But having reinstalled it all settings in %appdata%/codeblocks should have been reset, so pb is probably not from settings in this directory.
This sound as a side effect of the crash somewhere  :(

Thank you for your help

BlueHazzard:
Ok, now we know the problem and can work on a solution.

To see the output at the end of the execution of your program, codeblocks uses the "console runner". This is the black screen you see at the end of your program with the text. If the console runner is not used your program will exit without notice


--- Quote ---step 1 to 5 is fine for me too. but step 5 my console closes.
--- End quote ---
this should not happen if you run it in codeblocks and the following option is set:
Project->Properties->Build targets->Check if Debug is selected on the left->Check the option "Pause when execution ends"
If this mark is set, and your console disappears, then there is some deeper problem.



--- Quote ---step 1 to 6 is fine too, the debugger stops on the BP as expected, but continuing debug the console closes.
--- End quote ---
This is expected behavior. If your application is run in the debugger the "console runner" is not used and for this you will not see any output at the end of the execution


--- Code: ---C:\Dev\cpp\test\bin\Debug>test
C:\Dev\cpp\test\bin\Debug>echo %errorlevel%
-1073741515
--- End code ---
This is strange... Can you please post a build log:
1) Run Build->Rebuild project
2) Post the content of the Build log tab at the bottom


Navigation

[0] Message Index

[*] Previous page

Go to full version