gdb调试ns3出现的问题-找不到库
问题:gdb调试ns3出现错误,[root@gdc1000 examples]# gdb ns3.23-dumbbell-animation-debugGNU gdb (GDB) Red Hat Enterprise Linux (7.2-75.el6)Copyright (C) 2010 Free Software Foundation, Inc.License GPLv3+:
问题:gdb调试ns3出现错误,
[root@gdc1000 examples]# gdb ns3.23-dumbbell-animation-debug
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-75.el6)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/gftp/tool/network/dce2/source/ns-3.23/build/src/netanim/examples/ns3.23-dumbbell-animation-debug...done.
(gdb) r --nLeftLeaf=5 --nRightLeaf=5 –animFile=dumbbell.xml
Starting program: /home/gftp/tool/network/dce2/source/ns-3.23/build/src/netanim/examples/ns3.23-dumbbell-animation-debug --nLeftLeaf=5 --nRightLeaf=5 –animFile=dumbbell.xml
/home/gftp/tool/network/dce2/source/ns-3.23/build/src/netanim/examples/ns3.23-dumbbell-animation-debug: error while loading shared libraries: libns3.23-netanim-debug.so: cannot open shared object file: No such file or directory
Program exited with code 0177.
(gdb) q
在对应的build目录下有库,但是没有找到。
http://blog.csdn.net/dumeifang/article/details/2963223
里面说,
出现这类错误表示,系统不知道xxx.so放在哪个目录下,这时候就要在/etc/ld.so.conf中加入xxx.so所在的目录。
一般而言,有很多的so会存放在/usr/local/lib这个目录底下,去这个目录底下找,果然发现自己所需要的.so文件。
所以,在/etc/ld.so.conf中加入/usr/local/lib这一行,保存之后,再运行:/sbin/ldconfig –v更新一下配置即可。
定位处置:
重新执行bake.py build看看到底安装到哪里了?
OK
>> Building ns-3.23 - execute: /home/gftp/tool/network/dce2/source/ns-3.23 ['/home/gftp/tool/network/dce2/source/ns-3.23/waf', 'configure', '--prefix=/home/gftp/tool/network/dce2/build', '--enable-examples', '--enable-tests'].
execute: /home/gftp/tool/network/dce2/source/ns-3.23 ['/home/gftp/tool/network/dce2/source/ns-3.23/waf'].
execute: /home/gftp/tool/network/dce2/source/ns-3.23 ['/home/gftp/tool/network/dce2/source/ns-3.23/waf', 'install'].
OK
>> Building dce-linux-1.6 - execute: /home/gftp/tool/network/dce2/source/ns-3-dce ['/home/gftp/tool/network/dce2/source/ns-3-dce/waf', 'configure', '--prefix=/home/gftp/tool/network/dce2/build', '--with-ns3=/home/gftp/tool/network/dce2/build', '--with-elf-loader=/home/gftp/tool/network/dce2/build/lib', '--enable-kernel-stack=/home/gftp/tool/network/dce2/source/ns-3-dce/../net-next-sim-2.6.36/arch'].
execute: /home/gftp/tool/network/dce2/source/ns-3-dce ['/home/gftp/tool/network/dce2/source/ns-3-dce/waf'].
execute: /home/gftp/tool/network/dce2/source/ns-3-dce ['/home/gftp/tool/network/dce2/source/ns-3-dce/waf', 'install'].
OK
那么接着执行./waf install,发现安装到了
- install /home/gftp/tool/network/dce2/build/bin/dce-xfrm (from build/bin/dce-xfrm)
- install /home/gftp/tool/network/dce2/build/bin/dce-ltp (from build/bin/dce-ltp)
- install /home/gftp/tool/network/dce2/build/bin/dce-iperf-mptcp (from build/bin/dce-iperf-mptcp)
- install /home/gftp/tool/network/dce2/build/bin/dce-cradle-mptcp (from build/bin/dce-cradle-mptcp)
- install /home/gftp/tool/network/dce2/build/bin/dce-mptcp-handoff-v6 (from build/bin/dce-mptcp-handoff-v6)
- install /home/gftp/tool/network/dce2/build/bin/dce-mptcp-handoff-v4v6 (from build/bin/dce-mptcp-handoff-v4v6)
- install /home/gftp/tool/network/dce2/build/bin/dce-mptcp-lte-wifi (from build/bin/dce-mptcp-lte-wifi)
- install /home/gftp/tool/network/dce2/build/bin/dce-tcp-ns3-nsc-comparison (from build/bin/dce-tcp-ns3-nsc-comparison)
- install /home/gftp/tool/network/dce2/build/bin/dce-mptcp-lte-wifi-v6 (from build/bin/dce-mptcp-lte-wifi-v6)
- install /home/gftp/tool/network/dce2/build/bin/dce-cradle-simple (from build/bin/dce-cradle-simple)
- install /home/gftp/tool/network/dce2/build/bin/dce-httpd (from build/bin/dce-httpd)
- install /home/gftp/tool/network/dce2/build/bin/dce-wifi-ccnx (from build/bin/dce-wifi-ccnx)
- install /home/gftp/tool/network/dce2/build/bin/dce-freebsd (from build/bin/dce-freebsd)
- install /home/gftp/tool/network/dce2/build/bin/test-runner-vdl (from build/bin/test-runner-vdl)
- install /home/gftp/tool/network/dce2/build/bin/test-runner (from build/bin/test-runner)
- install /home/gftp/tool/network/dce2/build/lib/libc-ns3.so (from build/lib/libc-ns3.so)
- install /home/gftp/tool/network/dce2/build/bin/dcemakeversion (from build/dcemakeversion)
- install /home/gftp/tool/network/dce2/build/lib/librt-ns3.so (from build/lib/librt-ns3.so)
- install /home/gftp/tool/network/dce2/build/lib/libpthread-ns3.so (from build/lib/libpthread-ns3.so)
- install /home/gftp/tool/network/dce2/build/bin/dce-runner (from build/bin/dce-runner)
- install /home/gftp/tool/network/dce2/build/lib/libm-ns3.so (from build/lib/libm-ns3.so)
Waf: Leaving directory `/home/gftp/tool/network/dce2/source/ns-3-dce/build'
'install' finished successfully (0.637s)
此处的解决办法:
1 我清空了ldconfig, 里面为空
2 我重启设备
3 我重新编译了ns3 (使用bake)
此后就找不到连接库的问题就解决了。
怀疑是我ldconfig里有一些以前自己加的库,导致影响编译链接。
至少目前结果如下,
(gdb) b RunIp(ns3::Ptr<ns3::Node>, ns3::Time, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)
Breakpoint 1 at 0x40da59: file ../myscripts/ns-3-dce-quagga/example/dce-quagga-ospfd.cc, line 34.
(gdb) r
Starting program: /home/gftp/tool/network/newbake/dce/source/ns-3-dce/build/myscripts/ns-3-dce-quagga/bin/dce-quagga-ospfd --netStack=ns3
warning: the debug information found in "/usr/lib/debug//lib64/libm-2.12.so.debug" does not match "/lib64/libm.so.6" (CRC mismatch).
warning: the debug information found in "/usr/lib/debug/lib64/libm-2.12.so.debug" does not match "/lib64/libm.so.6" (CRC mismatch).
[Thread debugging using libthread_db enabled]
warning: the debug information found in "/usr/lib/debug//lib64/libc-2.12.so.debug" does not match "/lib64/libc.so.6" (CRC mismatch).
warning: the debug information found in "/usr/lib/debug/lib64/libc-2.12.so.debug" does not match "/lib64/libc.so.6" (CRC mismatch).
Program received signal SIGUSR1, User defined signal 1.
0x00007ffff4e605db in raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/pt-raise.c:42
42 sig);
Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.149.el6_6.9.x86_64 gsl-1.13-1.el6.x86_64
(gdb)
更多推荐
所有评论(0)