Changes between Version 28 and Version 29 of AppDebug
- Timestamp:
- Apr 12, 2017, 1:33:18 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AppDebug
v28 v29 1 1 = Application debugging = 2 2 [[PageOutline]] 3 Some suggestions for debugging applications: 3 In debugging a BOINC application, 4 you need to make sure that it interfaces properly with the BOINC client. 5 You can do this in stages, as follows: 4 6 5 == Testing without a BOINC client ==7 == Testing without a BOINC client, part 1 == 6 8 7 9 When you have built your application and linked it with the BOINC libraries, 8 10 you can run it in '''standalone mode''' (without a BOINC client present). 9 To do this, put instances of all input files in the same directory (with the proper logical, not physical, names). 10 The application should run and produce output files (also with their logical names). 11 To do this, put instances of all input files in the same directory 12 (with the proper logical, not physical, names). 13 The application should run, produce output files (also with their logical names), 14 and exit with 0 status. 11 15 You can run the program under a debugger. 12 When you run an application in standalone mode, the BOINC API will recognize this and take it into account.13 16 14 Note: {{{boinc_time_to_checkpoint()}}} will always return false, so your application will never checkpoint. 17 Note: {{{boinc_time_to_checkpoint()}}} will always return false, 18 so your application will never checkpoint. 19 20 == Testing without a BOINC client, part 2 == 21 22 The next step is to make sure that suspend, resume, and abort work. 23 To do this: 24 25 * Edit boinc/api/boinc_api.cpp; uncomment the #defines of 26 MSGS_FROM_FILE and (if you want) VERBOSE. 27 This tells the BOINC API to look for process control messages 28 in a file "msgs.txt" rather than in shared memory. 29 Rebuild the BOINC API library, and rebuild your app. 30 * Run your app. 31 * To suspend your app, write "<suspend/>" to msgs.txt. 32 You need to do this atomically, e.g. write "<suspend/>" to another file, 33 then copy that file to msgs.txt. 34 "cat > msgs.txt" doesn't work. 35 * Similar for <resume/> and <abort/>. 36 Verify that they all work. 15 37 16 38 == Testing with a BOINC client but no project == … … 24 46 and an output file with logical name '''out''' and physical name '''output.txt'''. 25 47 26 * Make a directory and put the BOINC client there. Note: you'll need a 6.10.14 or later client.48 * Make a directory and put the BOINC client there. You'll need a 6.10.14 or later client. 27 49 * Put the file 28 50 [http://boinc.berkeley.edu/gitweb/?p=boinc-v2.git;a=blob_plain;f=samples/client_state_save.xml;hb=HEAD samples/client_state_save.xml] … … 143 165 There are several techniques for deciphering these. 144 166 For details see [MacBacktrace Mac Backtrace]. 145 Although that page is written primarily for the Mac, much of it can be used on Linux and UNIX systems as well.146 167 Although that page is written primarily for the Mac, 168 much of it can be used on Linux and UNIX systems as well.