博客
分类
标签
归档
随笔
日报
博客
分类
标签
归档
随笔
日报
内存泄漏检测工具valgrind
原理和简介Valgrind follows each allocation in your program and tracks it to see if it is returned properly, continue to be referenced or is lost in space, which is a ‘memory leak’. And as any leak, give...
2022-10-19
debug
tool
linux
tool
linux
debug
Read More
linux函数运行时间监控 oprofile 用opref替代opcontrol
oprofile的Q&A:https://oprofile.sourceforge.io/faq/ 先operfSYNOPSIS operf [ options ] [ --system-wide | --pid <pid> | [ command [ args ] ] ] One (and only one) of either command , --pid ...
2022-10-14
debug
tool
linux
tool
linux
debug
Read More
linux监控函数调用时间 gprof gcov
https://blog.csdn.net/yuyin86/article/details/6671472 gprof[每个函数的调用时间] 仅单线程、用户态gprof的基本用法:1. 使用 -pg 选项编译和链接你的应用程序 ,在gcc编译程序的时候,加上-pg选项,如果是大项目,就在makefile里面修改编译选项,-pg放在那里都行。例如: gcc -pg -o test tes...
2022-09-30
debug
tool
linux
tool
linux
debug
Read More
linux查看cache大小
getconf显示的大小数据单位为byte所有CACHE相关的参数 getconf -a | grep CACHE cache line大小 getconf -a | grep CACHE_LINESIZE Intel的一般是64字节: LEVEL1_ICACHE_LINESIZE 64 LEVEL1_DCACHE_LINESIZE 64 ...
2022-09-30
debug
tool
linux
tool
linux
debug
Read More
vscode调试c++查看变量的二进制表示
方法一:watch窗口加expression后缀expression[,suffix]无后缀:十进值,x或,h:十六进制,o:八进制,b:二进制(低地址在右边)比如:undone.reg,b(reg是undone的private成员,也可以监控) 方法二:gdb内存查看命令xF5启动调试在断点处停住后,可以在debug console中通过-exec前缀执行gdb的命令比如内存查看指令x(g...
2022-09-27
c++
debug
debug
c++
debug
debug
Read More
gcc生成32位x86和arm汇编并运行
main.c测试内容 #include <stdio.h> int main() { printf("hello\n"); return 0; } ubuntu装环境sudo apt update sudo apt install build-essential sudo apt install gcc-multilib ...
2022-09-01
c++
debug
gcc
debug
c++
gcc
debug
debug
Read More
lsof 查看资源被进程占用情况
打开文件的进程定位到打开的进程 lsof <file> $ lsof /opt/mysql/data/5690/mysql-error.log COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME mysqld 12858 actiontech-universe 1w ...
2022-08-16
debug
tool
linux
tool
linux
debug
Read More
c++11异常处理
学习自C++11异常处理 noexcept_木的情感的博客-CSDN博客_c++11 noexcept C++03 异常处理(throw)c++11也可以用 指定异常规格(语法)C++98中,在函数声明时,我们使用throw指定一个函数可以抛出异常的类型(异常规格(exception specification))。例如: class Ex { public: double...
2022-07-16
c++
language
debug
c++
language
debug
Read More
c++底层 c++STL源码
用户内存分配和使用的规则(os知识)堆栈查看堆栈总大小每个进程允许的堆栈总大小在linux下可以用ulimit查看 stack size #查看软极限,单个进程的stack size限制 ulimit -a #或者ulimit -aS #查看硬极限,软极限的限制 ulimit -aH 堆栈地址增长方向x86机器上, 栈是向下增长的,即入栈是栈顶指针值变小 堆是向上增长的(这个其实无所谓,...
2022-07-16
c++
language_deep
debug
c++
debug
language_deep
Read More
gdb
关注报错信息(搜索报错号) -rdynamic -g 编译,直接gdb运行(-rdynamic可以方便监控可能的段错误) 报错型bug调试建议:bt,从最靠近栈顶你写的函数,l那个函数和上一层函数,看p info这个函数的参数对不对(如果不好p info又没有写打印代码的话,先改源码在这个函数里面刚入口的地方加打印,然后r)不断向栈底看,直到参数没有问题的函数(就是它调用接下来的函数...
2022-07-10
debug
tool
linux
tool
linux
debug
Read More
Previous
2 / 3
Next
粘贴文本
全选文本
剪切文本
复制文本
站内搜索
必应搜索
新标签页打开
复制链接地址
复制图片
谷歌识图
常见问题
示例博客
加入社区
本站源码
主题源码
暗黑模式
打印页面
阅读模式