2

I want to debug a C++ programm with Clion, my debugger works when I put a breakpoint into the main's class but if I put a breakpoint into a class, gdb doesn't stop the running program when we have to enter into a function of this class from the main's class.

I don't really know why :/ Is it a normal feature ?

Thanks for helping.

2
  • What do you mean by "main's class" ? Commented May 7, 2015 at 12:10
  • This is my main's class : Graph gograph; int main(int argc, char argv[]) { num_of_vertices = gograph.Cliques(argv[1], "clq.temp.txt"); } This is my class graph.cpp in summary with a graph.h obviously : int Graph::Cliques(const char *szgraph_filename, const char szoutput_filename) { ... } I want to put a breakpoint into the class graph but Clion doesn't stop to this breakpoint. Commented May 7, 2015 at 12:27

3 Answers 3

2

Does CLion support modes like debug or release? If so, please check in what mode you are trying to debug.

Sign up to request clarification or add additional context in comments.

1 Comment

Yes, I debug in debug mode only, I didn't try the release mode.
1

I think there's some issue with the bundled GDB CLion is using. Switching to system GDB helped in my case. To do so:

File -> Settings -> Build, Execution, Deployment -> Toolchains -> Debugger and switch "Use bundled GDB" to "Use specified GDB" and supply path: /usr/bin/gdb

Comments

0

It seems to work when you call functions with no arguments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.