GDB - 如何找出程序退出的位置 [英] GDB - how to find out from where program exited

查看:18
本文介绍了GDB - 如何找出程序退出的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

While debugging a program in GDB, I get an unexpected "program exited normally". So I'm wondering if is there a way to find out from where (which line) the program exited.

Program is multi-threaded, if that matters.

解决方案

Usually with the command below when the application has finished executing:

(gdb) thread apply all bt

Of course, if you want to know the exact line you must compile your application with debugging symbols, i.e. -g

这篇关于GDB - 如何找出程序退出的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆