Author Topic: Can't debug my project  (Read 5367 times)

Offline darkonaito_

  • Single posting newcomer
  • *
  • Posts: 4
Can't debug my project
« on: July 14, 2020, 08:11:25 pm »
I'm trying to debug my project in codeblocks with gdb.exe, but everytime I run it, it stops at "Setting breakpoints". When I try to go to "next instruction", it says "continuing" but does nothing

example:

Active debugger config: GDB/CDB debugger:Default Building to ensure
sources are up-to-date Selecting target:  Debug Adding source dir:
C:\Users\jayok\Desktop\cpp_stuff\ascii_terraria\ Adding source dir:
C:\Users\jayok\Desktop\cpp_stuff\ascii_terraria\ Adding file:
C:\Users\jayok\Desktop\cpp_stuff\ascii_terraria\bin\Debug\ascii_terraria.exe
Changing directory to:
C:/Users/jayok/Desktop/cpp_stuff/ascii_terraria/. Set variable:
PATH=.;C:\msys64\mingw64\bin;C:\msys64\mingw64;C:\Program Files
(x86)\Common
Files\Oracle\Java\javapath;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program
Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files (x86)\NVIDIA
Corporation\PhysX\Common;C:\Users\jayok\AppData\Local\Programs\Python\Python38\Scripts;C:\Users\jayok\AppData\Local\Programs\Python\Python38;C:\Users\jayok\AppData\Local\Microsoft\WindowsApps
Starting debugger: C:\msys64\usr\bin\gdb.exe -nx -fullname -quiet -args C:/Users/jayok/Desktop/cpp_stuff/ascii_terraria/bin/Debug/ascii_terraria.exe
done Setting breakpoints Continuing... Continuing...

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: Can't debug my project
« Reply #1 on: July 14, 2020, 08:46:25 pm »
"C:\msys64\usr\bin\gdb.exe" is the wrong gdb.exe to use with "C:\msys64\mingw64\bin" toolchain path.

The correct path is likely "C:\msys64\mingw64\bin\gdb.exe".

Edit: The "C:\msys64\usr\bin\gdb.exe" is an Cygwin like GDB.
The "C:\msys64\mingw64\bin\gdb.exe" is an MinGW GDB.
I have been told on this website that the Cygwin GDB has path issues when used under Code::Blocks; but, that was many years ago. The work around back then was to use the MinGW GDB to debug Cygwin apps.

Tim S.
« Last Edit: July 14, 2020, 09:10:18 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline darkonaito_

  • Single posting newcomer
  • *
  • Posts: 4
Re: Can't debug my project
« Reply #2 on: July 14, 2020, 11:43:22 pm »
i dont have "C:\msys64\mingw64\bin\gdb.exe"

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: Can't debug my project
« Reply #3 on: July 15, 2020, 12:53:16 am »
i dont have "C:\msys64\mingw64\bin\gdb.exe"

Then install it via the "mingw-w64-x86_64-gdb" [MSys2 MinGW] package.

Tim S.
« Last Edit: July 15, 2020, 03:12:45 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org