随笔分类 -  调试

摘要:改配置, 设为只有一个work线程.1. 查看所有线程的bt状态(每个线程运行到何处了)thread apply all bt2. 根据1中的信息, 找到work线程, attach上去thread 3. 设置断点b 4. 运行到断点c然后是客户端发送请求5. 下一步n 阅读全文
posted @ 2015-04-27 21:29 helloweworld 阅读(294) 评论(0) 推荐(0) 编辑
摘要:方法1:gdb --args ./main -i main.conf方法2:(1) gdb ./main(2) r -i main.conf方法3:(1) gdb ./main(2) set args -i main.conf 阅读全文
posted @ 2015-03-27 21:43 helloweworld 阅读(2539) 评论(0) 推荐(0) 编辑
摘要:指定源文件的路径:directory/dirdir:清除所有的自定义的源文件搜索路径信息。dir:加一个源文件路径到当前路径的前面。指定多个路径,可以使用”:”showdir:显示定义了的源文件搜索路径。(gdb)dir/opt:/usr/include/Sourcedirectoriessearc... 阅读全文
posted @ 2015-01-05 10:42 helloweworld 阅读(9465) 评论(0) 推荐(1) 编辑
摘要:如果enter不终止输入, 试试按ctrl+j 阅读全文
posted @ 2014-12-13 22:32 helloweworld 阅读(1140) 评论(0) 推荐(0) 编辑
摘要:利用valgrind调试内存问题,不需要重新编译源程序,它的输入就是二进制的可执行程序。调用Valgrind的通用格式是:valgrind [valgrind-options] your-prog [your-prog-options]Valgrind 的参数分为两类,一类是 core 的参数,它对... 阅读全文
posted @ 2014-10-31 12:38 helloweworld 阅读(227) 评论(0) 推荐(0) 编辑
摘要:sudo apt-get gdb-server,client调试时可能会出现"--warning: Could not load vsyscall page because no executable was specified"按下面步骤操作:I just encountered this pro... 阅读全文
posted @ 2014-10-27 19:13 helloweworld 阅读(1359) 评论(0) 推荐(0) 编辑
摘要:break file.c:100 thread all 在file.c文件第100行处为所有经过这里的线程设置断点。set scheduler-locking off|on|step,这个是问得最多的。在使用step或者continue命令调试当前被调试线程的时候,其他线程也是同时执行的,怎么只让被... 阅读全文
posted @ 2014-10-25 20:20 helloweworld 阅读(627) 评论(0) 推荐(0) 编辑
摘要:4 using namespace std; 5 static int a = 1; 6 7 void *thread0(void*) 8 { 9 while (1)10 {11 a++;12 }13 return (void*)0;14 }1... 阅读全文
posted @ 2014-10-25 20:00 helloweworld 阅读(321) 评论(0) 推荐(0) 编辑
摘要:void fun(){ int b = 0; b++;}int main(int argc, char** argv){ while (1) { int a = 0; a++; fun(); }}main.cpp1. 运行上面程... 阅读全文
posted @ 2014-10-25 19:42 helloweworld 阅读(506) 评论(0) 推荐(0) 编辑
摘要:先上总结:test为可执行文件. 12为断点行号. 第2步是显示intel汇编格式, 第3步是源码和汇编分屏显示1. #gdbtui test2. (gdb)set disassembly-flavor intel3. (gdb)layout split4. (gdb)b 125. (gdb)r6.... 阅读全文
posted @ 2014-10-22 13:10 helloweworld 阅读(651) 评论(0) 推荐(0) 编辑
摘要:一. 何时产生core.当程序接收到以下UNIX信号会产生core文件:名字说明ANSI C POSIX.1SVR4 4.3+BSD缺省动作SIGABRT异常终止(abort) . . . .终止w/coreSIGBUS硬件故障 . . .终止w/coreSIGEMT硬件故障 . .终止w/core... 阅读全文
posted @ 2014-09-11 19:13 helloweworld 阅读(225) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示