Opened 7 years ago

Last modified 3 years ago

#43001 new defect

can not debug (gdb 7.7) programs compiled with gcc 4.7.3 on OSX 10.9.2 XCode 5.1 64bit

Reported by: davydden@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.2.1
Keywords: Cc: mww@…, stuartwesterman (Stuart Westerman)
Port: gdb gcc47


Compile a simple program

#include <iostream>
#include <vector>

namespace Example

  template <int dim>
  class Problem

    void run() {

int main(int argc, char *argv[])
  Example::Problem<2> problem;;
  return 0;

with macport's gcc 4.7.3:

g++-mp-4.7 -g -gdwarf-2 -gstrict-dwarf -O0 -o prog

Now if I try to debug it:

$ ggdb ./prog
GNU gdb (GDB) 7.6
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin13.0.0".
For bug reporting instructions, please see:
Reading symbols from /Users/gdb/prog...Reading symbols from /Users/gdb/prog.dSYM/Contents/Resources/DWARF/prog...done.
(gdb) b main
Breakpoint 1 at 0x100000dbf: file, line 36.
(gdb) r
Starting program: /Users/gdb/prog

Breakpoint 1, main (argc=1, argv=0x7fff5fbff620) at
(gdb) s
38	  return 0;

you see that gdb was not able to step-in the run() function.

I saw a lot of similar problems on StackOverflow with slightly different results depending on 64/32 bit, imposing C11, etc. Here are few:,,

I don't know if the problem is related to GCC or GDB, but i hope there is a solution, since many people experience it and so far I have not seen any way to overcome it...

p.s. I have Xcode 5.1

$ g++-mp-4.7 --version
g++-mp-4.7 (MacPorts gcc47 4.7.3_3) 4.7.3
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO

Change History (3)

comment:1 Changed 7 years ago by mf2k (Frank Schima)

Cc: openmaintainer@… removed
Port: gdb, gcc47gdb gcc47

In the future, please do not Cc openmaintainer@…, because it is not a valid email address.

comment:2 Changed 6 years ago by mf2k (Frank Schima)

Cc: stuartwesterman@… added; dweber@… removed

comment:3 Changed 3 years ago by raimue (Rainer Müller)

Can this still be reproduced?

Note: See TracTickets for help on using tickets.