GDB在Linux中一个核心转储文件 [英] GDB With a coredump file in linux

查看:132
本文介绍了GDB在Linux中一个核心转储文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在linux核心转储文件以

I just got a core-dump file in linux with

ulimit -c unlimited

我怎么可以将GDB与它

how can I attach gdb with it

我需要给命令行参数吧。

I need to give command line arguments with it.

样executation:

sample executation:

./my_prog arg

帮我进入GDB

Help me to get into gdb

干杯!!

推荐答案

如果您的核心文件是核心只需运行

If your core file is core just run

gdb ./my_prog core

做的核心部分事后分析

如果你想使用 GDB 没有自己的核心,考虑

If you want to use gdb without your core, consider

gdb --args ./my_prog arg

否则只运行 GDB ./my_prog 然后发出设置ARGS 命令 GDB

如果你的进程仍然为PID 1234上运行,可以用 GDB ./my_prog 1234 附加GDB到正在运行的进程。

If your process is still running as pid 1234, you could with gdb ./my_prog 1234 attach the gdb to the running process.

您真的应该阅读 gdb的文档

You really should read the gdb documentation.

这篇关于GDB在Linux中一个核心转储文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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