- 浏览: 1476955 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (691)
- linux (207)
- shell (33)
- java (42)
- 其他 (22)
- javascript (33)
- cloud (16)
- python (33)
- c (48)
- sql (12)
- 工具 (6)
- 缓存 (16)
- ubuntu (7)
- perl (3)
- lua (2)
- 超级有用 (2)
- 服务器 (2)
- mac (22)
- nginx (34)
- php (2)
- 内核 (2)
- gdb (13)
- ICTCLAS (2)
- mac android (0)
- unix (1)
- android (1)
- vim (1)
- epoll (1)
- ios (21)
- mysql (3)
- systemtap (1)
- 算法 (2)
- 汇编 (2)
- arm (3)
- 我的数据结构 (8)
- websocket (12)
- hadoop (5)
- thrift (2)
- hbase (1)
- graphviz (1)
- redis (1)
- raspberry (2)
- qemu (31)
- opencv (4)
- socket (1)
- opengl (1)
- ibeacons (1)
- emacs (6)
- openstack (24)
- docker (1)
- webrtc (11)
- angularjs (2)
- neutron (23)
- jslinux (18)
- 网络 (13)
- tap (9)
- tensorflow (8)
- nlu (4)
- asm.js (5)
- sip (3)
- xl2tp (5)
- conda (1)
- emscripten (6)
- ffmpeg (10)
- srt (1)
- wasm (5)
- bert (3)
- kaldi (4)
- 知识图谱 (1)
最新评论
-
wahahachuang8:
我喜欢代码简洁易读,服务稳定的推送服务,前段时间研究了一下go ...
websocket的helloworld -
q114687576:
http://www.blue-zero.com/WebSoc ...
websocket的helloworld -
zhaoyanzimm:
感谢您的分享,给我提供了很大的帮助,在使用过程中发现了一个问题 ...
nginx的helloworld模块的helloworld -
haoningabc:
leebyte 写道太NB了,期待早日用上Killinux!么 ...
qemu+emacs+gdb调试内核 -
leebyte:
太NB了,期待早日用上Killinux!
qemu+emacs+gdb调试内核
gdb保留历史:
show history
set history expansion
set history save
sethistory size 256
保存在 ~/.gdb_history
干掉的进程会重建
__epoll_wait_nocancel ()
怎么建立的?不要忽略!!
ctrl+f
(gdb)
show history
set history expansion
set history save
sethistory size 256
保存在 ~/.gdb_history
干掉的进程会重建
__epoll_wait_nocancel ()
怎么建立的?不要忽略!!
ctrl+f
(gdb)
[root@red54apple gdbtest]# gdb GNU gdb Fedora (6.8-37.el5) Copyright (C) 2008 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". (gdb) attach 4992 Attaching to process 4992 Reading symbols from /opt/backup/mynginx/workdir/nginx-1.0.5/objs/nginx...done. Reading symbols from /lib64/libpthread.so.0...done. [Thread debugging using libthread_db enabled] [New Thread 0x2b8b4d052520 (LWP 4992)] Loaded symbols for /lib64/libpthread.so.0 Reading symbols from /lib64/libcrypt.so.1...done. Loaded symbols for /lib64/libcrypt.so.1 Reading symbols from /lib64/libm.so.6...done. Loaded symbols for /lib64/libm.so.6 Reading symbols from /lib64/libcrypto.so.6...done. Loaded symbols for /lib64/libcrypto.so.6 Reading symbols from /usr/lib64/libz.so.1...done. Loaded symbols for /usr/lib64/libz.so.1 Reading symbols from /lib64/libc.so.6...done. Loaded symbols for /lib64/libc.so.6 Reading symbols from /lib64/ld-linux-x86-64.so.2...done. Loaded symbols for /lib64/ld-linux-x86-64.so.2 Reading symbols from /lib64/libdl.so.2...done. Loaded symbols for /lib64/libdl.so.2 Reading symbols from /lib64/libnss_files.so.2...done. Loaded symbols for /lib64/libnss_files.so.2 0x0000003b6e23079a in sigsuspend () from /lib64/libc.so.6 (gdb) info proc process 4992 cmdline = 'nginx: master process /usr/local/nginx/objs/nginx' cwd = '/root/gdbtest' exe = '/opt/backup/mynginx/workdir/nginx-1.0.5/objs/nginx' (gdb) q The program is running. Quit anyway (and detach it)? (y or n) y Detaching from program: /opt/backup/mynginx/workdir/nginx-1.0.5/objs/nginx, process 4992 [root@red54apple gdbtest]# pidof /usr/local/nginx/objs/nginx 5000 4999 4998 4997 4996 4995 4994 4993 4992 [root@red54apple gdbtest]# [root@red54apple gdbtest]# [root@red54apple gdbtest]# gdb GNU gdb Fedora (6.8-37.el5) Copyright (C) 2008 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". (gdb) attach 4999 Attaching to process 4999 Reading symbols from /opt/backup/mynginx/workdir/nginx-1.0.5/objs/nginx...done. Reading symbols from /lib64/libpthread.so.0...done. [Thread debugging using libthread_db enabled] [New Thread 0x2b8b4d052520 (LWP 4999)] Loaded symbols for /lib64/libpthread.so.0 Reading symbols from /lib64/libcrypt.so.1...done. Loaded symbols for /lib64/libcrypt.so.1 Reading symbols from /lib64/libm.so.6...done. Loaded symbols for /lib64/libm.so.6 Reading symbols from /lib64/libcrypto.so.6...done. Loaded symbols for /lib64/libcrypto.so.6 Reading symbols from /usr/lib64/libz.so.1...done. Loaded symbols for /usr/lib64/libz.so.1 Reading symbols from /lib64/libc.so.6...done. Loaded symbols for /lib64/libc.so.6 Reading symbols from /lib64/ld-linux-x86-64.so.2...done. Loaded symbols for /lib64/ld-linux-x86-64.so.2 Reading symbols from /lib64/libdl.so.2...done. Loaded symbols for /lib64/libdl.so.2 Reading symbols from /lib64/libnss_files.so.2...done. Loaded symbols for /lib64/libnss_files.so.2 0x0000003b6e2d3fd3 in __epoll_wait_nocancel () from /lib64/libc.so.6 (gdb) info proc process 4999 cmdline = 'nginx: worker process' cwd = '/root/gdbtest' exe = '/opt/backup/mynginx/workdir/nginx-1.0.5/objs/nginx' (gdb) info args No symbol table info available. (gdb) b proc Function "proc" not defined. Make breakpoint pending on future shared library load? (y or [n]) n (gdb) x proc No symbol "proc" in current context. (gdb) info *proc Undefined info command: "*proc". Try "help info". (gdb) info program Using the running image of attached Thread 0x2b8b4d052520 (LWP 4999). Program stopped at 0x6e2d3fd3. (gdb) x 0x2b8b4d052520 0x2b8b4d052520: 0x4d052520 (gdb) x/c 0x2b8b4d052520 0x2b8b4d052520: 32 ' ' (gdb) x/i 0x2b8b4d052520 0x2b8b4d052520: and %ah,0x2b8b4d05(%rip) # 0x2b8b7890722b (gdb) p port.6281 No symbol "port" in current context. (gdb) shell ps -ef|grep nginx root 4992 1 0 Sep22 ? 00:00:00 nginx: master process /usr/local/nginx/objs/nginx nobody 4993 4992 0 Sep22 ? 00:00:00 nginx: worker process nobody 4994 4992 0 Sep22 ? 00:00:00 nginx: worker process nobody 4995 4992 0 Sep22 ? 00:00:00 nginx: worker process nobody 4996 4992 0 Sep22 ? 00:00:00 nginx: worker process nobody 4997 4992 0 Sep22 ? 00:00:00 nginx: worker process nobody 4998 4992 0 Sep22 ? 00:00:00 nginx: worker process nobody 4999 4992 0 Sep22 ? 00:00:00 nginx: worker process nobody 5000 4992 0 Sep22 ? 00:00:00 nginx: worker process root 5121 5082 0 00:15 pts/1 00:00:00 bash -c ps -ef|grep nginx root 5123 5121 0 00:15 pts/1 00:00:00 grep nginx (gdb) attach 4992 A program is being debugged already. Kill it? (y or n) y Attaching to program: /opt/backup/mynginx/workdir/nginx-1.0.5/objs/nginx, process 4992 [Thread debugging using libthread_db enabled] [New Thread 0x2b8b4d052520 (LWP 4992)] Loaded symbols for /lib64/libpthread.so.0 Loaded symbols for /lib64/libcrypt.so.1 Loaded symbols for /lib64/libm.so.6 Loaded symbols for /lib64/libcrypto.so.6 Loaded symbols for /usr/lib64/libz.so.1 Loaded symbols for /lib64/libc.so.6 Loaded symbols for /lib64/ld-linux-x86-64.so.2 Loaded symbols for /lib64/libdl.so.2 Loaded symbols for /lib64/libnss_files.so.2 ngx_vslprintf (buf=0x6d881c "", last=0xffffffffffffffff <Address 0xffffffffffffffff out of bounds>, fmt=0x4ae2fb "%4d/%02d/%02d %02d:%02d:%02d", args=0x7fff1a77bb30) at src/core/ngx_string.c:157 157 while (*fmt && buf < last) { (gdb) shell ps -ef|grep nginx
[root@red54apple ~]# gdb GNU gdb Fedora (6.8-37.el5) Copyright (C) 2008 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". (gdb) shell pidof /usr/local/nginx/objs/nginx 5283 5279 5222 5000 4996 4995 4994 4993 4992 (gdb) x/i $pc No registers. (gdb) show reg Undefined show command: "reg". Try "help show". (gdb) attach 5283 Attaching to process 5283 Reading symbols from /opt/backup/mynginx/workdir/nginx-1.0.5/objs/nginx...done. Reading symbols from /lib64/libpthread.so.0...done. [Thread debugging using libthread_db enabled] [New Thread 0x2b8b4d052520 (LWP 5283)] Loaded symbols for /lib64/libpthread.so.0 Reading symbols from /lib64/libcrypt.so.1...done. Loaded symbols for /lib64/libcrypt.so.1 Reading symbols from /lib64/libm.so.6...done. Loaded symbols for /lib64/libm.so.6 Reading symbols from /lib64/libcrypto.so.6...done. Loaded symbols for /lib64/libcrypto.so.6 Reading symbols from /usr/lib64/libz.so.1...done. Loaded symbols for /usr/lib64/libz.so.1 Reading symbols from /lib64/libc.so.6...done. Loaded symbols for /lib64/libc.so.6 Reading symbols from /lib64/ld-linux-x86-64.so.2...done. Loaded symbols for /lib64/ld-linux-x86-64.so.2 Reading symbols from /lib64/libdl.so.2...done. Loaded symbols for /lib64/libdl.so.2 Reading symbols from /lib64/libnss_files.so.2...done. Loaded symbols for /lib64/libnss_files.so.2 0x0000003b6e2d3fd3 in __epoll_wait_nocancel () from /lib64/libc.so.6 (gdb) show reg Undefined show command: "reg". Try "help show". (gdb) info reg rax 0xfffffffffffffffc -4 rbx 0x3b6e01bbc0 255248677824 rcx 0xffffffffffffffff -1 rdx 0x200 512 rsi 0x13cf1370 332338032 rdi 0x16 22 rbp 0x7fff1a77bfb0 0x7fff1a77bfb0 rsp 0x7fff1a77bf28 0x7fff1a77bf28 r8 0x17566ce 24471246 r9 0x4e7b688a 1316710538 r10 0x5 5 r11 0x246 582 r12 0x0 0 r13 0x7fff1a77c550 140733637444944 r14 0x0 0 r15 0x0 0 rip 0x3b6e2d3fd3 0x3b6e2d3fd3 <__epoll_wait_nocancel+10> eflags 0x246 [ PF ZF IF ] cs 0x33 51 ss 0x2b 43 ds 0x0 0 es 0x0 0 fs 0x0 0 gs 0x0 0 fctrl 0x37f 895 fstat 0x0 0 ftag 0xffff 65535 fiseg 0x0 0 fioff 0x0 0 foseg 0x0 0 fooff 0x0 0 fop 0x0 0 mxcsr 0x1f80 [ IM DM ZM OM UM PM ] (gdb) x/i $pc 0x3b6e2d3fd3 <__epoll_wait_nocancel+10>: cmp $0xfffffffffffff001,%rax (gdb) (gdb) x/10i $pc 0x3b6e2d3fd3 <__epoll_wait_nocancel+10>: cmp $0xfffffffffffff001,%rax 0x3b6e2d3fd9 <__epoll_wait_nocancel+16>: jae 0x3b6e2d4038 <epoll_wait+120> 0x3b6e2d3fdb <__epoll_wait_nocancel+18>: retq 0x3b6e2d3fdc <epoll_wait+28>: sub $0x28,%rsp 0x3b6e2d3fe0 <epoll_wait+32>: mov %rdi,0x8(%rsp) 0x3b6e2d3fe5 <epoll_wait+37>: mov %rsi,0x10(%rsp) 0x3b6e2d3fea <epoll_wait+42>: mov %rdx,0x18(%rsp) 0x3b6e2d3fef <epoll_wait+47>: mov %rcx,0x20(%rsp) 0x3b6e2d3ff4 <epoll_wait+52>: callq 0x3b6e2dfa80 <__libc_enable_asynccancel> 0x3b6e2d3ff9 <epoll_wait+57>: mov 0x8(%rsp),%rdi (gdb)
发表评论
-
nginx模块开发(二) 使用gdb-dashboard调试
2017-08-11 18:47 2005gdb-dashboard或者 gdbgui 或者gdb自带 ... -
qemu+emacs+gdb调试内核
2015-12-02 22:15 2807core生成的位置 echo “/data/coredump/ ... -
gdb emacs
2015-11-20 22:24 748参考 http://www.cnblogs.com/q ... -
GDB的堆栈
2012-09-16 18:16 3315#include <stdio.h> #in ... -
gdb log
2012-09-11 23:38 1551有时候比如使用gdb的时候 查看help很长, 比如 hel ... -
gdb参数
2011-12-06 23:46 960参考http://hong7917-163-com.iteye ... -
value optimized out
2011-12-05 11:36 4616gdb -d ../nginx_10081/sbin/ ngi ... -
mac下的gdb生成core
2011-11-29 00:33 5082lion下似乎没有/etc/sysctl.conf 如果是li ... -
查看进程的内存映射
2011-09-24 00:04 3410cat /proc/<PID>/maps 或 ( ... -
(转载)gdb调试java
2011-09-21 23:12 1567转载http://blog.csdn.net/haoe ... -
gdb调试nginx的helloworld
2011-09-21 00:09 5018假设nginx装在了/usr/local/nginx/ ./n ... -
gdb的helloworld
2011-09-16 22:35 1161想起东软的1个linux老师,就讲了两天基本就把这书讲完了, ...
相关推荐
GDB(GNU Debugger)是GNU项目的一个组成部分,是一款强大的源代码级调试器,适用于C、C++、Fortran、Objective-C、Python等语言。这款工具允许程序员在运行代码时检查程序的状态,包括变量值、内存区域、调用堆栈等...
GDB(GNU Debugger)是GNU项目的一个开源工具,用于调试C、C++和其他语言编写的程序。...总之,GDB和GDB64是强大的调试工具,对于软件开发人员来说不可或缺。了解并熟练使用它们能够显著提高调试效率,解决复杂的问题。
《深入理解GDB:GNU调试器的探索与实践》 ...熟练掌握GDB的使用,对于任何Unix环境下的开发者来说,都是必不可少的技能之一。通过阅读和学习GDB的相关资料,如《GDB.pdf》,你将能深入理解并充分利用这个强大的工具。
如果gdb不支持clang生成的dwarf版本,就可能导致解析失败。 2. **bug或不兼容性**:gdb或clang可能存在已知的bug,导致在特定版本下dwarf信息不能正确读取。检查官方更新日志和社区论坛可以找出是否已有相关的修复...
在编译GDB之前,需要确保ncurses已经编译成功,并将其生成的文件夹拷贝到指定的目录下。然后,进入GDB的根目录,输入以下命令生成Makefile文件: ./configure --host=arm-none-linux-gnueabi --prefix="$PWD/../...
GNU调试器(GDB)是一款功能强大的源码级调试工具,适用于多种编程语言,包括但不限于C、C++等。该手册针对的是GDB的第六版,版本号为6.8.50.20090706,提供了详细的使用指导。 #### 二、GDB入门 **2.1 调用GDB** ...
在编程过程中,特别是进行低级别调试或优化代码时,GDB是一个不可或缺的工具。它允许程序员设置断点、单步执行代码、检查变量值、跟踪调用堆栈等,从而帮助找出程序中的错误。 描述中提到,在使用OpenCV(一个流行...
- **GDB命令体系**:GDB的命令体系丰富且强大,包括但不限于命令语法解析、自动补全、获取帮助等功能,极大地提高了调试效率和用户体验。 #### 三、在GDB下运行程序 - **适合调试的编译**:为了确保GDB能够正确...
标签“资源文件”表明这是开发过程中可能需要的工具或库,对于编写和调试代码来说是必不可少的。 在压缩包中的"gdb文件"可能包含GDB的配置文件、文档、库或其他相关资源。这些资源可能包括: 1. **配置文件**:如`...
GDB 官方用户手册是 GNU 调试器的一份官方文档,用于帮助用户学习和掌握 GDB 的使用方法和技术。本手册涵盖了 GDB 的基本概念、基本使用方法、调试技术、进阶技术等方面的知识点。 知识点 1: GDB 的基本概念 GDB...
gdb-8.1是GDB的一个较新版本,可能包含了更多的功能改进和错误修复,而gdb-7.7.1则是一个稍旧的稳定版本,适合那些对新特性需求不强但注重稳定性的用户。 描述中提到的“下载完该软件包,解压后可以看到gdb-7.7.1....
GDB的主要功能包括但不限于: 1. **程序启动控制**:用户可以根据自己的需求启动并运行程序。 2. **设置断点**:可以在特定位置或满足特定条件时暂停程序执行。 3. **状态检查**:当程序暂停时,可以检查当前程序的...
GDB,全称为GNU调试器(GNU Debugger),是开源的、跨平台的C/C++、Fortran、Python等编程语言的调试工具。它允许程序员在程序运行时检查其内部状态,包括变量值、内存区域、堆栈跟踪以及指令执行等,从而帮助定位和...
这通常涉及到开发人员能够利用GDB的功能,通过VS2022的用户界面来调试不在本地运行的程序,比如在嵌入式设备或者不同操作系统上运行的程序。 标签"virtualgdb"和"vs2022"是关键词,分别代表虚拟GDB工具和Visual ...
《VisualGDB 5.3r8:高效ARM软件开发的得力助手》 VisualGDB是一款强大的集成开发环境插件,专为在Microsoft Visual ...如果你是Visual Studio的忠实用户,又需要处理ARM项目,VisualGDB无疑是你不可或缺的工具。
**GDB 不完全手册( 入门篇)** GDB,全称为GNU Debugger,是一款用于软件调试的强大工具,尤其在Linux环境下广泛使用。虽然它主要应用于Linux系统,但也有移植到Win32平台上的版本,使得Windows用户也能利用其进行...
GDB(GNU Debugger)是一个强大的调试工具,能够帮助开发者在C/C++等语言的程序中查找和定位内存泄露的问题。下面将详细介绍如何使用GDB来查找和分析内存泄露。 首先,内存泄露通常发生在动态分配的内存没有被正确...
同时,确保系统已经更新到最新版本,以避免兼容性问题。 2. **安装依赖** 在Ubuntu或Debian系系统中,GDB可能依赖于`build-essential`包,包含了编译GDB所需的工具。通过运行以下命令安装: ``` sudo apt-get ...
在Linux系统中,`/`是根目录,通常不建议在这里放置用户文件,但假设这是为了演示目的。实际操作时,推荐在个人目录如`/home/username`下创建一个特定的文件夹来存放这些工具。 解压完成后,你可以找到两个主要的...