September 11th, 2003, 06:04 AM
pro c just.....dying
I have pro c module which has been working for years. It is running in an overnight batch. All of a sudden it hasn't been completing. No errors as to why though, it just looks like it hasn't finished. I've added a trace facility to it and ran it again and again the program just seems to die. The trc file seems to run through fine but again just stops with no hint of an error.
Any ideas on things I could check/do to try and get the bottom of this???
September 11th, 2003, 07:47 AM
use a debugger to step through the program during its execution.
September 11th, 2003, 07:49 AM
OK...Sorry this is my first time looking at pro c - covering for a colleague. How would I debug pro c to see what it's doing?
September 11th, 2003, 07:55 AM
September 11th, 2003, 07:57 AM
September 11th, 2003, 08:30 AM
Is there a way to debug so that I can just put in my own messages to spool out as it runs through - e.g fprintf?
Also would this spool out to command line (if run through Unix) as program runs through cause no point if it would only print to log file, as log file is never created.
September 11th, 2003, 10:23 AM
If you use printf to generate your messages, they'll go to whereever the standard output stream goes. Likewise, outputting with fprintf(stderr, const char*, ...) will output to whereever the standard error stream goes.
If you're running this job from a cron job, the results will show up in an e-mail to the job's owner when the job is done. Otherwise figure out where the streams are being directed to and you'll know where to look for your messages. Unless you have taken explicit steps to close stdin, stdout and stderr, your program gets them automatically as part of the C runtime startup, at least in UNIX operating systems.
Articles and commentary on web development