Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uunet!tut.cis.ohio-state.edu!ucbvax!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.programmer Subject: Re: Possible (minor) Think C 4.0 debugger problem - one line funcs Message-ID: <9193@hoptoad.uucp> Date: 5 Dec 89 07:32:34 GMT References: <7726@viscous.sco.COM> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Eclectic Software, San Francisco Lines: 37 In article <7726@viscous.sco.COM> jamesm@sco.COM (James M. Moore) writes: >Ran into a strange problem with the Think 4.0 debugger last night. I was >working on a styled text edit class as a subclass of CEditText, and had >several stub routines that did nothing, declared like so: > > void BStylEditText::InsertText(Ptr data, long length) {}; > >with the entire function on one line. > >The problem was that when I stepped into the InsertText routine, the debugger >indicated I was at a totally different point in my code, and then proceeded >to crash in various mysterious ways. Taking a closer look, I saw that the >debugger wasn't putting triangles next to the one-line procedures. Adding a >return in between the curly braces made the problem go away, and the >code now seems to be working fine. I know it's a problem in THINK C 3.0, so I wouldn't be surprised if they didn't fix it in 4.0. (I've *got* to send in that registration card one of these days!) I frequently write routines that have executable C text on the first post-parameter line of the routine, e.g., void foo() { bar(); ... } and the THINK C debugger refuses to put a triangle on the bar() line. I don't like the way the white space looks when I put the bracket on a line by itself, but it seems that THINK C wants to force me to use their preferred coding style. This appears to be the same thing that is biting you. -- Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com "I see little divinity about them or you. You talk to me of Christianity when you are in the act of hanging your enemies. Was there ever such blasphemous nonsense!" - Shaw, "The Devil's Disciple"