#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    4
    Rep Power
    0

    pro c just.....dying


    Hi

    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???

    Thanks

    Martin
  2. #2
  3. /(bb|[^b]{2})/

    Join Date
    Nov 2001
    Location
    Somewhere in the great unknown
    Posts
    5,163
    Rep Power
    792
    use a debugger to step through the program during its execution.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    4
    Rep Power
    0
    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?

    Thanks

    Martin
  6. #4
  7. /(bb|[^b]{2})/

    Join Date
    Nov 2001
    Location
    Somewhere in the great unknown
    Posts
    5,163
    Rep Power
    792
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    4
    Rep Power
    0
    Thanks

    Martin
  10. #6
  11. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    4
    Rep Power
    0
    OK...I'm back.

    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.

    Thanks

    Martin
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2002
    Location
    Flint, MI
    Posts
    328
    Rep Power
    12
    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.
    Clay Dowling
    Lazarus Notes
    Articles and commentary on web development
    http://www.lazarusid.com/notes/

IMN logo majestic logo threadwatch logo seochat tools logo