I'm new to using GDB, so sorry if this is a question about noob.
When using GDB in any C ++ program, I get a large number of messages "There are no such files or directories." This does not happen with C. programs.
That's what I'm doing:
$ g++ -g hello-world.cpp -o hello-world.o
$ gdb hello-world.o
GNU gdb (GDB) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http:
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-darwin15.5.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http:
Find the GDB manual and other documentation resources online at:
<http:
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from hello-world.o...Reading symbols from /Users/noah/c++/hello-world.o.dSYM/Contents/Resources/DWARF/hello-world.o...done.
done.
(gdb) r
Starting program: /Users/noah/c++/hello-world.o
warning: `/private/tmp/gcc6-20160515-25034-1nu0tpk/gcc-6.1.0/build/x86_64-apple-darwin15.2.0/libstdc++-v3/src/.libs/compatibility-atomic-c++0x.o': can't open to read symbols: No such file or directory.
warning: `/private/tmp/gcc6-20160515-25034-1nu0tpk/gcc-6.1.0/build/x86_64-apple-darwin15.2.0/libstdc++-v3/src/.libs/compatibility-c++0x.o': can't open to read symbols: No such file or directory.
warning: `/private/tmp/gcc6-20160515-25034-1nu0tpk/gcc-6.1.0/build/x86_64-apple-darwin15.2.0/libstdc++-v3/src/.libs/compatibility-chrono.o': can't open to read symbols: No such file or directory.
(many more messages omitted)
warning: `/private/tmp/gcc6-20160515-25034-1nu0tpk/gcc-6.1.0/build/x86_64-apple-darwin15.2.0/libgcc/unordtf2_s.o': can't open to read symbols: No such file or directory.
warning: `/private/tmp/gcc6-20160515-25034-1nu0tpk/gcc-6.1.0/build/x86_64-apple-darwin15.2.0/libgcc/unwind-c_s.o': can't open to read symbols: No such file or directory.
warning: `/private/tmp/gcc6-20160515-25034-1nu0tpk/gcc-6.1.0/build/x86_64-apple-darwin15.2.0/libgcc/unwind-dw2_s.o': can't open to read symbols: No such file or directory.
Hello World
[Inferior 1 (process 2319) exited normally]
(gdb)
I am using OS X El Capitan, with g ++ 6.1.0 and GDB 7.11.1, both installed via Homebrew. GDB is encoded using these instructions .
source
share