Author Topic: Debug breakpoints not stopping  (Read 11785 times)

Offline coffee__guy

  • Single posting newcomer
  • *
  • Posts: 7
Debug breakpoints not stopping
« on: February 21, 2018, 12:01:57 am »

I click Debug/Start to run debugger but breakpoints not stopping.
I am trying to debug C (not C++).

Project/Build Options/Debug has checked:
   Enable all compiler warnings
   Produce Debugging symbols.

I read I need to pass "cc -g -c". 
Windows 10, patches up thru 2018.02 applied 
Using codeblocks 17.12
Under C::B  settings/debugger, catch c++ extensions is NOT checked.

Some Debug log info:

******
 C:\Program Files\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin\gdb.exe -nx -fullname -quiet  -args C:/Users/.../DAVES_~1/LEARNI~1/bin/Release/LEARNI~1.EXE
******  current debug code
[debug]GNU gdb (GDB) 8.0.1
[debug]Copyright (C) 2017 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
...
[debug]This GDB was configured as "x86_64-w64-mingw32".

******  Debugger working
[Inferior 1 (process 6348) exited normally]

[debug]> quit

Debugger finished with status 0

[debug]DebuggerGDB::EnableBreakpoint(running=0);
[debug]DebuggerGDB::EnableBreakpoint(running=0);
******  Debugger sees beakpoints
[debug]No symbol table is loaded.  Use the "file" command.
[debug]Breakpoint 1 ("C:/Users/.../HelloWorld.c:27") pending.
[debug]>>>>>>cb_gdb:
[debug]> break "C:/Users/...S/HelloWorld.c:7"
[debug]No symbol table is loaded.  Use the "file" command.

******   Referneces I looked at
I have reviewed http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips.
I downloaded gdb-8.1.tar and unpacked it with 7-zip but can not find bdg.exe file.

******
Any ideas??? 

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Debug breakpoints not stopping
« Reply #1 on: February 21, 2018, 12:07:26 am »
Did you look at the compiler command in the build log to confirm the "-g" is present and the "-s" strip command is *not* present.

Tim S.
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 coffee__guy

  • Single posting newcomer
  • *
  • Posts: 7
Re: Debug breakpoints not stopping
« Reply #2 on: February 21, 2018, 12:26:52 am »
I did not.  Here it is though.  I did not know where to look.  Thanks for letting me know where it is.   

mingw32-gcc.exe -Wall -O2 -g  -c "C:\Users...\HelloWorld.c" -o obj\Release\HelloWorld.o
mingw32-g++.exe  -o "bin\Release\... \HelloWorld.o  -s 

Where do I change the -s above?  I think gcc is C and g++ is C+.  I am compiling C.

And thank you


« Last Edit: February 21, 2018, 12:43:15 am by coffee__guy »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Debug breakpoints not stopping
« Reply #3 on: February 21, 2018, 12:42:32 am »
I did not.  Here it is though.  I did not know where to look.  Thanks for letting me know where it is.   

mingw32-gcc.exe -Wall -O2 -g  -c "C:\Users...\HelloWorld.c" -o obj\Release\HelloWorld.o
mingw32-g++.exe  -o "bin\Release\... \HelloWorld.o  -s 

Where do I change the -s above? 

And thank you

I would guess the "other linker options"
Project -> Build Options
Tab: Linker Settings

Remember to check both the project and target level in the left hand pane.

Tim S.

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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debug breakpoints not stopping
« Reply #4 on: February 21, 2018, 12:55:19 am »
Generally it is better to use the Debug target when debugging. The release rarely allows any useful debugging to happen. To switch the target find the drop down where it is Release is selected and switch it to Debug.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline coffee__guy

  • Single posting newcomer
  • *
  • Posts: 7
Re: Debug breakpoints not stopping
« Reply #5 on: February 21, 2018, 01:35:10 am »
From Code::Blocks build menu, there is a "select target" that has build or release options.  I don't see where I see an different output.   

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debug breakpoints not stopping
« Reply #6 on: February 21, 2018, 09:21:18 am »
I guess you've disabled the debug target during project creation time, so you need to recreate it manually.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline coffee__guy

  • Single posting newcomer
  • *
  • Posts: 7
Re: Debug breakpoints not stopping
« Reply #7 on: February 27, 2018, 04:10:42 am »
I finally got this working.  I had to change the location of the files to a folder on my desktop.  I guess I was having a write permissions problem.  Now back to C.  thanks for all the comments.

Offline coffee__guy

  • Single posting newcomer
  • *
  • Posts: 7
Re: Debug breakpoints not stopping
« Reply #8 on: February 27, 2018, 05:00:27 am »
Is there a recommended Linux distro that has this installed and already working I could use under Virtual Box with Windows as a host?  I am spending more time trying to make debugging work than working with code.     

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Debug breakpoints not stopping
« Reply #9 on: February 27, 2018, 04:29:30 pm »
For me this works all out of the box...

Create project, put it where you have write access (the home directory) and always next next next and all works as expected...

if you have problems provide logs and detailed description of the problem, and we will help...

Offline coffee__guy

  • Single posting newcomer
  • *
  • Posts: 7
Re: Debug breakpoints not stopping
« Reply #10 on: February 27, 2018, 07:58:38 pm »
BlueHazzard, are you using C::B debugging on Windows or *nix or Apple?  I will post all my log/etc.  details soon. I got it to work once so I know it works. 

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Debug breakpoints not stopping
« Reply #11 on: March 01, 2018, 02:11:52 pm »
unix and windows

Offline coffee__guy

  • Single posting newcomer
  • *
  • Posts: 7
Re: Debug breakpoints not stopping
« Reply #12 on: March 12, 2018, 07:16:49 pm »
I removed CodeBlocks from my system and reinstalled it.  It seems to work now.  Thanks everyone.