This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gdb can not debug “hello world” in mac os x


Hi Horacio,


On 03/08/2011 07:54 AM, horacio.sanchez@kit.edu wrote:

Hi, I have the following smal C++ program


#include<stdio.h>
#include<stdlib.h>

int main(void) {
     puts("!!!Hello World!!!");
     return EXIT_SUCCESS;
}

I compile in Mac OS X Leopard last release using:

g++ -g hello.cpp -o hello.exe

being g++:

host:bin macbook$ g++ --ver
Using built-in specs.
Target: i686-apple-darwin9
Configured with: /var/tmp/gcc/gcc-5493~1/src/configure --disable-checking
-enable-werror --prefix=/usr --mandir=/share/man
--enable-languages=c,objc,c++,obj-c++
--program-transform-name=/^[cg][^.-]*$/s/$/-4.0/
--with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib
--build=i686-apple-darwin9 --with-arch=apple --with-tune=generic
--host=i686-apple-darwin9 --target=i686-apple-darwin9
Thread model: posix
gcc version 4.0.1 (Apple Inc. build 5493)
Did you get your GCC version from the Apple Developer Tools?


then I try to debug this program using fsf-gdb 7.1:

fsf-gdb hello.exe
What happens when you use Apple's version of GDB that comes with the Developer Tools?

-Peter


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]