Debugging with bundled gdb on windows

Hi, I'm a cs student and I've to create/edit c++ projects quite often. Right now when something is wrong I'm using cout-manual-gdb-based-debugging technique . I would like to use UI with a bundled gdb debugger but every time I try to run it, it produces the following error:

com.jetbrains.cidr.execution.debugger.backend.gdb.GDBDriver$GDBCommandException:<path_to_my_project>/_test.x: No such file or directory.

Same outcome is when I specify the gdb myself.

Is there anything I can do to make it work?

Currently I'm using CLion 2020.2.4.

0
4 comments

Hello!

Does debugging work in a default "Hello, World!" project (`File | New Project` > `C++ Executable` > `Create`)?

0

Yes, debugger works correctly in a "Hello World!" project. I forgot to mention earlier, these are makefile-based projects and I'm on Windows - I hope this doesn't prevent the use of the debugger?

0

Do you see any errors in the Build tool window if you do Tools | Makefile | Clean and Reload Makefile Project?

0

Previously I didn't have any errors there, but in the meantime I tried one more thing and managed to figure out why the debugger wasn't working (and now I have an "Incorrect directory specified" error in the Configuring Project section, but it seems to be working correctly). So, I believe that the main reason was the path of my project which contained spaces in the directory names and language-specific characters (Polish).

I also updated the CLion to the newest version (2021.1), reinstalled almost entire toolchain and played with the settings a little. My current configuration looks like this:

  • Environment: MinGW (managed via mingw-get)
  • CMake: Bundled
  • Make: Cygwin's make (set manually)
  • C & C++ Compilers: gcc/g++ from MinGW (set automatically)
  • Debugger: Bundled

I had to add both Cygwin and MinGW to the PATH to get this Frankenstein to work (this is the only configuration that is willing to work).

I have to mention that MinGW-only and MSYS2 configurations were causing problems, such as not detecting C/C++ headers, at all, for ex.: clion was unable to find <iostream> header.

During my attempts to make it work, I have come upon a strange behaviour/thing(?). Clion tried to execute a g++ command from a different path than was set in the configuration, so instead of using C:\Program Files\mingw-w64\...\g++ it tried to use C:\mingw-w64\...\g++ (these are the paths that were in the Compiler Info Errors).

Edit: It seems that I don't have C/C++ documentation any more, could it be because of the source code size?

0

Please sign in to leave a comment.