home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / cplus / 13311 < prev    next >
Encoding:
Text File  |  1992-09-07  |  2.1 KB  |  69 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!sun-barr!ames!haven.umd.edu!darwin.sura.net!zaphod.mps.ohio-state.edu!news.acns.nwu.edu!casbah.acns.nwu.edu!cnhasan
  3. From: cnhasan@casbah.acns.nwu.edu (Nirmal Hasan)
  4. Subject: Bug in Turbo Debugger? 
  5. Message-ID: <1992Sep4.202516.9563@news.acns.nwu.edu>
  6. Keywords: BC++ 2.0, Turbo Debugger, BUG?
  7. Sender: usenet@news.acns.nwu.edu (Usenet on news.acns)
  8. Organization: Northwestern University, Evanston, Illinois, USA
  9. Date: Fri, 4 Sep 1992 20:25:16 GMT
  10. Lines: 57
  11.  
  12. I am using BC++ 2.0 to develop a discreet event simulator. I have run into
  13. a weird problem with the Turbo Debugger. I have a couple of data structures
  14. as follows: 
  15.  
  16. class foo_rec
  17. {
  18.     :
  19.     :
  20. foo_rec *next;
  21.     :
  22.     :
  23. }
  24.  
  25. struct foo_list
  26. {
  27. foo_rec *List;
  28.     :
  29.     :
  30. }
  31.  
  32. In the code I have
  33.  
  34.     while (something_or_other)
  35.     {
  36.       foo_rec *temp = foo_list.List;      // Line 1
  37.  
  38.       // Now search the linked list for a record
  39.  
  40.      if (!temp) Error(REC_NOT_FOUND) 
  41.       // Error() is my error reporting function. Exits on error
  42.  
  43.      //Continue processing the rec found
  44.  
  45.     }
  46.  
  47. If I step through the line marked "Line 1", temp contains junk and the
  48. program either exits with error if I was lucky enough to hit a NULL pointer
  49. somewhere, or goes into the wild blue yonder while searching the linked
  50. list. But the original linked list remains intact though (I checked that
  51. using the watch and inspector windows).
  52.  
  53. But none of this happens if I just let the program run. The program works
  54. fine. If I have a break point set up on "Line 1", but continue execution
  55. *without* stepping throught that line, things are fine. If I setup a
  56. breakpoint before "Line 1" and another after "Line 1" and run, no problems.
  57. The problems occur only when I use the "step" facility. And only on this
  58. particular line. I have the same statement elsewhere in the program and
  59. have the same problems.
  60.  
  61. I apologise for that rambling description, but I wasted 4 days in trying to
  62. debug my program before I realized that the bug was in the debugger, and I
  63. am very pissed!
  64.  
  65. Has something similar happened to anybody else? Is it really a bug in the
  66. debugger or is it something to do with the code itself?  
  67.  
  68. Nirmal "Very upset" Hasan
  69.