c++ - 通过 cygwin 生成核心转储

标签 c++ exception cygwin coredump

主要.cpp

#include <stdexcept>

int main()
{
    throw std::runtime_error("AAAA");
}

我生成并运行 exe 文件:

g++ -g main.cpp
a.exe

我在屏幕上看不到任何输出。我看不到核心文件。

我关注了this post也没有用。

看来ulimit在cygwin下也不存在。


更新

ulimit -a 的输出:

在命令行中:

>ulimit -a
'ulimit' is not recognized as an internal or external command,
operable program or batch file.

在 bash 中:

$ ulimit -a
core file size          (blocks, -c) unlimited
data seg size           (kbytes, -d) unlimited
file size               (blocks, -f) unlimited
open files                      (-n) 256
pipe size            (512 bytes, -p) 8
stack size              (kbytes, -s) 2032
cpu time               (seconds, -t) unlimited
max user processes              (-u) 256
virtual memory          (kbytes, -v) unlimited

最佳答案

刚刚检查了一下,核心文件是我完美创建的。请提供 ulimit -a 的输出。除此之外,我不确定你有什么路径,所以,请以 ./a.exe 运行二进制文件以获得它的显式路径。

关于c++ - 通过 cygwin 生成核心转储,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34737162/

相关文章:

python - 异常处理总是很昂贵吗?

iphone - 将 helpshift 添加到应用程序导致 UIApplicationInvalidInterfaceOrientation 异常

java - 错误 java.lang.NumberFormatException : For input string: ""

c++ - 为什么不能将 const set<Derived*> 作为 const set<Base*> 传递给函数?

c++ - 复制构造函数调用 C++

c++ - 如何选择像魔杖一样的区域并使用 OpenCV 对其进行洪水填充?

c++ - Cygwin g++ 无法将 "fixed"识别为 STD 库的一部分

c++ - 使用 clCreateFromGLTexture 的 opencl/opengl 互操作无法绘制到纹理(纹理黑色)

firefox - 将脚本制作成 SSH 的最佳方法?

python - 导入错误 : Permission denied when importing psycopg2 module