Changeset 6a4859e in rtems-tools for tester/covoar/covoar.cc
- Timestamp:
- 08/26/17 08:15:56 (6 years ago)
- Branches:
- 5, master
- Children:
- 4600903
- Parents:
- 4cee5c3
- git-author:
- Cillian O'Donnell <cpodonnell8@…> (08/26/17 08:15:56)
- git-committer:
- Chris Johns <chrisj@…> (08/29/17 08:06:11)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tester/covoar/covoar.cc
r4cee5c3 r6a4859e 23 23 #include "TargetFactory.h" 24 24 #include "GcovData.h" 25 26 #include "rld-process.h" 25 27 26 28 /* … … 46 48 const char* format = NULL; 47 49 FILE* gcnosFile = NULL; 48 Gcov::GcovData* 50 Gcov::GcovData* gcovFile; 49 51 50 52 /* … … 147 149 } 148 150 151 static void 152 fatal_signal( int signum ) 153 { 154 signal( signum, SIG_DFL ); 155 156 rld::process::temporaries_clean_up(); 157 158 /* 159 * Get the same signal again, this time not handled, so its normal effect 160 * occurs. 161 */ 162 kill( getpid(), signum ); 163 } 164 165 static void 166 setup_signals( void ) 167 { 168 if ( signal( SIGINT, SIG_IGN ) != SIG_IGN ) 169 signal( SIGINT, fatal_signal ); 170 #ifdef SIGHUP 171 if ( signal( SIGHUP, SIG_IGN ) != SIG_IGN ) 172 signal( SIGHUP, fatal_signal ); 173 #endif 174 if ( signal( SIGTERM, SIG_IGN ) != SIG_IGN ) 175 signal( SIGTERM, fatal_signal ); 176 #ifdef SIGPIPE 177 if ( signal( SIGPIPE, SIG_IGN ) != SIG_IGN ) 178 signal( SIGPIPE, fatal_signal ); 179 #endif 180 #ifdef SIGCHLD 181 signal( SIGCHLD, SIG_DFL ); 182 #endif 183 } 184 149 185 int main( 150 186 int argc, … … 159 195 int opt; 160 196 const char* singleExecutable = NULL; 197 rld::process::tempfile objdumpFile( ".dmp" ); 198 rld::process::tempfile err( ".err" ); 199 bool debug = false; 200 201 setup_signals(); 161 202 162 203 CoverageConfiguration = new Configuration::FileReader(Options); … … 167 208 progname = argv[0]; 168 209 169 while ((opt = getopt(argc, argv, "C:1:L:e:c:g:E:f:s:T:O:p:v ")) != -1) {210 while ((opt = getopt(argc, argv, "C:1:L:e:c:g:E:f:s:T:O:p:v:d")) != -1) { 170 211 switch (opt) { 171 212 case 'C': CoverageConfiguration->processFile( optarg ); break; … … 182 223 case 'v': Verbose = true; break; 183 224 case 'p': projectName = optarg; break; 225 case 'd': debug = true; break; 184 226 default: /* '?' */ 185 227 usage(); … … 395 437 396 438 // Load the objdump for the symbols in this executable. 397 objdumpProcessor->load( *eitr );439 objdumpProcessor->load( *eitr, objdumpFile, err ); 398 440 } 399 441 … … 504 546 } 505 547 548 //Leave tempfiles around if debug flag (-d) is enabled. 549 if ( debug ) { 550 objdumpFile.override( "objdump_file" ); 551 objdumpFile.keep(); 552 err.override( "objdump_exec_log" ); 553 err.keep(); 554 } 506 555 return 0; 507 556 }
Note: See TracChangeset
for help on using the changeset viewer.