gdb调试代码栈

 https://www.cnblogs.com/zhurizhe/p/3412369.html

 gdb -p 20480 --batch -ex 'set pagination off' -ex 'thread apply all bt’

#include <fstream>
bool isFileExists_ifstream(const char * name) {
    std::ifstream f(name);
    return f.good();
}

void hello3()
{
    if (isFileExists_ifstream("/tmp/1.txt"))
    {
        printf("File is existed
");
        sleep(1000);
    }
    else
    {
        printf("hello
");
    }
}
原文地址:https://www.cnblogs.com/renhl/p/15302786.html