上一页 1 2 3 4 5 6 7 8 ··· 48 下一页
摘要: print '0123'.ljust(20, '-')print '01234'.ljust(20, '-')print '012356'.ljust(20, '-')print '0123567'.ljust(20, '-') 阅读全文
posted @ 2014-11-14 20:50 helloweworld 阅读(314) 评论(0) 推荐(0) 编辑
摘要: strVal = "%.2f" % valfloatVal = round(val, 2)但是如果val为1.0, 则结果仍为1.0, 不是1.00 阅读全文
posted @ 2014-11-14 20:20 helloweworld 阅读(479) 评论(0) 推荐(0) 编辑
摘要: 利用valgrind调试内存问题,不需要重新编译源程序,它的输入就是二进制的可执行程序。调用Valgrind的通用格式是:valgrind [valgrind-options] your-prog [your-prog-options]Valgrind 的参数分为两类,一类是 core 的参数,它对... 阅读全文
posted @ 2014-10-31 12:38 helloweworld 阅读(224) 评论(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 阅读(1311) 评论(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 阅读(622) 评论(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 阅读(320) 评论(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 阅读(500) 评论(0) 推荐(0) 编辑
摘要: date -d "1970-01-01 UTC `echo "$(date +%s)-$(cat /proc/uptime|cut -f 1 -d' ')+12288812.926194"|bc ` seconds"用dmesg显示的时间替换红色字 阅读全文
posted @ 2014-10-25 18:32 helloweworld 阅读(820) 评论(0) 推荐(0) 编辑
摘要: class Base{public: Base() { cout << "cons" << endl; } ~Base() { cout << "de" << endl; } static Base* Default() {... 阅读全文
posted @ 2014-10-24 22:55 helloweworld 阅读(479) 评论(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 阅读(634) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 48 下一页