[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]
引用
root@jason:/opt/lxc/src/lxc# gdb ./lxc-attach
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.
(gdb) set solib-search-path /opt/lxc/
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/
(gdb) set solib-search-path /opt/lxc/src/lxc/
(gdb) b lxc_attach
Breakpoint 1 at 0x400b50
(gdb) run -n p2
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 {
(gdb) l
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;
(gdb) l
(gdb) info sharedlibrary
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
分享到:
相关推荐
GDB详细手册,文档内部分内容: //查看运行中的线程 (gdb) info thread //查看线程 (gdb) thread <n> //切换为线程id (gdb) bt //backtrace 打印堆栈 (gdb) break xx.cpp:xx thread all //在所有线程上打断点 (gdb) ...
使用GDB调试,英文版。对于从事 Linux C/C++ 后台开发的读者来说,GDB 调试是需要熟练掌握的一项技能
gdb: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked (uses shared libs), not stripped。自己编译的。实测android 6.0 可用。
GDB调试GDB调试GDB调试GDB调试GDB调试 GDB调试GDB调试GDB调试GDB调试GDB调试
这是GDB完全手册,用来在Linux环境下的GDB调试,很重要
可以打印map,vector等 只要 source stl-views-1.0.3.gdb
gdb 源码
GDB完全手册GDB完全手册GDB完全手册GDB完全手册GDB完全手册
XP %USERPROFILE%\Local Settings\Application Data\VisualGDB WIN7 %USERPROFILE%\AppData\Local\VisualGDB 2 copy VisualGDB.exe to %ProgramFiles%\Sysprogs\VisualGDB 3 import reg.reg 最后一定要 ...
GDB中文手册 介绍GDB的基本调试方法
GDB的一点小知识。GDB的一点儿经验。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
gdb64.exe和gdb.exe,呐,如名字所示喽
gdb调试案例gdb64常用命令说明: [root@redhat home]#gdb 调试文件:启动gdb (gdb) l :(字母l)从第一行开始列出源码 (gdb) break n :在第n行处设置断点 (gdb) break func:在函数func()的入口处设置断点 (gdb) ...
用于gdb调试过程中打印json...由于gdb脚本的递归有问题,打印数组中包含多个对象时打印有问题 命令“pjson object”。此脚本基于http://www.yolinux.com/TUTORIALS/src/dbinit_stl_views-1.03.txt修改,可以用于调试stl
gdb手册debuging with gdb 中文版本的
gdb调试器的使用gdb调试器的使用gdb调试器的使用gdb调试器的使用gdb调试器的使用
GDB官网用户手册
debugging with GDB GDB使用指南
Linux下的gdb调试程序的教程,根据几个程序代码的实例,介绍gdb的详细调试教程,我就是跟这个教程学的。效果还行。