gdb load local shared object

1 篇文章 0 订阅
[url]
http://ftp.gnu.org/old-gnu/Manuals/gdb/html_node/gdb_118.html[/url]
[url]
http://visualgdb.com/gdbreference/commands/set_solib-search-path
[/url]

[quote]
[color=blue]root@jason:/opt/lxc/src/lxc# gdb ./lxc-attach [/color]
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 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-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./lxc-attach...done.
[color=blue](gdb) set solib-search-path /opt/lxc/[/color]
aclocal.m4 autom4te.cache/ config.status CONTRIBUTING .git/ INSTALL lxc.spec Makefile NEWS templates/
AUTHORS config/ configure COPYING .gitignore lxc.pc lxc.spec.in Makefile.am README .travis.yml
autogen.sh config.log configure.ac doc/ hooks/ lxc.pc.in MAINTAINERS Makefile.in src/
[color=blue](gdb) set solib-search-path /opt/lxc/src/lxc/[/color]
[color=blue](gdb) b lxc_attach[/color]
Breakpoint 1 at 0x400b50
[color=blue](gdb) run -n p2[/color]
Starting program: /opt/lxc/src/lxc/lxc-attach -n p2
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Breakpoint 1, lxc_attach (name=0x7fffffffe7a4 "p2", lxcpath=0x604070 "/usr/local/var/lib/lxc", exec_function=0x400b40 <lxc_attach_run_shell@plt>, exec_payload=exec_payload@entry=0x0,
options=options@entry=0x7fffffffe3d0, attached_process=attached_process@entry=0x7fffffffe3bc) at attach.c:695
695 {
[color=blue](gdb) l[/color]
690 free(p);
691 return ret;
692 }
693
694 int lxc_attach(const char* name, const char* lxcpath, lxc_attach_exec_t exec_function, void* exec_payload, lxc_attach_options_t* options, pid_t* attached_process)
695 {
696 int ret, status;
697 pid_t init_pid, pid, attached_pid, expected;
698 struct lxc_proc_context_info *init_ctx;
699 char* cwd;
[color=blue](gdb) l[/color]
[color=red](gdb) info sharedlibrary[/color]
From To Syms Read Shared Object Library
0x00007ffff7ddaae0 0x00007ffff7df54e0 Yes /lib64/ld-linux-x86-64.so.2
0x00007ffff7b768b0 0x00007ffff7bbd25c Yes /opt/lxc/src/lxc/liblxc.so
0x00007ffff77c24a0 0x00007ffff7907583 Yes /lib/x86_64-linux-gnu/libc.so.6
0x00007ffff75a0f10 0x00007ffff75a1804 Yes /lib/x86_64-linux-gnu/libutil.so.1
0x00007ffff73879f0 0x00007ffff73944a1 Yes /lib/x86_64-linux-gnu/libpthread.so.0
[/quote]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值