我想运行gdb来debugging我的Ubuntu 9.10的Apache2安装,并有几个问题:
Ubuntu为Apache2安装的软件包似乎不包含debugging符号; 有没有我应该用于开发/debugging的包的不同版本?
当我尝试运行gdb时,我得到一个错误,看起来是由一些缺less的环境variables造成的。 有没有其他的select,我应该通过“运行”来得到这个工作?
以下是debugging器会话的输出:
root@aj-ubuntu:/usr/sbin# gdb apache2 GNU gdb (GDB) 7.0-ubuntu Copyright (C) 2009 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". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from /usr/sbin/apache2...(no debugging symbols found)...done. (gdb) run -X Starting program: /usr/sbin/apache2 -X [Thread debugging using libthread_db enabled] apache2: bad user name ${APACHE_RUN_USER} Program exited with code 01. (gdb)
在此先感谢,-aj
对于第一个Ubuntu运行一个符号服务器: https : //lists.ubuntu.com/archives/ubuntu-devel-announce/2006-September/000195.html
对于看起来像apacheconfiguration问题的第二个问题,apache在初始化脚本启动时是否运行正常?
您需要直接调用二进制文件之前设置环境variables。 如果你想在基于Debian的发行版中使用sudo,你可以使用:
source /etc/apache2/envvars sudo -E gdb /usr/sbin/apache2
在bash中运行命令source /etc/apache2/envvars为我加载了必要的variables。
apache2.conf中有一些使用环境variables的设置。 在apache2启动之前使用“./etc/apache2/envvars”