Author Topic: OSX and debugging  (Read 5258 times)

Offline phisch2

  • Single posting newcomer
  • *
  • Posts: 6
OSX and debugging
« on: January 13, 2014, 05:11:37 pm »
Hello,
I've searched the forums and seen that the debugger does not currently function correctly under OSX.  If some developer is willing to help me figure out what is going on, I'm happy to try to troubleshoot the problem on my mac.  Fwiw, the debugger process seems to start up and a terminal window opens, but the executable is not running in that terminal window.  Everything works fine when just running an executable, the terminal opens, the program runs, etc., just not under the debugger.  If someone wants to give me a list of things to try/check I'm ready to go.
Thanks,
-Phil

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: OSX and debugging
« Reply #1 on: January 13, 2014, 07:36:30 pm »
Are you able to debug a program that is not a console one, say you switch the type in project -> properties -> build targets -> type to GUI?
(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 phisch2

  • Single posting newcomer
  • *
  • Posts: 6
Re: OSX and debugging
« Reply #2 on: January 13, 2014, 07:59:10 pm »
Tried changing type to GUI.  Set a breakpoint in main and hit Debug/Continue.  Execution looks like is stops at the breakpoint (I see the yellow arrow), and I am able to set up watches for variables in main when I hit the breakpoint.  However, all debug icons are grayed out except "Debugging Windows."  So I can't step the program or run it to completion or do anything else as far as I can tell.  I have to "Force Quit" Codeblocks.  This is basically the same behavior as when I build as a Console Application, except in that case a Terminal window opens but does not run any other process, and I get the oascript error message in the Debugger log window.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: OSX and debugging
« Reply #3 on: January 13, 2014, 08:08:30 pm »
Please enable full logging in the settings of the debugger and paste the log from the GUI session.
(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 phisch2

  • Single posting newcomer
  • *
  • Posts: 6
Re: OSX and debugging
« Reply #4 on: January 13, 2014, 08:34:41 pm »
Please enable full logging in the settings of the debugger and paste the log from the GUI session.
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: /Users/phil/Desktop/guessing/
Adding source dir: /Users/phil/Desktop/guessing/
Adding file: /Users/phil/Desktop/guessing/bin/Debug/guessing
Changing directory to: /Users/phil/Desktop/guessing/.
Set variable: DYLD_LIBRARY_PATH=.:

[debug]Command-line: /usr/bin/gdb -nx -fullname  -quiet  -args /Users/phil/Desktop/guessing/bin/Debug/guessing
[debug]Working dir : /Users/phil/Desktop/guessing

Starting debugger: /usr/bin/gdb -nx -fullname  -quiet  -args /Users/phil/Desktop/guessing/bin/Debug/guessing
done

[debug]> set prompt >>>>>>cb_gdb:

Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints

[debug]Reading symbols for shared libraries ... done
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb 6.3.50-20050815 (Apple version gdb-1752) (Sat Jan 28 03:02:46 UTC 2012)
[debug]Copyright 2004 Free Software Foundation, Inc.
[debug]GDB is free software, covered by the GNU General Public License, and you are
[debug]welcome to change it and/or distribute copies of it under certain conditions.
[debug]Type "show copying" to see the conditions.
[debug]There is absolutely no warranty for GDB.  Type "show warranty" for details.
[debug]This GDB was configured as "x86_64-apple-darwin".
[debug]>>>>>>cb_gdb:
[debug]> set confirm off

Debugger name and version: GNU gdb 6.3.50-20050815 (Apple version gdb-1752) (Sat Jan 28 03:02:46 UTC 2012)

[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 0
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor intel
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]>>>>>>cb_gdb:
[debug]> source /Applications/CodeBlocks.app/Contents/Resources/share/codeblocks/scripts/stl-views-1.0.3.gdb
[debug]>>>>>>cb_gdb:
[debug]> directory /Users/phil/Desktop/guessing/
[debug]>>>>>>cb_gdb:
[debug]> break "/Users/phil/Desktop/guessing/main.cpp:10"
[debug]Breakpoint 1 at 0x100000b74: file main.cpp, line 11.
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Reading symbols for shared libraries ++......................... done
[debug]Catchpoint 2 (throw)
[debug]Breakpoint 1, main () at main.cpp:11
[debug]/Users/phil/Desktop/guessing/main.cpp:11:197:beg:0x100000b74
[debug]>>>>>>cb_gdb:

At /Users/phil/Desktop/guessing/main.cpp:11

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: OSX and debugging
« Reply #5 on: January 13, 2014, 09:21:57 pm »
Oh, you're using gdb 6.3 this is tremendously old. Update to a 7.xx somehow if possible. Or use command line gdb to see what is going wrong.
Probably some regexp is not match, but I have no way to debug this.

Can you run codeblocks with the -v option?

p.s. please use code or quote tags to surround long pastes.
(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 phisch2

  • Single posting newcomer
  • *
  • Posts: 6
Re: OSX and debugging
« Reply #6 on: January 14, 2014, 04:18:19 am »
Oh, you're using gdb 6.3 this is tremendously old. Update to a 7.xx somehow if possible. Or use command line gdb to see what is going wrong.
Probably some regexp is not match, but I have no way to debug this.

Can you run codeblocks with the -v option?

p.s. please use code or quote tags to surround long pastes.

The version of gdb is tied to Xcode (Apples development suite which comes with g++, gdb, etc.)  Poking around the internet people have difficulties updating individual components.  I could try to get a newer version of gdb but it would take a bit of work.

I can runcode blocks with -v.  What should I be looking for?  On startup, with -v, I get this the following error in a window:
Code
CodeBlocks Error:
Invalid regular expression: '(([a-zA-Z]:)?.*?):([0-9]*):([0-9]*):(middle|beg):(.*)': quantifier operand invalid

Running gdb from the command line:
Code
gdb Desktop/guessing/bin/Debug/guessing 
GNU gdb 6.3.50-20050815 (Apple version gdb-1752) (Sat Jan 28 03:02:46 UTC 2012)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin"...
Reading symbols for shared libraries ... done

(gdb) break
No default breakpoint address now.
(gdb) break main.cpp:9
Breakpoint 1 at 0x100000b74: file main.cpp, line 11.
(gdb) run
Starting program: /Users/phil/Desktop/guessing/bin/Debug/guessing
Reading symbols for shared libraries ++......................... done

Breakpoint 1, main () at main.cpp:11
11     bool isGuessed = false;  // Did they get it right yet?
(gdb) print isGuessed
$1 = false

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: OSX and debugging
« Reply #7 on: January 14, 2014, 08:00:58 am »
If you get regex errors, then the problem is that your wxwidgets doesn't support the wxRE_ADVANCED mode for the regex engine.
(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 phisch2

  • Single posting newcomer
  • *
  • Posts: 6
Re: OSX and debugging
« Reply #8 on: January 14, 2014, 04:58:24 pm »
Ok, and what should I do about that?  The Codeblocks I'm using is simply the downloaded binary from the code blocks site.  Does that binary need to be built with a newer version of WxWidgets?  Should I try to build Codeblocks on my own?  Please advise.  Thanks for your help.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: OSX and debugging
« Reply #9 on: January 14, 2014, 05:59:51 pm »
Ok, and what should I do about that?  The Codeblocks I'm using is simply the downloaded binary from the code blocks site.  Does that binary need to be built with a newer version of WxWidgets?  Should I try to build Codeblocks on my own?  Please advise.  Thanks for your help.


This wxRE_ADVANCED is set as an option building wxWidgets; so the answer depends on the source of the wxWidgets Library on your system.

You will likely need to rebuild Code::Blocks; but, till after wxWidgets is fixed for wxRE_ADVANCED issue there is no reason to build Code::Blocks.

Note: The above assumes that wxRE_ADVANCED is the cause of the issue.

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