4.1讲义
4.1.1gdb调试
gdb 调试可执行文件
要使用gdb,gcc必须加-g参数
l N //list 10 lines around the line N
l N,M //list the lines from N to M
b break //set breakpoint
b N if key==value //stop the line N when key=value
info break //list the breakpoints
del N //delete the breakpoint N
clear N //delete the breakpoint setted in the line N
r /start program
next ,n //execute next line,after starting
print 变量 //
where
continue //jump next breakpoint
until N
b N if i=M
step //jump into
watch i //****after runing
4.1.2网络服务
4.1.2.1基本操作
网络服务的开启部分,一般都是三步:
第一步:修改相应的网络配置服务
第二步:开启setsebool参数
第三步:重启服务
一般的网络服务开启大都如此,但是网络比较复杂,可变因素很多,
包括防火墙,或者特定服务特定系统等原因,每个的设置部分又有所
不同。
4.1.2.2NFS的配置(仅限于fedora8)
/etc/exports 加入/path/directory *(rw,sync,no_root_squash)
service nfs
mount -t hostname(ip):/path/directory /local/path/directory
4.1.2.3telnet的配置
/etc/xinetd.d/telnet disable=no
lokkit关闭防火墙,或者service iptables stop
setsebool telnetd_disable_trans=1
service xinetd restart
可使用secureCRT工具:建设不用root登录
4.1.2.4tftp的配置
/etc/xinetd.d/tftp disable=no
setsebool tftpd_disable_trans=1
service xinetd restart
只可从/tftproot下访问
4.2.1 问题
4.2.1.1gdb的display命令如何使用
([color=red]执行过程中display expression总显示expression的值[/color])
display expression