Changeset 9114 for code/branches/testing
- Timestamp:
- Apr 22, 2012, 10:36:09 AM (13 years ago)
- Location:
- code/branches/testing
- Files:
-
- 9 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/testing/src/libraries/util/SignalHandler.cc
r8858 r9114 21 21 * 22 22 * Author: 23 * Christoph Renner 23 * Christoph Renner (Linux implementation) 24 * Fabian 'x3n' Landau (Windows implementation) 24 25 * Co-authors: 25 26 * ... … … 139 140 orxout(user_error) << "Received signal " << sigName.c_str() << endl << "Try to write backtrace to file orxonox_crash.log" << endl; 140 141 141 142 142 143 // First start GDB which will be attached to this process later on 143 144 144 145 int gdbIn[2]; 145 146 int gdbOut[2]; 146 147 int gdbErr[2]; 147 148 148 149 if ( pipe(gdbIn) == -1 || pipe(gdbOut) == -1 || pipe(gdbErr) == -1 ) 149 150 { … … 151 152 exit(EXIT_FAILURE); 152 153 } 153 154 154 155 int gdbPid = fork(); 155 156 // this process will run gdb 156 157 157 158 if ( gdbPid == -1 ) 158 159 { … … 160 161 exit(EXIT_FAILURE); 161 162 } 162 163 163 164 if ( gdbPid == 0 ) 164 165 { 165 166 // start gdb 166 167 167 168 close(gdbIn[1]); 168 169 close(gdbOut[0]); 169 170 close(gdbErr[0]); 170 171 171 172 dup2( gdbIn[0], STDIN_FILENO ); 172 173 dup2( gdbOut[1], STDOUT_FILENO ); 173 174 dup2( gdbErr[1], STDERR_FILENO ); 174 175 175 176 execlp( "sh", "sh", "-c", "gdb", static_cast<void*>(NULL)); 176 177 } 177 178 178 179 179 180 // Now start a fork of this process on which GDB will be attached on 180 181 181 182 int sigPipe[2]; 182 183 if ( pipe(sigPipe) == -1 ) … … 202 203 { 203 204 getInstance().dontCatch(); 204 205 205 206 // make sure gdb is allowed to attach to our PID even if there are some system restrictions 206 207 #ifdef PR_SET_PTRACER … … 208 209 orxout(user_error) << "could not set proper permissions for GDB to attach to process..." << endl; 209 210 #endif 210 211 211 212 // wait for message from parent when it has attached gdb 212 213 int someData; -
code/branches/testing/src/libraries/util/SignalHandler.h
r8351 r9114 21 21 * 22 22 * Author: 23 * Christoph Renner 23 * Christoph Renner (Linux implementation) 24 * Fabian 'x3n' Landau (Windows implementation) 24 25 * Co-authors: 25 26 * ... -
code/branches/testing/test/CMakeLists.txt
- Property svn:eol-style set to native
-
code/branches/testing/test/CTestCustom.cmake
- Property svn:eol-style set to native
-
code/branches/testing/test/util/CMakeLists.txt
- Property svn:eol-style set to native
r9025 r9114 3 3 EXCLUDE_FROM_ALL 4 4 ${GMOCK_MAIN} 5 ConvertTest.cc 5 6 MathTest.cc 7 mboolTest.cc 8 ScopeTest.cc 9 SharedPtrTest.cc 10 SingletonTest.cc 11 SmallObjectAllocatorTest.cc 12 StringUtilsTest.cc 13 SubStringTest.cc 14 VA_NARGSTest.cc 6 15 ) 7 16 TARGET_LINK_LIBRARIES(util_test util gmock_orxonox) … … 9 18 10 19 ADD_TEST(util_test ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/util_test) 20 21 #----------------- 22 23 IF(MSVC) 24 IF(CMAKE_CL_64) 25 SET(MSVC_PLATFORM "x64") 26 ELSE() 27 SET(MSVC_PLATFORM "Win32") 28 ENDIF() 29 IF(MSVC10) 30 CONFIGURE_FILE("../../src/orxonox-main.vcxproj.user.in" "${CMAKE_CURRENT_BINARY_DIR}/util_test.vcxproj.user") 31 ELSE() 32 STRING(REGEX REPLACE "^Visual Studio ([0-9][0-9]?).*$" "\\1" 33 VISUAL_STUDIO_VERSION_SIMPLE "${CMAKE_GENERATOR}") 34 CONFIGURE_FILE("../../src/orxonox-main.vcproj.user.in" "${CMAKE_CURRENT_BINARY_DIR}/util_test.vcproj.user") 35 ENDIF() 36 ENDIF(MSVC) -
code/branches/testing/test/util/MathTest.cc
- Property svn:eol-style set to native
r9026 r9114 324 324 TEST(getUniqueNumber, Test) 325 325 { 326 std::set< float> numbers;326 std::set<unsigned long> numbers; 327 327 328 328 const size_t iterations = 1000;
Note: See TracChangeset
for help on using the changeset viewer.