Re: GDB does not recognize cxx extension?

"Christian Biesinger via gdb" <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <CAPTJ0XFYtm-ngCHsc40_VqH61G80d2JWqVao_p5CYr0JAHR3QA@mail.gmail.com>
On Sun, Sep 29, 2019 at 12:01 AM Jeffrey Walton <[email protected]> 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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.