This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: GDB does not recognize cxx extension?
- From: Jeffrey Walton <noloader at gmail dot com>
- To: Christian Biesinger <cbiesinger at google dot com>
- Cc: gdb at sourceware dot org
- Date: Sun, 29 Sep 2019 02:48:20 -0400
- Subject: Re: GDB does not recognize cxx extension?
- References: <CAH8yC8nWS-oFKVOLR1=924a2X_RSwV6j8+keyJHb1tgvqpqEsQ@mail.gmail.com> <CAPTJ0XFYtm-ngCHsc40_VqH61G80d2JWqVao_p5CYr0JAHR3QA@mail.gmail.com> <CAH8yC8k1vu2bf=hxi6ULrwRTXhrvc18Q_Kq7Ur1F7+=ogCA+iQ@mail.gmail.com> <CAPTJ0XH82z4=vNj5sAgTfASeoLO_9AdsMsBFiE-s=OdOfB0fRg@mail.gmail.com>
- Reply-to: noloader at gmail dot com
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