home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- 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
- From: cnhasan@casbah.acns.nwu.edu (Nirmal Hasan)
- Subject: Bug in Turbo Debugger?
- Message-ID: <1992Sep4.202516.9563@news.acns.nwu.edu>
- Keywords: BC++ 2.0, Turbo Debugger, BUG?
- Sender: usenet@news.acns.nwu.edu (Usenet on news.acns)
- Organization: Northwestern University, Evanston, Illinois, USA
- Date: Fri, 4 Sep 1992 20:25:16 GMT
- Lines: 57
-
- I am using BC++ 2.0 to develop a discreet event simulator. I have run into
- a weird problem with the Turbo Debugger. I have a couple of data structures
- as follows:
-
- class foo_rec
- {
- :
- :
- foo_rec *next;
- :
- :
- }
-
- struct foo_list
- {
- foo_rec *List;
- :
- :
- }
-
- In the code I have
-
- while (something_or_other)
- {
- foo_rec *temp = foo_list.List; // Line 1
-
- // Now search the linked list for a record
-
- if (!temp) Error(REC_NOT_FOUND)
- // Error() is my error reporting function. Exits on error
-
- //Continue processing the rec found
-
- }
-
- If I step through the line marked "Line 1", temp contains junk and the
- program either exits with error if I was lucky enough to hit a NULL pointer
- somewhere, or goes into the wild blue yonder while searching the linked
- list. But the original linked list remains intact though (I checked that
- using the watch and inspector windows).
-
- But none of this happens if I just let the program run. The program works
- fine. If I have a break point set up on "Line 1", but continue execution
- *without* stepping throught that line, things are fine. If I setup a
- breakpoint before "Line 1" and another after "Line 1" and run, no problems.
- The problems occur only when I use the "step" facility. And only on this
- particular line. I have the same statement elsewhere in the program and
- have the same problems.
-
- I apologise for that rambling description, but I wasted 4 days in trying to
- debug my program before I realized that the bug was in the debugger, and I
- am very pissed!
-
- Has something similar happened to anybody else? Is it really a bug in the
- debugger or is it something to do with the code itself?
-
- Nirmal "Very upset" Hasan
-