From: Jonathon McKitrick
Subject: How to approach logic bugs
Date: 
Message-ID: <1137167491.171852.230500@z14g2000cwz.googlegroups.com>
Since the debugger only breaks on exceptions (AFAIK), what approach can
be used with the debugger when trying to find logic errors?

From: Kenny Tilton
Subject: Re: How to approach logic bugs
Date: 
Message-ID: <yfRxf.83$yE4.68@news-wrt-01.rdc-nyc.rr.com>
Jonathon McKitrick wrote:
> Since the debugger only breaks on exceptions (AFAIK), what approach can
> be used with the debugger when trying to find logic errors?
> 

(break &optional format-string &rest format-args) will get you into the 
debugger.

(assert <conditon> () &optional fmt$ &rest fmtargs) likewise if the 
conditon fails.

(error....)


kt
From: Michael Price
Subject: Re: How to approach logic bugs
Date: 
Message-ID: <slrndsgcpu.bib.malus42@yahoo.com>
On 2006-01-13, Jonathon McKitrick <···········@bigfoot.com> wrote:
>  Since the debugger only breaks on exceptions (AFAIK), what approach can
>  be used with the debugger when trying to find logic errors?

Last week in message ···············@individual.net Pascal Costanza
mentioned:

  (defun log (string)
     (when *debug*
       (print string)))

  (define-compiler-macro log (string)
     (when *debug*
       `(print ,string)))

in the macros over functions thread.

Michael
From: Gareth McCaughan
Subject: Re: How to approach logic bugs
Date: 
Message-ID: <87acdz67y4.fsf@g.mccaughan.ntlworld.com>
Jonathon McKitrick wrote:

> Since the debugger only breaks on exceptions (AFAIK), what approach can
> be used with the debugger when trying to find logic errors?

Long hard thought. Sorry. :-)

(But Kenny's right: ASSERT should probably be your first
port of call, and BREAK and ERROR are there if you need
them. And debugging output. Lots of debugging output.)

-- 
Gareth McCaughan
.sig under construc
From: Raffael Cavallaro
Subject: Re: How to approach logic bugs
Date: 
Message-ID: <2006011402001750073-raffaelcavallaro@pasdespamsilvousplaitmaccom>
On 2006-01-13 18:14:02 -0500, Gareth "Neo" McCaughan 
<················@pobox.com>
said in response to Jonathon "Tank" McKitrick's question:

"Okay, So what do you need, besides a miracle?":


> debugging output. Lots of debugging output.


Don't miss Gareth in the soon-to-be-released sequel "The Backtrace 
Restarted" coming soon to a common lisp theater near you!

;^)
From: Gareth McCaughan
Subject: Re: How to approach logic bugs
Date: 
Message-ID: <874q461gy3.fsf@g.mccaughan.ntlworld.com>
Raffael Cavallaro wrote:

> On 2006-01-13 18:14:02 -0500, Gareth "Neo" McCaughan
> <················@pobox.com>
> said in response to Jonathon "Tank" McKitrick's question:
> 
> "Okay, So what do you need, besides a miracle?":
> 
>> debugging output. Lots of debugging output.
> 
> Don't miss Gareth in the soon-to-be-released sequel "The Backtrace
> Restarted" coming soon to a common lisp theater near you!
> 
> ;^)

Glad to see that someone caught the obvious reference :-).

-- 
Gareth McCaughan
.sig under construc
From: David Sletten
Subject: Re: How to approach logic bugs
Date: 
Message-ID: <wz0yf.385$eV4.161@tornado.socal.rr.com>
Jonathon McKitrick wrote:

> Since the debugger only breaks on exceptions (AFAIK), what approach can
> be used with the debugger when trying to find logic errors?
> 
Automated unit testing. Your tests are a sort of contract regarding how 
the code is supposed to behave. If your code doesn't satisfy your test 
suite, then you have logic errors.

http://www.gigamonkeys.com/book/practical-building-a-unit-test-framework.html

Aloha,
David Sletten