C++ app on Ubuntu. After installing gcc 4.8.1 the gdb does not work

后端 未结 2 1912
失恋的感觉
失恋的感觉 2021-02-14 18:26

I installed gcc 4.8.1 on Ubuntu 12.04 (I had to add ppa to do that) now gdb displays the following message:

Unable to find dynamic linker breakpoint function. GDB will b

相关标签:
2条回答
  • 2021-02-14 18:52

    Gdb is usually shipped with the toolchain.

    You're probably using gdb shipped with the previous toolchain. Use

      which gdb
    

    to discover which gdb you're using.

    To debug a program compiled with the new compiler, you have to use the new gdb, weherever it is.

    0 讨论(0)
  • 2021-02-14 19:17

    I also had the same problem and was able to solve it.

    I installed the last "stable" version of GCC (4.8.1) from this PPA (https://launchpad.net/~ubuntu-toolchain-r/+archive/test), and everything was perfect until I had to deal with the debugging issue. You can notice that in this PPA the toolchain does not provide an updated version of GDB for dealing with the compiler upgrade. In fact, I didn't found any PPA providing a newer version of GDB.

    In my case I solved this situation downloading and installing the latest stable version of GDB (7.6) from its website (http://www.sourceware.org/gdb/). This version of GDB is able to resolve the symbols and give me all the necessary information of binaries generated with Gcc 4.8.1, even if I'm using the new c++11 standard (code compiled with the -std=c++11 flag).

    Take into account that installing this new version of GDB manually will install, by default, the binary in /usr/local/bin/gdb.

    0 讨论(0)
提交回复
热议问题