通过cygwin生成核心转储

generate core dump via cygwin

本文关键字:核心 转储 cygwin 通过      更新时间:2023-10-16

main.cpp

#include <stdexcept>
int main()
{
    throw std::runtime_error("AAAA");
}

我生成并运行exe文件:

g++ -g main.cpp
a.exe

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

我也关注了这个帖子,但它没有起作用。

似乎ulimit在cygwin下也不存在。


更新

ulimit -a:的输出

在CMD:中

>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的形式运行二进制文件,以获得它的显式路径。