mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-14 13:57:13 +02:00
debug
This commit is contained in:
@ -13,6 +13,7 @@
|
|||||||
#include "singlePhotonDetector.h"
|
#include "singlePhotonDetector.h"
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
#include <csignal>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -88,6 +89,13 @@ int adjustThreads(int requestedThreads, int nSC) {
|
|||||||
return adjustedThreads;
|
return adjustedThreads;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Signal handler for segmentation faults
|
||||||
|
void signal_handler(int signum) {
|
||||||
|
std::cerr << "Caught signal " << signum << ": Segmentation fault (core dump)" << std::endl;
|
||||||
|
// Handle the error (e.g., clean up, abort, etc.)
|
||||||
|
exit(signum); // Exit program with the signal code
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
|
|
||||||
@ -103,6 +111,9 @@ int main(int argc, char *argv[]) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set up the signal handler for segmentation faults
|
||||||
|
signal(SIGSEGV, signal_handler);
|
||||||
|
|
||||||
int const fifosize = 100; //1000;
|
int const fifosize = 100; //1000;
|
||||||
int const nthreads = 10;
|
int const nthreads = 10;
|
||||||
int const csize = 3; // 3
|
int const csize = 3; // 3
|
||||||
|
Reference in New Issue
Block a user