免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2719 | 回复: 3
打印 上一主题 下一主题

gdb 调式 apache ,单步执行,程序执行顺序不定,怎么回事? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-04-24 19:27 |只看该作者 |倒序浏览
我用gdb调试 一个apache demo模块的时候,不知怎么会是,出现下面这种情况,感觉就像多线程一样。
  1. [root@localhost modules]# gdb httpd
  2. GNU gdb (GDB) Fedora (7.3.50.20110722-13.fc16)
  3. Copyright (C) 2011 Free Software Foundation, Inc.
  4. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  5. This is free software: you are free to change and redistribute it.
  6. There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
  7. and "show warranty" for details.
  8. This GDB was configured as "i686-redhat-linux-gnu".
  9. For bug reporting instructions, please see:
  10. <http://www.gnu.org/software/gdb/bugs/>...
  11. Reading symbols from /usr/sbin/httpd...Reading symbols from /usr/lib/debug/usr/sbin/httpd.debug...done.
  12. done.
  13. (gdb) b read_post_data
  14. Function "read_post_data" not defined.
  15. Make breakpoint pending on future shared library load? (y or [n]) y

  16. Breakpoint 1 (read_post_data) pending.
  17. (gdb) run -X -f /etc/httpd/conf/httpd.conf
  18. Starting program: /usr/sbin/httpd -X -f /etc/httpd/conf/httpd.conf
  19. [Thread debugging using libthread_db enabled]
  20. Using host libthread_db library "/lib/libthread_db.so.1".
  21. httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName
  22. warning: Temporarily disabling breakpoints for unloaded shared library "/etc/httpd/modules/mod_pronunciation_score.so"

  23. Breakpoint 1, read_post_data (req=0x801a71d0, post=0xbfffee68, post_size=0xbfffee6c)
  24.     at mod_pronunciation_score.c:17
  25. 17         static int read_post_data(request_rec *req, char **post, size_t *post_size){
  26. Missing separate debuginfos, use: debuginfo-install cyrus-sasl-lib-2.1.23-27.fc16.i686 nspr-4.9-2.fc16.i686 nss-3.13.4-2.fc16.i686 nss-util-3.13.4-2.fc16.i686
  27. (gdb) n
  28. 18            char buffer[DFT_BUF_SIZE] = {0};
  29. (gdb) n
  30. 17         static int read_post_data(request_rec *req, char **post, size_t *post_size){
  31. (gdb) n
  32. 18            char buffer[DFT_BUF_SIZE] = {0};
  33. (gdb) n
  34. 17         static int read_post_data(request_rec *req, char **post, size_t *post_size){
  35. (gdb) n
  36. 18            char buffer[DFT_BUF_SIZE] = {0};
  37. (gdb) n
  38. 17         static int read_post_data(request_rec *req, char **post, size_t *post_size){
  39. (gdb) n
  40. 23            if(ap_setup_client_block(req, REQUEST_CHUNKED_DECHUNK) != OK){
  41. (gdb) n
  42. 17         static int read_post_data(request_rec *req, char **post, size_t *post_size){
  43. (gdb) n
  44. 21            bytes = count = offset = 0;
  45. (gdb)
复制代码

论坛徽章:
0
2 [报告]
发表于 2012-04-25 13:46 |只看该作者
去掉优化选项

论坛徽章:
0
3 [报告]
发表于 2012-04-25 14:32 |只看该作者
回复 2# GFree_Wind

去掉优化选项?gcc的优化选项么?我直接 yum 安装的 httpd 和 httpd-devel。


   

论坛徽章:
0
4 [报告]
发表于 2012-04-25 14:56 |只看该作者
回复 2# GFree_Wind

多谢,我应该是 在 编译模块的时候去掉编译选项, apxs -c -Wc,-O0 xxx.c 这样就OK了。


   
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP