home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!wupost!usc!sdd.hp.com!uakari.primate.wisc.edu!ames!pacbell.com!pbhya!dbsuthe
- From: dbsuthe@pbhya.PacBell.COM (Daniel B. Suthers)
- Newsgroups: comp.programming
- Subject: Re: When should a debugger be used?
- Summary: When you have no obvious problems...
- Message-ID: <1992Aug20.162922.29937@pbhya.PacBell.COM>
- Date: 20 Aug 92 16:29:22 GMT
- References: <j1ymvg=.pdh@netcom.com> <164c9vINNijk@agate.berkeley.edu> <6453@fury.BOEING.COM>
- Reply-To: dbsuthe@PacBell.COM (Daniel B. Suthers)
- Organization: Pacific * Bell, San Ramon, CA
- Lines: 31
-
- In article <6453@fury.BOEING.COM> cek@sdc.boeing.com (Conrad Kimball) writes:
- >|> >4. Divide-and-conquer when things go wrong by adding some output somewhere
- >|> > (usually an fprintf() added at a strategic spot).
- >
- >And what do you do when the problem goes away when you add the fprintf()?
- >I've had that happen. A bad pointer leading to trashed memory, and
- >inserting more code moves things around so the trashed memory no longer
- >causes the program to fail...
- >
- >--
- >Conrad Kimball | Unix Server Tech Services, Boeing Computer Services
-
-
- And you would be suprised how many programmers just leave the fprintf there
- and assume the bug is fixed!!!
-
- This seems to be one of the classic C bug symptoms, and (for me) it always
- turns out to be a pointer problem. A real good debugger can help here, but so
- can a deskcheck of your code.
-
- To answer the question posed by the subject line: IMHO a debugger is best used
- after the logic has been checked. The very first step is to make sure that
- the bug can be reproduced consistantly. Then and only then can you research
- the cause of the bug with 100% assurance that your cure will be the cure.
-
- Daniel B. Suthers, CCP
- Technology Consultant, PCS & IN Development Lab, Pac*Bell
- Voice: (510) 671-1325 UUCP: pacbell!pbeos!dbsuthe
- ================================================================================
- = Commit unexpected kindnesses and senseless acts of beauty. =
- ================================================================================
-