How to debug a program wrapped in a libtool script?

后端 未结 2 1605
故里飘歌
故里飘歌 2021-02-07 15:58

I have a project involving

  • shared libraries ie: mylib.so
  • (test) program using these shared libraries ie: test_mylib
2条回答
  •  温柔的废话
    2021-02-07 16:15

    This is problem I ran into a couples of days ago and there is no generic answer on SO yet. Only special cases. Here is the answer I found on this page: http://www.gnu.org/software/libtool/manual/html_node/Debugging-executables.html

    Until the program is installed, the system does not know where to look for the shared objects. They usually lies in .libs sub-directory of their source folder.

    Libtool generates a convenience script to allow debugging before the actual installation is done (who wants to install buggy software before, debug it after?)

    Fortunately, the generated script provides a helper for this:

    libtool --mode=execute gdb test_mylib
    

提交回复
热议问题