栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > C/C++/C#

gdb调试

C/C++/C# 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

gdb调试

官网:https://www.gnu.org/software/gdb/ Debugging with GDB:https://sourceware.org/gdb/current/onlinedocs/gdb/
简介

GDB, the GNU Project debugger, allows you to see what is going on `inside’ another program while it executes – or what another program was doing at the moment it crashed.

GDB的功能:

Start your program, specifying anything that might affect its behavior.
Make your program stop on specified conditions.
Examine what has happened, when your program has stopped.
Change things in your program, so you can experiment with correcting the effects of one bug and go on to learn about another.

启动gdb

启动gdb之前,需要编译出debug版本的程序,编译时加-g选项

$ gcc -g main.c

启动方法:

调试直接启动程序
调试一个正在运行的程序,attach
调试core文件

调试直接启动程序:

语法: gdb

$ gdb a.out

调试一个正在运行的程序,attach:

语法: gdb

$ gdb a.out 11127

<
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/512146.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号