linux学习 问题 列表

来源:互联网 发布:excel多表数据合计 编辑:程序博客网 时间:2024/05/16 07:33

一、/etc/vim/vimrc文件末尾添加如下代码,
set nu      "显示行号
set autoindent    "自动缩进
set cindent    "c自动缩进

二、gdb调试工具使用
将调试信息编译进去
gcc -g -Wall test.c -o test
g++ -g -Wall test.cxx -o test

gdb test
l      //显示十行源程序
回车    //重复执行以上代码
b 11    //在第十一行处设置断点
b func   //在func函数入口处设置断点
r       //带调试运行程序
n    //执行下一行代码
p a     //打印变量a的值
quit   //退出

三、注意
pthread 库不是 Linux 系统默认的库,连接时需要使用静态库 libpthread.a,所以在使用pthread_create()创建线程,以及调用 pthread_atfork()函数建立fork处理程序时,需要链接该库。
问题解决:
在编译中要加 -lpthread参数
 gcc thread.c -o thread -lpthread
 thread.c为你些的源文件,不要忘了加上头文件#includ

四、phpeclipse配置
alt+/   自动提示


五、vim配置自动提示
ctrl+p    自动提示

php 自动提示:
下载php.vim

建文件php_funcList.txt
将php所有函数装入此内

安装好gvim

配置vimrc文件
实现php文件代码提示功能
 au FileType php call AddPhpFuncList()
 function AddPhpFuncList()
 set dictionary-=/usr/share/vim/dict/php_function_list.txt dictionary+=/usr/s    hare/vim/dict/php_function_list.txt
 set complete-=k complete+=k
 let php_folding=1
 set foldmethod=syntax
 endfunction

六、linux数据包分析工具tcpdump
tcpdump: no suitable device found
需用sudo执行
tcpdump -A -s0 host www........

七、ctags使用etags
etags -R
etags -a
代码提示功能
原创粉丝点击