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


On Tue, Mar 8, 2011 at 7:54 AM, hefeweizen <horacio.sanchez@kit.edu> wrote:

> (gdb) b main
> Breakpoint 1 at 0x1f8f: file hello.cpp, line 5.
>
> run the program:
>
> (gdb) r
> Starting program:
> /Users/horacio/work/software/gdb/gdb-7.2-inst/bin/hello.exe
>
> Breakpoint 1, main () at hello.cpp:5
> 5 ? ? ? puts("!!!Hello World!!!");
>
> and try to step, and this happens:
>
> (gdb) n
> 0x00003045 in ?? ()

FWIW, I did not reproduce this with current CVS build of GDB:

gdb/gdb ./a.out
GNU gdb (GDB) 7.3.50.20110508-cvs
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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-darwin10.7.0".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /Users/ppluzhnikov/gdb-cvs/build/a.out...Reading
symbols from /Users/ppluzhnikov/gdb-cvs/build/a.out.dSYM/Contents/Resources/DWARF/a.out...done.
done.
(gdb) b main
Breakpoint 1 at 0x100000ef8: file t.cc, line 5.
(gdb) r
Starting program: /Users/ppluzhnikov/gdb-cvs/build/a.out

Breakpoint 1, main () at t.cc:5
5	   puts("!!!Hello World!!!");
(gdb) n
!!!Hello World!!!
6	   return EXIT_SUCCESS;
(gdb) n
7	}
(gdb) n
0x0000000100000eec in start ()
(gdb) c
Continuing.
[Inferior 1 (process 41135) exited normally]
(gdb) q


-- 
Paul Pluzhnikov


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