問題:
I would like to force a core dump at a specific location in my C++ application.我想在我的 C++ 應用程序中的特定位置強制進行核心轉儲。
I know I can do it by doing something like:我知道我可以通過執行以下操作來做到這一點:
int * crash = NULL;
*crash = 1;
But I would like to know if there is a cleaner way?但我想知道是否有更清潔的方法?
I am using Linux by the way.順便說一下,我正在使用 Linux。