1. gdb 调试利器 — Linux Tools Quick Tutorial
1. strip命令删除执行文件的debug信息
[root@localhost testclient]# strip hello_server
##使用 strip 命令之前
-rwxr-xr-x. 1 root root 12416 Sep 8 09:45 hello_server
##使用 strip 命令之后
-rwxr-xr-x. 1 root root 6312 Sep 8 09:55 hello_server
2. ulimit命令详解
3. gdb常用命令一览表
命令名称 | 命令缩写 | 命令说明 |
---|---|---|
run | r | 运行一个程序 |
continue | c | 让暂停的程序继续运行 |
next | n | 运行到下一行 |
step | s | 如果有调用函数,进入调用的函数内部,相当于 step into |
until | u | 运行到指定行停下来 |
finish | fi | 结束当前调用函数,到上一层函数调用处 |
return | return | 结束当前调用函数并返回指定值,到上一层函数调用处 |
jump | j | 将当前程序执行流跳转到指定行或地址 |
p | 打印变量或寄存器值 | |
backtrace | bt | 查看当前线程的调用堆栈 |
frame | f | 切换到当前调用线程的指定堆栈,具体堆栈通过堆栈序号指定 |
thread | thread | 切换到指定线程 |
break | b | 添加断点 |
tbreak | tb | 添加临时断点 |
delete | del | 删除断点 |
enable | enable | 启用某个断点 |
disable | disable | 禁用某个断点 |
watch | watch | 监视某一个变量或内存地址的值是否发生变化 |
list | l | 显示源码 |
info | info | 查看断点 / 线程等信息 |
ptype | ptype | 查看变量类型 |
disassemble | dis | 查看汇编代码 |
set args | 设置程序启动命令行参数 | |
show args | 查看设置的命令行参数 |
5. dos2unix命令
6. find命令
7. 比较文件的md5值
Liunx: md5sum
Windows: CertUtil -hashfile <path to file> MD5
Depending on the size of the file it may take a few seconds to run the calculation but if successful the MD5 hash will be displayed.
It is also possible to generate checksums for other hash algorithms by replacing the MD5 parameter used above with any of the following(note
that if you don't specify a value then SHA1 is used by default):
*MD2 *MD4 *MD5 *SHA1 *SHA256 *SHA384 *SHA512
So, if all you need is to determine the checksum of a downloaded file then there really isn't any reason to install yet another utility to do so.
8.开启core,debug信息