25 #error *****Isis.h MUST be included before any other files!***** 32 #include <QCoreApplication> 38 #define APPLICATION IsisMain 88 std::map<QString, void *> empty;
109 int main(
int argc,
char *argv[]) {
113 if (getenv(
"ISISROOT") == NULL || QString(getenv(
"ISISROOT")) ==
"") {
114 std::cerr <<
"Please set ISISROOT before running any Isis applications" << std::endl;
121 signal(SIGABRT,
Abort);
135 delete QCoreApplication::instance();
142 MyMutex *mutex =
new MyMutex();
143 std::fstream *alloc_output =
new std::fstream(
"/dev/null");
144 Debug(make_all_allocations_invisible_except(NULL));
145 ForAllDebugChannels(
if(debugChannel.is_on()) debugChannel.off());
146 Debug(dc::malloc.on());
147 Debug(libcw_do.on());
148 Debug(libcw_do.set_ostream(alloc_output));
149 Debug(libcw_do.set_ostream(alloc_output, mutex));
158 alloc_filter_ct alloc_filter;
159 std::vector<std::string> objmasks;
160 objmasks.push_back(
"libc.so*");
161 objmasks.push_back(
"libstdc++*");
162 std::vector<std::string> srcmasks;
163 srcmasks.push_back(
"*new_allocator.h*");
164 srcmasks.push_back(
"*set_ostream.inl*");
165 alloc_filter.hide_objectfiles_matching(objmasks);
166 alloc_filter.hide_sourcefiles_matching(srcmasks);
167 alloc_filter.hide_unknown_locations();
168 delete libcw_do.get_ostream();
169 libcw_do.set_ostream(&std::cout);
170 list_allocations_on(libcw_do, alloc_filter);
179 std::vector<std::string> currentStack;
182 std::cerr <<
"Segmentation Fault" << std::endl;
183 for(
unsigned int i = 1; i < currentStack.size(); i++) {
184 std::cerr << currentStack[i] << std::endl;
191 std::vector<std::string> currentStack;
194 std::cerr <<
"Abort" << std::endl;
195 for(
unsigned int i = 1; i < currentStack.size(); i++) {
196 std::cerr << currentStack[i] << std::endl;
Definition: Application.h:117
#define APPLICATION
Definition: Isis.h:38
void stopMonitoringMemory()
static void GetStackTrace(const void *)
Definition: IsisDebug.h:115
std::map< QString, void * > GuiHelpers()
Base include file for all Isis applications.
Definition: Isis.h:87
int main(int argc, char *argv[])
The programmer supplied main function.
Definition: Isis.h:109
void SegmentationFault(int)
static bool p_applicationForceGuiApp
Definition: Application.h:133
void startMonitoringMemory()
int Run(void(*funct)())
Runs the program defined in the function funct.
Definition: Application.cpp:193
void RegisterGuiHelpers(std::map< QString, void *> helpers)
Definition: Application.h:138
void InterruptSignal(int)