支持内存错误检测的改进gdb调试器的设计与实现
[Abstract]:C language has been widely used in the development of various system software and application software. Its memory management mechanism and pointer operation mechanism greatly improve its expression ability and flexibility, but also lead to a large number of memory errors. These errors are difficult to reproduce and difficult to find to induce errors, so memory errors are often difficult to detect. Current memory error detection methods can be divided into two categories according to whether or not to execute programs: dynamic method and static method. The static method does not need to execute the program, so it has no execution overhead and high detection efficiency. However, because of the uncertainty and unpredictability in the process of running the program, the static method can not accurately grasp the actual running state of the memory. It usually has high false alarm rate and false alarm rate. The dynamic method gathers information during program execution and thus locates where a memory error occurred in the program. But the method of collecting information by dynamic method is to modify the source code of the program by inserting piles, which may destroy the structure of the program and affect the function of the program. In addition, some of the existing tools for static array cross-border access detection is not ideal. In view of the above problems, this paper proposes a solution to implement memory error detection in gdb debugger by improving the gdb debugger. The improved gdb debugger can detect memory access error and memory leak error without modifying any source code, and get rid of the false positive problem caused by static method. The design idea of the improved gdb debugger is: 1) in the process of debugging the program, according to the different memory distribution of the program, Different methods are used to capture the memory allocation information in the program. 2) based on this information, the memory debug symbol table for memory cross access detection and the memory leak chain table 3 for memory leak detection are established) based on the watchpoint principle of the gdb debugger. The memory debug symbol table is used to monitor the memory allocation block in the program, to detect the memory access error, and to analyze the memory leak list before the end of the program. By further combining with the gdb debugger, the program can locate the location where the memory error occurred in the program.
【学位授予单位】:南京大学
【学位级别】:硕士
【学位授予年份】:2012
【分类号】:TP311.11;TP333.1
【参考文献】
相关期刊论文 前4条
1 李吉;王雷;;C程序缓冲区溢出漏洞精确检测方法[J];北京航空航天大学学报;2008年03期
2 周晓宇,黄文伟,史亮,徐宝文;基于源代码插桩的C程序内存使用错误动态检测[J];舰船电子工程;2004年06期
3 李倩;潘敏学;李宣东;;内存泄漏检测工具与评估方法[J];计算机科学与探索;2010年01期
4 甘红星;金大海;宫云战;;基于源代码的内存泄漏静态分析方法[J];内蒙古大学学报(自然科学版);2011年05期
相关博士学位论文 前1条
1 马晓东;C程序内存错误静态分析技术研究[D];国防科学技术大学;2009年
相关硕士学位论文 前10条
1 陆晗;基于GNU的JTAG调试器的集成与设计[D];浙江大学;2005年
2 楼永红;面向嵌入式实时应用的内存管理技术研究[D];浙江大学;2006年
3 龚伟;基于gdb的嵌入式系统调试器的设计与实现[D];电子科技大学;2006年
4 栾绍楠;C/C++程序中指针有效性的静态检测[D];西安电子科技大学;2006年
5 王文俊;C/C++程序缓冲区越界静态检测研究[D];西安电子科技大学;2006年
6 罗琰;基于内核模式下进程快照的可回溯调试研究及初步实现[D];浙江大学;2008年
7 王皓;一种内存泄漏检测技术的研究和实现[D];北京交通大学;2008年
8 张超;COM组件栈缓冲区溢出漏洞检测技术研究[D];华中科技大学;2008年
9 柯平;内存泄漏静态检测模型的设计与实现[D];北京邮电大学;2009年
10 杨木叶;嵌入式交叉调试工具实现技术研究[D];华中科技大学;2009年
,本文编号:2212776
本文链接:https://www.wllwen.com/kejilunwen/jisuanjikexuelunwen/2212776.html