我不擅长英语,对此我很抱歉。现在,有一个关于我何时用GDB调试samba的问题。
# gdb /usr/local/samba/sbin/smbd
GNU gdb Red Hat Linux (5.2.1-4)
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux"...
(gdb) r
Starting program: /usr/local/samba/sbin/smbd
Program exited normally.
(gdb) info program正在调试的程序没有运行。那么,我应该如何用GDB调试samba呢?
ps: Samba 3.0.5的版本,我从源代码中安装samba。
发布于 2013-08-22 03:31:55
smbd参数:
设置args -i -M单参数-i -M single强制smbd作为单个进程启动,不要将所有消息和错误打印到stdout/stderr。
现在,您可以设置断点并跟踪源代码,就像通常对任何其他程序一样。
注意:与使用gdb不同,您可能会发现使用gdb-tui (gdb文本用户界面)或使用其他调试器(如ddd )更为方便。
发布于 2016-09-01 09:25:37
您可以使用sudo ./smbd -i启动smbd,看看它有什么问题。在我的例子中: smbd试图在/usr/local/samba/etc/smb.conf中找到smb.conf,但是没有,所以退出。我将/etc/samba/smb.conf复制到disired路径,然后一切正常。
希望这能帮到你。
https://stackoverflow.com/questions/18371076
复制相似问题