* Re: GDB does not recognize cxx extension? [not found] <CAH8yC8nWS-oFKVOLR1=924a2X_RSwV6j8+keyJHb1tgvqpqEsQ@mail.gmail.com> @ 2019-09-29 5:09 ` Christian Biesinger via gdb 2019-09-29 5:17 ` Jeffrey Walton 0 siblings, 1 reply; 6+ messages in thread From: Christian Biesinger via gdb @ 2019-09-29 5:09 UTC (permalink / raw) To: noloader; +Cc: gdb On Sun, Sep 29, 2019 at 12:01 AM Jeffrey Walton <noloader@gmail.com> wrote: > I've got a C++ program built from a source called pem_test.cxx. I'm > having trouble getting GDB to accept it. Autocomplete does not work: > > (gdb) b pem_<TAB> > pem_common.cpp pem_common.h pem_read.cpp pem_write.cpp GDB gets the list of files from the debug data in the binary, not from the current directory. Are you sure you compiled pem_test.cxx into the binary? Christian > And breakpoints don't work: > > (gdb) b pem_test.cxx : 85 > No source file named pem_test.cxx. > Make breakpoint pending on future shared library load? (y or [n]) > > The file is in PWD: > > (gdb) shell ls *.cxx > pem_test.cxx test.cxx > > I'm working on Ubuntu 18.04, using "GCC (Ubuntu > 7.4.0-1ubuntu1~18.04.1)", "GDB (Ubuntu 8.1-0ubuntu3.1)", and > CXXFLAGS="-DDEBUG -g3 -O0 -Wall". > > Searching the mailing list returns spurious hits: > https://sourceware.org/cgi-bin/search.cgi?wm=wrd&form=extended&m=all&s=D&ul=%2Fml%2Fgdb%2F%25&q=cxx%20extension > > How do I have have GDB recognize the cxx extension as a C++ source file? > > Thanks in advance. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: GDB does not recognize cxx extension? 2019-09-29 5:09 ` GDB does not recognize cxx extension? Christian Biesinger via gdb @ 2019-09-29 5:17 ` Jeffrey Walton 2019-09-29 5:51 ` Christian Biesinger via gdb 2019-09-29 21:23 ` Ruslan Kabatsayev 0 siblings, 2 replies; 6+ messages in thread From: Jeffrey Walton @ 2019-09-29 5:17 UTC (permalink / raw) To: Christian Biesinger; +Cc: gdb On Sun, Sep 29, 2019 at 1:09 AM Christian Biesinger <cbiesinger@google.com> wrote: > > On Sun, Sep 29, 2019 at 12:01 AM Jeffrey Walton <noloader@gmail.com> wrote: > > I've got a C++ program built from a source called pem_test.cxx. I'm > > having trouble getting GDB to accept it. Autocomplete does not work: > > > > (gdb) b pem_<TAB> > > pem_common.cpp pem_common.h pem_read.cpp pem_write.cpp > > GDB gets the list of files from the debug data in the binary, not from > the current directory. Are you sure you compiled pem_test.cxx into the > binary? Yes. A 'b main' stops in pem_test.cxx. The recipe to build pem_test.cxx is at https://github.com/noloader/cryptopp-pem/blob/master/pem_create_keys.sh#L42 Jeff ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: GDB does not recognize cxx extension? 2019-09-29 5:17 ` Jeffrey Walton @ 2019-09-29 5:51 ` Christian Biesinger via gdb 2019-09-29 6:49 ` Jeffrey Walton 2019-09-29 21:23 ` Ruslan Kabatsayev 1 sibling, 1 reply; 6+ messages in thread From: Christian Biesinger via gdb @ 2019-09-29 5:51 UTC (permalink / raw) To: noloader; +Cc: gdb On Sun, Sep 29, 2019 at 12:17 AM Jeffrey Walton <noloader@gmail.com> wrote: > > On Sun, Sep 29, 2019 at 1:09 AM Christian Biesinger > <cbiesinger@google.com> wrote: > > > > On Sun, Sep 29, 2019 at 12:01 AM Jeffrey Walton <noloader@gmail.com> wrote: > > > I've got a C++ program built from a source called pem_test.cxx. I'm > > > having trouble getting GDB to accept it. Autocomplete does not work: > > > > > > (gdb) b pem_<TAB> > > > pem_common.cpp pem_common.h pem_read.cpp pem_write.cpp > > > > GDB gets the list of files from the debug data in the binary, not from > > the current directory. Are you sure you compiled pem_test.cxx into the > > binary? > > Yes. A 'b main' stops in pem_test.cxx. > > The recipe to build pem_test.cxx is at > https://github.com/noloader/cryptopp-pem/blob/master/pem_create_keys.sh#L42 So, GDB does know that cxx is an extension for C++: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=gdb/c-lang.c;h=57592dfbce0f8822fa3ca3d68ed520b4124a0c5d;hb=612aac65e690387c963c34a31dd1fb138d88a45c#l1032 And .cxx does work for me: Reading symbols from ./test... (gdb) break test.cxx:2 Breakpoint 1 at 0x1129: file test.cxx, line 2. (gdb) r Starting program: /tmp/test Breakpoint 1, main () at test.cxx:2 2 return 42; (gdb) b test<TAB> std::__atomic0::atomic_flag::test_and_set(std::memory_order) test.cxx There must be something odd about your build setup, but I don't know what it is. For testing purposes, if you build the cxx as part of your static library, does it work? Christian ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: GDB does not recognize cxx extension? 2019-09-29 5:51 ` Christian Biesinger via gdb @ 2019-09-29 6:49 ` Jeffrey Walton 2019-09-29 15:48 ` Christian Biesinger via gdb 0 siblings, 1 reply; 6+ messages in thread From: Jeffrey Walton @ 2019-09-29 6:49 UTC (permalink / raw) To: Christian Biesinger; +Cc: gdb On Sun, Sep 29, 2019 at 1:51 AM Christian Biesinger <cbiesinger@google.com> wrote: > > On Sun, Sep 29, 2019 at 12:17 AM Jeffrey Walton <noloader@gmail.com> wrote: > > > > On Sun, Sep 29, 2019 at 1:09 AM Christian Biesinger > > <cbiesinger@google.com> wrote: > > > > > > On Sun, Sep 29, 2019 at 12:01 AM Jeffrey Walton <noloader@gmail.com> wrote: > > > > I've got a C++ program built from a source called pem_test.cxx. I'm > > > > having trouble getting GDB to accept it. Autocomplete does not work: > > > > > > > > (gdb) b pem_<TAB> > > > > pem_common.cpp pem_common.h pem_read.cpp pem_write.cpp > > > > > > GDB gets the list of files from the debug data in the binary, not from > > > the current directory. Are you sure you compiled pem_test.cxx into the > > > binary? > > > > Yes. A 'b main' stops in pem_test.cxx. > > > > The recipe to build pem_test.cxx is at > > https://github.com/noloader/cryptopp-pem/blob/master/pem_create_keys.sh#L42 > > So, GDB does know that cxx is an extension for C++: > https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=gdb/c-lang.c;h=57592dfbce0f8822fa3ca3d68ed520b4124a0c5d;hb=612aac65e690387c963c34a31dd1fb138d88a45c#l1032 > > And .cxx does work for me: > Reading symbols from ./test... > (gdb) break test.cxx:2 > Breakpoint 1 at 0x1129: file test.cxx, line 2. > (gdb) r > Starting program: /tmp/test > > Breakpoint 1, main () at test.cxx:2 > 2 return 42; > (gdb) b test<TAB> > std::__atomic0::atomic_flag::test_and_set(std::memory_order) test.cxx > > There must be something odd about your build setup, but I don't know > what it is. For testing purposes, if you build the cxx as part of your > static library, does it work? Ack, thanks. Let me try to sort it out on my end. Out of curiosity, are you using Ubuntu, Fedora or something else? Jeff ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: GDB does not recognize cxx extension? 2019-09-29 6:49 ` Jeffrey Walton @ 2019-09-29 15:48 ` Christian Biesinger via gdb 0 siblings, 0 replies; 6+ messages in thread From: Christian Biesinger via gdb @ 2019-09-29 15:48 UTC (permalink / raw) To: noloader; +Cc: gdb On Sun, Sep 29, 2019 at 1:48 AM Jeffrey Walton <noloader@gmail.com> wrote: > > On Sun, Sep 29, 2019 at 1:51 AM Christian Biesinger > <cbiesinger@google.com> wrote: > > > > On Sun, Sep 29, 2019 at 12:17 AM Jeffrey Walton <noloader@gmail.com> wrote: > > > > > > On Sun, Sep 29, 2019 at 1:09 AM Christian Biesinger > > > <cbiesinger@google.com> wrote: > > > > > > > > On Sun, Sep 29, 2019 at 12:01 AM Jeffrey Walton <noloader@gmail.com> wrote: > > > > > I've got a C++ program built from a source called pem_test.cxx. I'm > > > > > having trouble getting GDB to accept it. Autocomplete does not work: > > > > > > > > > > (gdb) b pem_<TAB> > > > > > pem_common.cpp pem_common.h pem_read.cpp pem_write.cpp > > > > > > > > GDB gets the list of files from the debug data in the binary, not from > > > > the current directory. Are you sure you compiled pem_test.cxx into the > > > > binary? > > > > > > Yes. A 'b main' stops in pem_test.cxx. > > > > > > The recipe to build pem_test.cxx is at > > > https://github.com/noloader/cryptopp-pem/blob/master/pem_create_keys.sh#L42 > > > > So, GDB does know that cxx is an extension for C++: > > https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=gdb/c-lang.c;h=57592dfbce0f8822fa3ca3d68ed520b4124a0c5d;hb=612aac65e690387c963c34a31dd1fb138d88a45c#l1032 > > > > And .cxx does work for me: > > Reading symbols from ./test... > > (gdb) break test.cxx:2 > > Breakpoint 1 at 0x1129: file test.cxx, line 2. > > (gdb) r > > Starting program: /tmp/test > > > > Breakpoint 1, main () at test.cxx:2 > > 2 return 42; > > (gdb) b test<TAB> > > std::__atomic0::atomic_flag::test_and_set(std::memory_order) test.cxx > > > > There must be something odd about your build setup, but I don't know > > what it is. For testing purposes, if you build the cxx as part of your > > static library, does it work? > > Ack, thanks. Let me try to sort it out on my end. > > Out of curiosity, are you using Ubuntu, Fedora or something else? I'm using Debian. GCC 8.3.0 and GDB built from git as well as 8.2.1 (both work). Christian ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: GDB does not recognize cxx extension? 2019-09-29 5:17 ` Jeffrey Walton 2019-09-29 5:51 ` Christian Biesinger via gdb @ 2019-09-29 21:23 ` Ruslan Kabatsayev 1 sibling, 0 replies; 6+ messages in thread From: Ruslan Kabatsayev @ 2019-09-29 21:23 UTC (permalink / raw) To: noloader; +Cc: Christian Biesinger, gdb Hi, On Sun, 29 Sep 2019 at 08:18, Jeffrey Walton <noloader@gmail.com> wrote: > > On Sun, Sep 29, 2019 at 1:09 AM Christian Biesinger > <cbiesinger@google.com> wrote: > > > > On Sun, Sep 29, 2019 at 12:01 AM Jeffrey Walton <noloader@gmail.com> wrote: > > > I've got a C++ program built from a source called pem_test.cxx. I'm > > > having trouble getting GDB to accept it. Autocomplete does not work: > > > > > > (gdb) b pem_<TAB> > > > pem_common.cpp pem_common.h pem_read.cpp pem_write.cpp > > > > GDB gets the list of files from the debug data in the binary, not from > > the current directory. Are you sure you compiled pem_test.cxx into the > > binary? > > Yes. A 'b main' stops in pem_test.cxx. > > The recipe to build pem_test.cxx is at > https://github.com/noloader/cryptopp-pem/blob/master/pem_create_keys.sh#L42 This line: "$CXX" "$CXXFLAGS" pem_test.cxx ./libcryptopp.a -o pem_test.exe passes "-DDEBUG -g3 -O0 -Wall" as a single option. So, it's the same as -D"DEBUG -g3 -O0 -Wall". Thus the -g3 isn't passed as symbol generation option. Try removing the quotes. > > Jeff Regards, Ruslan ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-09-29 21:23 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <CAH8yC8nWS-oFKVOLR1=924a2X_RSwV6j8+keyJHb1tgvqpqEsQ@mail.gmail.com>
2019-09-29 5:09 ` GDB does not recognize cxx extension? Christian Biesinger via gdb
2019-09-29 5:17 ` Jeffrey Walton
2019-09-29 5:51 ` Christian Biesinger via gdb
2019-09-29 6:49 ` Jeffrey Walton
2019-09-29 15:48 ` Christian Biesinger via gdb
2019-09-29 21:23 ` Ruslan Kabatsayev
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox