Hi Everyone,
I am writing a program that runs some unit tests on code that that been written by my colleagues. I am using the Google C++ testing framework. I run a function that spawns 3 threads, and then runs for 30 seconds. After it runs, the program exits with status 0. This is not the expected behavior, obviously. I know it doesn't make it any farther, because I put a cout statement in the next immediate line.
My question is, what is the best way to go about debugging this with gdb? It is difficult because the program doesn't segfault or anything like that, it just exits. Is there a way to hook an exit call, and then get a long backtrace?
Thank you for your help.
Edit:
cSystemCfg* pSystemCfg = new cSystemCfg();
std::cout << "Before runThing" << std::endl;
pSomething->runThing(&acq, pHwIf, pSystemCfg, pIf);
//Exits here, never gets to the next line
std::cout << "After runThing" << std::endl;