Mac上的核心转储写在哪里? [英] Where are core dumps written on Mac?

查看:151
本文介绍了Mac上的核心转储写在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Mac OS X上,如果我将SIGQUIT发送到C程序,它将终止,但是没有核心转储文件.

On Mac OS X, if I send SIGQUIT to my C program, it terminates, but there is no core dump file.

您是否必须在Mac OS X上手动启用核心转储(如何?),或者将其写入到其他地方而不是工作目录中?

Do you have to manually enable core dumps on Mac OS X (how?), or are they written to somewhere else instead of the working directory?

推荐答案

似乎默认情况下它们被抑制.正在运行

It seems they are suppressed by default. Running

$ ulimit -c unlimited

将为当前终端启用核心转储,它将作为core.PID放置在/cores中.当您打开一个新会话时,它将再次设置为默认值.

Will enable core dumps for the current terminal, and it will be placed in /cores as core.PID. When you open a new session, it will be set to the default value again.

这篇关于Mac上的核心转储写在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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