-2

Issue: blank cmd window pops up and closes in a second.

Log :-

C:\Windows\system32\cmd.exe /C C:/TDM-GCC-64/bin/mingw32-make.exe -j4 SHELL=cmd.exe -e -f  Makefile
"----------Building project:[ Test - Debug ]----------"
mingw32-make.exe[1]: Entering directory 'C:/Users/< User >/Documents/Varun/Test'
C:/TDM-GCC-64/bin/g++.exe -o ./Debug/Test @"Test.txt" -L.
mingw32-make.exe[1]: Leaving directory 'C:/Users/< User >/Documents/Varun/Test'
"----------Building project:[ Test2 - Debug ]----------"
mingw32-make.exe[1]: Entering directory 'C:/Users/< User >/Documents/Varun/Test2'
C:/TDM-GCC-64/bin/g++.exe -o ./Debug/Test2 @"Test2.txt" -L.
mingw32-make.exe[1]: Leaving directory 'C:/Users/< User >/Documents/Varun/Test2'
====0 errors, 0 warnings====

I am trying to debug main.cpp of Test2. I even opened a new project with hello world program, added breakpoints, did addition and tried to debug but my debugger just closes.

genpfault
  • 51,148
  • 11
  • 85
  • 139
Varun Sharma
  • 105
  • 3
  • 9

4 Answers4

1

The problem is the same when you use eclipse.

The "IDE" need know what is checkpoint (as main Thread), if you put a checkpoint below level methods not will work.

How you can solve this problem ? you need check high level checkpoint to solve this problem.

For example, when you use IDE, you need check

Here will not work correctly : 

 method()
   method()  
      method()
         method()
           method()
              ......  method()   // if you only check Here will not work correctly

 Here will work correctly :    

 method() // You need check here "Here is the main thread"
   method()  // and here
      method()// and here
         method()// and here
           method()// and here
              ......  method()   // and here

Remember, normally you need check breakpoints before to "run" because the IDE, need create the previus structure, if not, more times will pass from this point.

0

I chose Debugger->Delete All Breakpoints. and then added my breakpoints back, problem seems to be fixed now.

Whats weird is that i am able to reproduce this bug, I just need to have a breakpoint in any other project in this working directory.

Varun Sharma
  • 105
  • 3
  • 9
0

As of September 2018, I see the issue on CodeLite and I can confirm the issue. The solution is to remove all the breakpoints and continue. Breakpoints in other programs cause the issue.

Before starting to debug the current project, go to

Debugger -> Delete all breakpoints.

After this is done, the debugger started to work. You can add breakpoints in the current project and debug.

0

This could be a permissions issue. I'll expose my case but you can skip to my idea.


My case

I had to install codelite from source (long story) and ended up messing some things, in a way that, when run with root privileges, codelite worked well but when trying to run from an unprivileged user, it started eating up ram, then swap, and so on to infinity.

I tried copying the folder /root/.codelite into /home/$USER/.codelite and I solved the crashing problem but I could not debug. No matter where or how many breakpoints I added, the debugger just skipped them all. In addition to this, none of the configurations i modified seemed to be persistent (themes, windows, even projects disappeared on restart), which led me to realize I had copied the folder from root keeping its permissions.

A change in the permissions of /home/$USER/.codelite solved both my persistence and debuging problems. In case you had a /home/$USER/.codelite folder owned by root (as was my case), which I doubt tho, but then the fix is ez:

sudo chown -R $USER /home/$USER/.codelite


My idea

What if (what if) installing codelite with root permissions (as in sudo apt install codelite) configured codelite to use the /root/.codelite folder but when you start codelite from the normal user it cannot write there and that's why you can't debug?

Can you debug if you launch codelite from a terminal with sudo?

If you can, I don't know how to solve the whole installation problem (codelite is supposed to use the .codelite folder in your /home) but if it works with sudo, then there you have it.

desertnaut
  • 57,590
  • 26
  • 140
  • 166