Skip to content
Snippets Groups Projects
Commit a390e15c authored by clc5q's avatar clc5q
Browse files

Add delay loop for attaching gdb.

Former-commit-id: 173108a18f542a40fa9bcff060c5d493eda93a8b
parent 1bdceb57
No related branches found
No related tags found
No related merge requests found
#include <ctime>
#include <stdlib.h>
#include <fstream>
#include <libIRDB-core.hpp>
......@@ -8,6 +10,8 @@ using namespace libIRDB;
#include "stars_irdb.hpp"
#define SMP_DEBUG_DELAY 0 // for setting an early breakpoint
void usage(char* name)
{
......@@ -22,7 +26,20 @@ int main(int argc, char **argv)
exit(1);
}
string programName(argv[0]);
// For debugging, we can add a delay loop so we have time to attach gdb to the
// running process and set a breakpoint.
#if SMP_DEBUG_DELAY
time_t start;
time_t current;
time(&start);
cerr << "delay for 15 seconds." << endl;
do {
time(&current);
} while (difftime(current, start) < 15.0);
#endif
string programName(argv[0]);
int variantID = atoi(argv[1]);
VariantID_t *pidp=NULL;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment