`
haoningabc
  • 浏览: 1465693 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

nginx模块开发(二) 使用gdb-dashboard调试

阅读更多
gdb-dashboard或者 gdbgui
或者gdb自带的tui(ctl x + a )

gdb-dashboard这个样子

https://github.com/cyrus-and/gdb-dashboard

https://metricpanda.com/tips-for-productive-debugging-with-gdb


如果报错
[root@mcompute705 ~]# gdb
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-94.el7
Copyright (C) 2013 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/>.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "<string>", line 387, in start
  File "<string>", line 290, in load_modules
  File "<string>", line 493, in __init__
  File "<string>", line 523, in add_subcommands
  File "<string>", line 1402, in commands
AttributeError: 'module' object has no attribute 'COMPLETE_EXPRESSION'
/root/.gdbinit:1432: Error in sourced command file:
Error while executing Python code.
>>> 




https://github.com/cyrus-and/gdb-dashboard/issues/1#issuecomment-176717956


Actually, overcoming the lack of gdb.COMPLETE_EXPRESSION is quite easy, just add:

python gdb.COMPLETE_EXPRESSION = gdb.COMPLETE_SYMBOL
as the first line in .gdbinit.


gdbgui
https://reverseengineering.stackexchange.com/questions/1392/decent-gui-for-gdb
https://github.com/cs01/gdbgui
gdb dashboard
https://github.com/cyrus-and/gdb-dashboard
gdbgui
 pip install gdbgui --upgrade
gdbgui -r


为了gdb-dashboard 只有7.7以上支持 默认centos7不行
安装gdb-8.0
dashboard -layout





######################
#################################
★★项目.gdbinit
http://blog.csdn.net/hejinjing_tom_com/article/details/42490771
gdb -iex "set auto-load safe-path /"
或者
项目的gdbinit文件
vim ~/.gdbinit
set auto-load safe-path /
set history save on


每个目录内的.gdbinit就起作用了
查验:
info auto-load

readelf -S /usr/local/nginx/sbin/nginx

前面的几个是全局符号, 其中重要的有一个源代码绝对根路径
readelf  -p .debug_str /usr/local/nginx/sbin/nginx |grep opt

##########################
l
查看当前代码路径
info source
查看全部
info sources

list 是显示源码
(gdb) list              # 查看代码执行位置的10行
(gdb) list              # 再显示10行
(gdb) list -            # 查看上一个list命令之前的10行
(gdb) list 3,19         # 查看3-19行
(gdb) list main         # 查看main函数开始的10代码
(gdb) list hello.c:23   # 查看hello.c文件第23行后的10行
(gdb) list hello.c:main # 查看hello.c文件中函数main开始的10行
(gdb) list *0x1000000   # 查看地址为 0x1000000 的10行代码,


查找
search ngx_stri
reverse-search ngx_stri


set history save on
set history filename <fname>
By default the history file (.gdb_history) is saved in the current


run之后
record
可以回退
reverse-next 
reverse-有很多
record stop

设置变量
set var a=6

删除断点
info b
delete b





  • 大小: 135.9 KB
分享到:
评论

相关推荐

    深入理解Nginx模块开发与架构解析-带书签超清扫描版

    深入理解Nginx模块开发与架构解析-带书签超清扫描版 这个是带书签的扫描版。

    nginx-http-flv-module(nginx1.19.3&amp;http-flv-module1.2.7&amp;windows)

    1、nginx-http-flv-module(windows可执行程序,含http-flv-module:1.2.7,nginx 1.19.3) 2、不要放置于中文路径下,否则无法启动 3、说明文档,请下载查看。

    深入理解Nginx 模块开发与架构解析-完美排版

    4. 模块开发基础:介绍如何编写C语言的Nginx模块,包括模块结构、API使用和编译构建。 5. 高级模块开发:讨论更复杂的模块开发技巧,如多线程、内存管理、模块间通信等。 6. 负载均衡和缓存策略:讲解Nginx如何实现...

    win环境使用nginx的nginx-http-flv-module.zip

    在windows 7 64位 环境下使用nginx的nginx-http-flv-module搭建flv视频流播放所有的安装包,参考:https://blog.csdn.net/qq_33071429/article/details/102628008

    Nginx模块源码 nginx-notice-2

    **Nginx模块源码分析:nginx-notice-2** Nginx是一个高性能的Web服务器和反向代理服务器,以其轻量级、高并发、低内存占用等特性在IT行业中广泛应用。开发者通常会通过编写自定义模块来扩展Nginx的功能,以满足特定...

    添加nginx-http-flv-module模块并重新编译后的nginx(windows版)

    本资源提供的是一款针对Windows平台的Nginx,其中已经集成了`nginx-http-flv-module`模块,这个模块主要用于支持HTTP实时流(HTTP Live Streaming, HLS)和Flash视频流(Flash Video, FLV)。现在我们将深入探讨这一...

    nginx带nginx-http-flv模块windows编译版rtmp

    Nginx-RTMP是Nginx的一个扩展模块,由Adobe Systems开发,用于支持Real-Time Messaging Protocol (RTMP)。RTMP是一种协议,常用于在线流媒体传输,如视频直播服务。Nginx-RTMP模块允许Nginx接收来自Flash Player或...

    集成了nginx-http-flv-module 1.2.9模块的64位nginx-1.21.4程序

    `nginx-http-flv-module`是Nginx的一个第三方模块,由张洪君开发,用于处理FLV格式的流媒体数据。通过这个模块,Nginx可以支持RTMP协议,实现实时流媒体的推拉流,为Flash Player和其他支持RTMP的客户端提供服务。...

    nginx-http-flv-module(windows & nginx1.19.3 & http-flv-module1.2.7).zip

    1、最新版 nginx-http-flv-module(windows可执行程序,含nginx 1.19.3,http-flv-module:1.2.7) 2、内含说明文档,请下载查看。 3、请勿放置于中文路径下,否则无法启动

    (修复bug模块)nginx-http-flv-module-master 支持flv模块直播

    【标题】:“(修复bug模块)nginx-http-flv-module-master 支持flv模块直播” 指的是一个专门针对Nginx服务器的扩展模块,该模块允许Nginx支持流媒体服务,特别是针对FLV(Flash Video)格式的实时流媒体。...

    nginx + nginx-http-flv-module-1.2.9

    nginx-http-flv-module 是由 nginx 开发社区创建的一个第三方模块,用于在 Nginx 上实现 HTTP 直播(HTTP Live Streaming,HLS)和FLV格式的视频流。FLV(Flash Video)是 Adobe Flash 平台广泛使用的视频格式,...

    nginx-sticky-module-1.25.zip

    nginx sticky是nginx的module,可以实现基于cookie的负载均衡。 下载后,在编译安装nginx时,用--add-module... ./configure --prefix=/usr/local/nginx-1.6.0 --add-module=../nginx-sticky-module-1.25 --without-...

    nginx-rtmp模块源码包nginx-rtmp-module-master

    **Nginx-RTMP 模块详解** Nginx-RTMP 模块是 Nginx 的一个扩展,用于处理 Real-Time Messaging Protocol (RTMP) 流,它允许 Nginx 作为 RTMP 服务器运行,支持直播和点播服务。这个源码包 "nginx-rtmp-module-...

    nginx-http-flv-module(linux & nginx1.19.3 & http-flv-module1.2.7).zip.zip

    1、最新版 nginx-http-flv-module(linux可执行程序,含nginx 1.19.3,http-flv-module:1.2.7) 2、内含说明文档,请下载查看。 3、请勿放置于中文路径下,否则无法启动 4、sbin/nginx -c conf/nginx.conf

    windows平台nginx编译nginx-http-flv-module

    在给定的压缩包文件中,"使用必看.txt"可能包含了编译和使用过程中的注意事项,而"nginx-rtmp.zip"可能是包含了RTMP模块的源代码,这在搭建流媒体服务器时也会用到,因为HTTP FLV Module通常与RTMP模块结合使用,为...

    nginx-1.19.3_nginx-http-flv-module.rar

    压缩包子文件的文件名"nginx-1.19.3_Compiled"表示包含了编译好的Nginx服务器,这通常包括配置文件、二进制可执行文件和其他必要的库文件。用户解压后,可以在自己的服务器上直接部署这个版本的Nginx,无需经历复杂...

    nginx-goodies-nginx-sticky-module-ng-08a395c66e42.zip

    Sticky是nginx的一个模块,它是基于cookie的一种nginx的负载均衡解决方案,通过分发和识别cookie,来使同一个客户端的请求落在同一台服务器上,默认标识名为route (a)客户端首次发起访问请求,nginx接收后,发现...

    rh-nginx110-nginx-mod-http-image-filter-1.10.2-2.el7.x86_64.rpm

    官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装

    nginx-upstream-jvm-route-1.15

    【标题】"nginx-upstream-jvm-route-1.15" 涉及的核心知识点是Nginx的upstream模块与JVM路由的整合,特别针对Nginx 1.15版本。这个项目旨在解决在配置Nginx时遇到的特定错误提示“nginx: [emerg] invalid parameter ...

Global site tag (gtag.js) - Google Analytics