[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sbcl-help
Subject:    Re: [Sbcl-help] debugging help
From:       Will Senn <will.senn () gmail ! com>
Date:       2017-03-19 17:34:27
Message-ID: f1f01f31-87f4-6b4f-90a4-3c8f72581a23 () gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Success! I appreciate your help.

(defun sum (n1 n2)
  (declare (optimize (debug 3)))
  (break)
  (if (zerop n1) n2
      (sum (1- n1) (1+ n2))))

SUM
CL-USER> (sum 999999999 0)

debugger invoked on a SIMPLE-CONDITION in thread
#<THREAD "main thread" RUNNING {100216E5B3}>:
  break

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [CONTINUE] Return from BREAK.
  1: [ABORT   ] Exit debugger, returning to top level.

(SUM 999999999 0)
   source: (BREAK)
0] s

Not currently single-stepping. (Use START to activate the single-stepper)

0] start
; Evaluating call:
;   (- N1 1)
; With unknown arguments

0] s
; Evaluating call:
;   (+ N2 1)
; With unknown arguments

0] n1

999999999
0] n2

0
0] p
(SUM 999999999 0)
0] s
; Evaluating call:
;   (SUM (1- N1) (1+ N2))
; With arguments:
;   999999998
;   1

1]

On 3/19/17 12:27 PM, Stas Boukarev wrote:
> CONTINUE doesn't invoke stepping, you need to use one of
>
>   STEP  Steps into the current form.
>   NEXT  Steps over the current form.
>   OUT   Stops stepping temporarily, but resumes it when the topmost
> frame that
>         was stepped into returns.
>
> If you wanted just to watch all the calls to SUM you can do (trace
> sum) before calling it.
>
> On Sun, Mar 19, 2017 at 8:25 PM, Will Senn <will.senn@gmail.com
> <mailto:will.senn@gmail.com>> wrote:
>
>     Ha, I was about to reply that I'm a complete newb, but I'm pretty
>     sure you knew that :). Thanks for the example! It's working.
>
>     So, taking off on what you suggested, I did this:
>
>     (defun sum (n1 n2)
>       (declare (optimize (debug 3)))
>       (break)
>       (if (zerop n1) n2
>           (sum (1- n1) (1+ n2))))
>
>     now when I execute the function, it breaks on each call.
>
>     CL-USER> (sum 99999 0)
>
>     debugger invoked on a SIMPLE-CONDITION in thread
>     #<THREAD "main thread" RUNNING {100216E5B3}>:
>       break
>
>     Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.
>
>     restarts (invokable by number or by possibly-abbreviated name):
>       0: [CONTINUE] Return from BREAK.
>       1: [ABORT   ] Exit debugger, returning to top level.
>
>     (SUM 99999 0)
>        source: (BREAK)
>     0] c
>
>     debugger invoked on a SIMPLE-CONDITION in thread
>     #<THREAD "main thread" RUNNING {100216E5B3}>:
>       break
>
>     Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.
>
>     restarts (invokable by number or by possibly-abbreviated name):
>       0: [CONTINUE] Return from BREAK.
>       1: [ABORT   ] Exit debugger, returning to top level.
>
>     (SUM 99998 1)
>        source: (BREAK)
>     0] c
>
>     debugger invoked on a SIMPLE-CONDITION in thread
>     #<THREAD "main thread" RUNNING {100216E5B3}>:
>       break
>
>     Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.
>
>     restarts (invokable by number or by possibly-abbreviated name):
>       0: [CONTINUE] Return from BREAK.
>       1: [ABORT   ] Exit debugger, returning to top level.
>
>     (SUM 99997 2)
>        source: (BREAK)
>
>     It seems reasonable and in line with what I would expect.
>     Hallelujah! The function is just too simple and quick for it to be
>     very interesting, but I gather that a more complex function that
>     has more forms to process will feel more like a traditional
>     debugging session. I can break on entering the function and step
>     through the forms. I'm not entirely sure what role START has in
>     any session though, any insight on when I would need/use START?
>
>     Thanks,
>
>
>     Will
>
>
>     On 3/19/17 12:08 PM, Douglas Katzman wrote:
>>     Apology, I meant would _NOT_ have expected you to know.
>>     Very sorry about that typo.
>>
>>     On Sun, Mar 19, 2017 at 1:08 PM, Douglas Katzman
>>     <dougk@google.com <mailto:dougk@google.com>> wrote:
>>
>>         As Stas said, you're gonna have a problem due to recursion.
>>         Compiling with DEBUG 3 will not let you invoke (sum 999999999
>>         0) due to stack overflow.
>>         There's a trick that works, which I would have expected you
>>         to know.  Try as follows:
>>
>>         * (defun sum (n1 n2)
>>           (declare (optimize (debug 2)))
>>           (if (zerop n1) n2
>>             (locally
>>              (declare (optimize (debug 3)))
>>              (sum (1- n1) (1+ n2)))))
>>         SUM
>>
>>         * (step(sum 9999999 0))
>>         (step(sum 9999999 0))
>>         ; Evaluating call:
>>         ;   (- N1 1)
>>         ; With unknown arguments
>>
>>         0] step
>>         step
>>         ; Evaluating call:
>>         ;   (+ N2 1)
>>         ; With unknown arguments
>>
>>         0] step
>>         step
>>         ; Evaluating call:
>>         ;   (SUM (1- N1) (1+ N2))
>>         ; With arguments:
>>         ;   9999998
>>         ;   1
>>
>>         1] step
>>         step
>>         ; Evaluating call:
>>         ;   (- N1 1)
>>         ; With unknown arguments
>>
>>         0] :l
>>         :l
>>         N1  =  9999998
>>         N2  =  1
>>
>>
>>         On Sun, Mar 19, 2017 at 1:05 PM, Will Senn
>>         <will.senn@gmail.com <mailto:will.senn@gmail.com>> wrote:
>>
>>             Hmm. Help says that this will work, but as I explained
>>             below, I haven't been able to see it work. Can you
>>             provide an example?
>>
>>
>>             On 3/19/17 12:01 PM, Stas Boukarev wrote:
>>>             Actually, you can start stepping from the debugger,
>>>             using START.
>>>             I just typed HELP and found that out...
>>>
>>>             On Sun, Mar 19, 2017 at 7:57 PM, Stas Boukarev
>>>             <stassats@gmail.com <mailto:stassats@gmail.com>> wrote:
>>>
>>>                 You can't step from the debugger, you have to call
>>>                 your function with stepping.
>>>                 And it has to be compiled with debug 3.
>>>                 And using INLINE is a good way to defeat stepping,
>>>                 and inlining of recursive functions isn't going to
>>>                 end well.
>>>
>>>                 On Sun, Mar 19, 2017 at 7:43 PM, Will Senn
>>>                 <will.senn@gmail.com <mailto:will.senn@gmail.com>>
>>>                 wrote:
>>>
>>>                     Hi,
>>>
>>>                     I've asked about this on the irc channel, but
>>>                     didn't get a satisfactory
>>>                     response, so I thought I would ask y'all. I am
>>>                     trying to understand and
>>>                     use debugging with SBCL. It isn't going
>>>                     swimmingly. Here is the scenario...
>>>
>>>                     Given the following function:
>>>
>>>                     (defun sum (n1 n2)
>>>                       (if (zerop n1) n2
>>>                           (sum (1- n1) (1+ n2))))
>>>
>>>                     And the call:
>>>                     (sum 999999999 0)
>>>
>>>                     This takes a while to execute. So, I hit C-c and
>>>                     enter the debugger. If
>>>                     it breaks in my code, I can then display the
>>>                     values of n1 and n2 and
>>>                     continue the program, breaking, evaluating, and
>>>                     continuing as desired.
>>>                     What I really want to do is single step through
>>>                     the code evaluating
>>>                     things as I do so. Two problems arise in this,
>>>                     1. I can't seem to break
>>>                     into my code predictably. 2. I can't seem to
>>>                     cause the single step
>>>                     functionality to be enabled.
>>>
>>>                     Just FYI, I also tried adding inline and debug
>>>                     declarations to my code
>>>                     (and I varied the debug level from 0 to 3):
>>>
>>>                     (defun sum (n1 n2)
>>>                       (declare (inline sum))
>>>                       (declare (optimize (debug 1)))
>>>                       (if (zerop n1) n2
>>>                           (sum (1- n1) (1+ n2))))
>>>
>>>                     By way of background, my experience with
>>>                     debuggers is in C and languages
>>>                     that are similar. In these languages, you tell
>>>                     the debugger to break at
>>>                     main (or the first line of main, or at a
>>>                     breakpoint) and then can step
>>>                     into, over and out of function calls. In those
>>>                     languages, you can also
>>>                     break on a signal (such as C-c) as well as near
>>>                     limitless number of
>>>                     other conditions. I am not looking for the same
>>>                     level of support, but I
>>>                     would like to be able to predictably break into
>>>                     my running code and be
>>>                     able to "step" through it.
>>>
>>>                     I've read the relevant sections of the manual,
>>>                     but they are not really
>>>                     that clear on these points. I've tried using
>>>                     START, but it either just
>>>                     continues the program or says it's not possible
>>>                     to continue (if there's
>>>                     a fatal bug), so STEP always says - Not
>>>                     currently single-stepping. (Use
>>>                     START to activate the single-stepper). I have
>>>                     used BACKTRACE when the
>>>                     debugger stops outside of my code, but using
>>>                     DOWN and UP don't seem to
>>>                     get me to a place in my code where I can
>>>                     evaluate N1 and N2, like I can
>>>                     when it breaks inside my code. Here's a bit of a
>>>                     debug session
>>>                     illustrating the point, followed by my
>>>                     questions, I apologize in advance
>>>                     for the length of this discussion, but wasn't
>>>                     sure what was critically
>>>                     important vs cruft:
>>>
>>>                     ;; C-c to enter the debugger
>>>                     debugger invoked on a
>>>                     SB-SYS:INTERACTIVE-INTERRUPT in thread
>>>                     #<THREAD "main thread" RUNNING {100216E5B3}>:
>>>                       Interactive interrupt at #x200002B2.
>>>
>>>                     Type HELP for debugger help, or (SB-EXT:EXIT) to
>>>                     exit from SBCL.
>>>
>>>                     restarts (invokable by number or by
>>>                     possibly-abbreviated name):
>>>                       0: [CONTINUE] Return from SB-UNIX:SIGINT.
>>>                       1: [ABORT   ] Exit debugger, returning to top
>>>                     level.
>>>
>>>                     (SB-VM::GENERIC-+)
>>>
>>>                     ;; well, it's not my code
>>>                     0] backtrace
>>>
>>>                     Backtrace for: #<SB-THREAD:THREAD "main thread"
>>>                     RUNNING {100216E5B3}>
>>>                     0: (SB-VM::GENERIC-+)
>>>                     1: (SB-INT:SIMPLE-EVAL-IN-LEXENV (SUM 999999999
>>>                     0) #<NULL-LEXENV>)
>>>                     2: (EVAL (SUM 999999999 0))
>>>                     3: (INTERACTIVE-EVAL (SUM 999999999 0) :EVAL NIL)
>>>                     4: (SB-IMPL::REPL-FUN NIL)
>>>                     5: ((LAMBDA NIL :IN SB-IMPL::TOPLEVEL-REPL))
>>>                     6: (SB-IMPL::%WITH-REBOUND-IO-SYNTAX #<CLOSURE
>>>                     (LAMBDA NIL :IN
>>>                     SB-IMPL::TOPLEVEL-REPL) {10027DA9EB}>)
>>>                     7: (SB-IMPL::TOPLEVEL-REPL NIL)
>>>                     8: (SB-IMPL::TOPLEVEL-INIT)
>>>                     9: ((FLET #:WITHOUT-INTERRUPTS-BODY-78 :IN
>>>                     SAVE-LISP-AND-DIE))
>>>                     10: ((LABELS SB-IMPL::RESTART-LISP :IN
>>>                     SAVE-LISP-AND-DIE))
>>>
>>>                     ;; navigate to something looking like my code
>>>                     0] d 2
>>>                     (SB-INT:SIMPLE-EVAL-IN-LEXENV (SUM 999999999 0)
>>>                     #<NULL-LEXENV>)
>>>                     1] n1
>>>
>>>                     ;
>>>                     ; caught WARNING:
>>>                     ;   undefined variable: N1
>>>                     ;
>>>                     ; compilation unit finished
>>>                     ;   Undefined variable:
>>>                     ;     N1
>>>                     ;   caught 1 WARNING condition
>>>
>>>                     debugger invoked on a UNBOUND-VARIABLE in thread
>>>                     #<THREAD "main thread" RUNNING {100216E5B3}>:
>>>                       The variable N1 is unbound.
>>>
>>>                     Type HELP for debugger help, or (SB-EXT:EXIT) to
>>>                     exit from SBCL.
>>>
>>>                     restarts (invokable by number or by
>>>                     possibly-abbreviated name):
>>>                       0: [ABORT   ] Reduce debugger level (to debug
>>>                     level 1).
>>>                       1: [CONTINUE] Return from SB-UNIX:SIGINT.
>>>                       2:            Exit debugger, returning to top
>>>                     level.
>>>
>>>                     ((LAMBDA (#:G458)) #<unused argument>)
>>>                        source: (PROGN N1)
>>>                     0[2] 0
>>>
>>>                     1] backtrace
>>>
>>>                     Backtrace for: #<SB-THREAD:THREAD "main thread"
>>>                     RUNNING {100216E5B3}>
>>>                     0: (SB-INT:SIMPLE-EVAL-IN-LEXENV (SUM 999999999
>>>                     0) #<NULL-LEXENV>)
>>>                     1: (EVAL (SUM 999999999 0))
>>>                     2: (INTERACTIVE-EVAL (SUM 999999999 0) :EVAL NIL)
>>>                     3: (SB-IMPL::REPL-FUN NIL)
>>>                     4: ((LAMBDA NIL :IN SB-IMPL::TOPLEVEL-REPL))
>>>                     5: (SB-IMPL::%WITH-REBOUND-IO-SYNTAX #<CLOSURE
>>>                     (LAMBDA NIL :IN
>>>                     SB-IMPL::TOPLEVEL-REPL) {10027DA9EB}>)
>>>                     6: (SB-IMPL::TOPLEVEL-REPL NIL)
>>>                     7: (SB-IMPL::TOPLEVEL-INIT)
>>>                     8: ((FLET #:WITHOUT-INTERRUPTS-BODY-78 :IN
>>>                     SAVE-LISP-AND-DIE))
>>>                     9: ((LABELS SB-IMPL::RESTART-LISP :IN
>>>                     SAVE-LISP-AND-DIE))
>>>
>>>                     ;; maybe the next line is my code?
>>>
>>>                     1] d
>>>                     (EVAL (SUM 999999999 0))
>>>                     2] n1
>>>
>>>                     ;
>>>                     ; caught WARNING:
>>>                     ;   undefined variable: N1
>>>                     ;
>>>                     ; compilation unit finished
>>>                     ;   Undefined variable:
>>>                     ;     N1
>>>                     ;   caught 1 WARNING condition
>>>
>>>                     debugger invoked on a UNBOUND-VARIABLE in thread
>>>                     #<THREAD "main thread" RUNNING {100216E5B3}>:
>>>                       The variable N1 is unbound.
>>>
>>>                     Type HELP for debugger help, or (SB-EXT:EXIT) to
>>>                     exit from SBCL.
>>>
>>>                     restarts (invokable by number or by
>>>                     possibly-abbreviated name):
>>>                       0: [ABORT   ] Reduce debugger level (to debug
>>>                     level 1).
>>>                       1: [CONTINUE] Return from SB-UNIX:SIGINT.
>>>                       2:            Exit debugger, returning to top
>>>                     level.
>>>
>>>                     ((LAMBDA (#:G459)) #<unused argument>)
>>>                        source: (PROGN N1)
>>>                     0[2] 0
>>>
>>>
>>>                     ;; or the next line?
>>>                     2] d
>>>                     (INTERACTIVE-EVAL (SUM 999999999 0) :EVAL NIL)
>>>                     3] n1
>>>
>>>                     ;
>>>                     ; caught WARNING:
>>>                     ;   undefined variable: N1
>>>                     ;
>>>                     ; compilation unit finished
>>>                     ;   Undefined variable:
>>>                     ;     N1
>>>                     ;   caught 1 WARNING condition
>>>
>>>                     debugger invoked on a UNBOUND-VARIABLE in thread
>>>                     #<THREAD "main thread" RUNNING {100216E5B3}>:
>>>                       The variable N1 is unbound.
>>>
>>>                     Type HELP for debugger help, or (SB-EXT:EXIT) to
>>>                     exit from SBCL.
>>>
>>>                     restarts (invokable by number or by
>>>                     possibly-abbreviated name):
>>>                       0: [ABORT   ] Reduce debugger level (to debug
>>>                     level 1).
>>>                       1: [CONTINUE] Return from SB-UNIX:SIGINT.
>>>                       2:            Exit debugger, returning to top
>>>                     level.
>>>
>>>                     ((LAMBDA (#:G460)) #<unused argument>)
>>>                        source: (PROGN N1)
>>>                     0[2] 0
>>>
>>>                     ;; hmm, the rest doesn't look promising at all
>>>                     3] d
>>>                     (SB-IMPL::REPL-FUN NIL)
>>>                     4] backtrace
>>>
>>>                     Backtrace for: #<SB-THREAD:THREAD "main thread"
>>>                     RUNNING {100216E5B3}>
>>>                     0: (SB-IMPL::REPL-FUN NIL)
>>>                     1: ((LAMBDA NIL :IN SB-IMPL::TOPLEVEL-REPL))
>>>                     2: (SB-IMPL::%WITH-REBOUND-IO-SYNTAX #<CLOSURE
>>>                     (LAMBDA NIL :IN
>>>                     SB-IMPL::TOPLEVEL-REPL) {10027DA9EB}>)
>>>                     3: (SB-IMPL::TOPLEVEL-REPL NIL)
>>>                     4: (SB-IMPL::TOPLEVEL-INIT)
>>>                     5: ((FLET #:WITHOUT-INTERRUPTS-BODY-78 :IN
>>>                     SAVE-LISP-AND-DIE))
>>>                     6: ((LABELS SB-IMPL::RESTART-LISP :IN
>>>                     SAVE-LISP-AND-DIE))
>>>
>>>                     4] u
>>>                     (INTERACTIVE-EVAL (SUM 999999999 0) :EVAL NIL)
>>>                     3] u
>>>                     (EVAL (SUM 999999999 0))
>>>                     2] u
>>>                     (SB-INT:SIMPLE-EVAL-IN-LEXENV (SUM 999999999 0)
>>>                     #<NULL-LEXENV>)
>>>                     1] u
>>>                     (SB-VM::GENERIC-+)
>>>                     0] c
>>>
>>>                     ;; C-c again and this time, it's my code
>>>
>>>                     debugger invoked on a
>>>                     SB-SYS:INTERACTIVE-INTERRUPT in thread
>>>                     #<THREAD "main thread" RUNNING {100216E5B3}>:
>>>                       Interactive interrupt at #x1002472BAA.
>>>
>>>                     Type HELP for debugger help, or (SB-EXT:EXIT) to
>>>                     exit from SBCL.
>>>
>>>                     restarts (invokable by number or by
>>>                     possibly-abbreviated name):
>>>                       0: [CONTINUE] Return from SB-UNIX:SIGINT.
>>>                       1: [ABORT   ] Exit debugger, returning to top
>>>                     level.
>>>
>>>                     (SUM 70277999 929722000)
>>>                     unknown location: using block start
>>>
>>>                        source: (SUM (1- N1) (1+ N2))
>>>                     0] n1
>>>
>>>                     70277999
>>>                     0]
>>>
>>>                     Here are my questions:
>>>                     1. Is it possible to set a breakpoint in the
>>>                     code(say at the first line)?
>>>                     2. Is it possible to navigate back into the
>>>                     function source code, if a
>>>                     C-c stops the environment outside of the code
>>>                     (say, (SB-VM::GENERIC-+))?
>>>                     3. How does one single step the debugger?
>>>
>>>                     Thanks,
>>>
>>>                     Will
>>>
>>>                     --
>>>                     GPG Fingerprint: 208A 38D6 D1BF 5A6B 7F4D  CC0D
>>>                     21CB 91B3 21E5 671F
>>>
>>>
>>>
>>>                     ------------------------------------------------------------------------------
>>>                     Check out the vibrant tech community on one of
>>>                     the world's most
>>>                     engaging tech sites, Slashdot.org!
>>>                     http://sdm.link/slashdot
>>>                     _______________________________________________
>>>                     Sbcl-help mailing list
>>>                     Sbcl-help@lists.sourceforge.net
>>>                     <mailto:Sbcl-help@lists.sourceforge.net>
>>>                     https://lists.sourceforge.net/lists/listinfo/sbcl-help
>>>                     <https://lists.sourceforge.net/lists/listinfo/sbcl-help>
>>>
>>>
>>>
>>>
>>>                 -- 
>>>                 With best regards, Stas.
>>>
>>>
>>>
>>>
>>>             -- 
>>>             With best regards, Stas.
>>
>>             -- 
>>             GPG Fingerprint: 208A 38D6 D1BF 5A6B 7F4D  CC0D 21CB 91B3 21E5 671F
>>
>>
>>             ------------------------------------------------------------------------------
>>             Check out the vibrant tech community on one of the
>>             world's most
>>             engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>             _______________________________________________
>>             Sbcl-help mailing list
>>             Sbcl-help@lists.sourceforge.net
>>             <mailto:Sbcl-help@lists.sourceforge.net>
>>             https://lists.sourceforge.net/lists/listinfo/sbcl-help
>>             <https://lists.sourceforge.net/lists/listinfo/sbcl-help>
>>
>>
>>
>
>     -- 
>     GPG Fingerprint: 208A 38D6 D1BF 5A6B 7F4D  CC0D 21CB 91B3 21E5 671F
>
>
>
>
> -- 
> With best regards, Stas.

-- 
GPG Fingerprint: 208A 38D6 D1BF 5A6B 7F4D  CC0D 21CB 91B3 21E5 671F


[Attachment #5 (text/html)]

<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Success! I appreciate your help.<br>
    </p>
    <p><tt>(defun sum (n1 n2)<br>
          (declare (optimize (debug 3)))<br>
          (break)<br>
          (if (zerop n1) n2<br>
              (sum (1- n1) (1+ n2))))<br>
        <br>
        SUM<br>
        CL-USER&gt; (sum 999999999 0)<br>
        <br>
        debugger invoked on a SIMPLE-CONDITION in thread<br>
        #&lt;THREAD "main thread" RUNNING {100216E5B3}&gt;:<br>
          break<br>
        <br>
        Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.<br>
        <br>
        restarts (invokable by number or by possibly-abbreviated name):<br>
          0: [CONTINUE] Return from BREAK.<br>
          1: [ABORT   ] Exit debugger, returning to top level.<br>
        <br>
        (SUM 999999999 0)<br>
           source: (BREAK)<br>
        0] s<br>
        <br>
        Not currently single-stepping. (Use START to activate the
        single-stepper)<br>
        <br>
        0] start<br>
        ; Evaluating call:<br>
        ;   (- N1 1)<br>
        ; With unknown arguments<br>
        <br>
        0] s<br>
        ; Evaluating call:<br>
        ;   (+ N2 1)<br>
        ; With unknown arguments<br>
        <br>
        0] n1<br>
        <br>
        999999999<br>
        0] n2<br>
        <br>
        0<br>
        0] p<br>
        (SUM 999999999 0)<br>
        0] s<br>
        ; Evaluating call:<br>
        ;   (SUM (1- N1) (1+ N2))<br>
        ; With arguments:<br>
        ;   999999998<br>
        ;   1<br>
        <br>
        1] <br>
      </tt><br>
    </p>
    <div class="moz-cite-prefix">On 3/19/17 12:27 PM, Stas Boukarev
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAF63=10qqVQTZPokTRh_N6spitgdPu1mpcBED_8=Ju=rRdWCtQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">CONTINUE doesn't invoke stepping, you need to use
        one of
        <div><br>
          <div>
            <div>  STEP  Steps into the current form.</div>
            <div>  NEXT  Steps over the current form.</div>
            <div>  OUT   Stops stepping temporarily, but resumes it when
              the topmost frame that</div>
            <div>        was stepped into returns.</div>
          </div>
        </div>
        <div><br>
        </div>
        <div>If you wanted just to watch all the calls to SUM you can do
          (trace sum) before calling it.</div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Sun, Mar 19, 2017 at 8:25 PM, Will
          Senn <span dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:will.senn@gmail.com" \
target="_blank">will.senn@gmail.com</a>&gt;</span>  wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000">
              <p>Ha, I was about to reply that I'm a complete newb, but
                I'm pretty sure you knew that :). Thanks for the
                example! It's working.</p>
              <p>So, taking off on what you suggested, I did this:</p>
              <p>(defun sum (n1 n2)<br>
                  (declare (optimize (debug 3)))<br>
                  (break)<span class=""><br>
                    (if (zerop n1) n2<br>
                        (sum (1- n1) (1+ n2))))</span></p>
              <p>now when I execute the function, it breaks on each
                call. <br>
              </p>
              <p><tt>CL-USER&gt; (sum 99999 0)<br>
                  <br>
                  debugger invoked on a SIMPLE-CONDITION in thread<span
                    class=""><br>
                    #&lt;THREAD "main thread" RUNNING {100216E5B3}&gt;:<br>
                  </span>   break<span class=""><br>
                    <br>
                    Type HELP for debugger help, or (SB-EXT:EXIT) to
                    exit from SBCL.<br>
                    <br>
                    restarts (invokable by number or by
                    possibly-abbreviated name):<br>
                  </span>   0: [CONTINUE] Return from BREAK.<span
                    class=""><br>
                      1: [ABORT   ] Exit debugger, returning to top
                    level.<br>
                    <br>
                  </span> (SUM 99999 0)<br>
                     source: (BREAK)<br>
                  0] c<br>
                  <br>
                  debugger invoked on a SIMPLE-CONDITION in thread<span
                    class=""><br>
                    #&lt;THREAD "main thread" RUNNING {100216E5B3}&gt;:<br>
                  </span>   break<span class=""><br>
                    <br>
                    Type HELP for debugger help, or (SB-EXT:EXIT) to
                    exit from SBCL.<br>
                    <br>
                    restarts (invokable by number or by
                    possibly-abbreviated name):<br>
                  </span>   0: [CONTINUE] Return from BREAK.<span
                    class=""><br>
                      1: [ABORT   ] Exit debugger, returning to top
                    level.<br>
                    <br>
                  </span> (SUM 99998 1)<br>
                     source: (BREAK)<br>
                  0] c<br>
                  <br>
                  debugger invoked on a SIMPLE-CONDITION in thread<span
                    class=""><br>
                    #&lt;THREAD "main thread" RUNNING {100216E5B3}&gt;:<br>
                  </span>   break<span class=""><br>
                    <br>
                    Type HELP for debugger help, or (SB-EXT:EXIT) to
                    exit from SBCL.<br>
                    <br>
                    restarts (invokable by number or by
                    possibly-abbreviated name):<br>
                  </span>   0: [CONTINUE] Return from BREAK.<span
                    class=""><br>
                      1: [ABORT   ] Exit debugger, returning to top
                    level.<br>
                    <br>
                  </span> (SUM 99997 2)<br>
                     source: (BREAK)<br>
                </tt><br>
              </p>
              <p>It seems reasonable and in line with what I would
                expect. Hallelujah! The function is just too simple and
                quick for it to be very interesting, but I gather that a
                more complex function that has more forms to process
                will feel more like a traditional debugging session. I
                can break on entering the function and step through the
                forms. I'm not entirely sure what role START has in any
                session though, any insight on when I would need/use
                START?</p>
              <p>Thanks,</p>
              <p><br>
              </p>
              <p>Will<br>
              </p>
              <div>
                <div class="h5">
                  <p><br>
                  </p>
                  <div class="m_-7770249389423729932moz-cite-prefix">On
                    3/19/17 12:08 PM, Douglas Katzman wrote:<br>
                  </div>
                  <blockquote type="cite">
                    <div dir="ltr">Apology, I meant would <u>NOT</u>
                      have expected you to know.
                      <div>Very sorry about that typo.</div>
                    </div>
                    <div class="gmail_extra"><br>
                      <div class="gmail_quote">On Sun, Mar 19, 2017 at
                        1:08 PM, Douglas Katzman <span dir="ltr">&lt;<a
                            moz-do-not-send="true"
                            href="mailto:dougk@google.com"
                            target="_blank">dougk@google.com</a>&gt;</span>
                        wrote:<br>
                        <blockquote class="gmail_quote" style="margin:0
                          0 0 .8ex;border-left:1px #ccc
                          solid;padding-left:1ex">
                          <div dir="ltr">As Stas said, you're gonna have
                            a problem due to recursion.
                            <div>Compiling with DEBUG 3 will not let you
                              invoke <span style="font-size:12.8px">(sum
                                999999999 0) due to stack overflow.</span></div>
                            <div><span style="font-size:12.8px">There's
                                a trick that works, which I would have
                                expected you to know.  Try as follows:</span></div>
                            <div><span style="font-size:12.8px"><font
                                  face="monospace, monospace"><br>
                                </font></span></div>
                            <div>
                              <div><span style="font-size:12.8px"><font
                                    face="monospace, monospace">* (defun
                                    sum (n1 n2)</font></span></div>
                              <div><span style="font-size:12.8px"><font
                                    face="monospace, monospace"> 
                                    (declare (optimize (debug \
2)))</font></span></div>  <div><span style="font-size:12.8px"><font
                                    face="monospace, monospace">  (if
                                    (zerop n1) n2</font></span></div>
                              <div><span style="font-size:12.8px"><font
                                    face="monospace, monospace">   
                                    (locally</font></span></div>
                              <div><span style="font-size:12.8px"><font
                                    face="monospace, monospace">   
                                     (declare (optimize (debug \
3)))</font></span></div>  <div><span style="font-size:12.8px"><font
                                    face="monospace, monospace">   
                                     (sum (1- n1) (1+ n2)))))</font></span></div>
                              <div><span style="font-size:12.8px"><font
                                    face="monospace, \
monospace">SUM</font></span></div>  <div><span style="font-size:12.8px"><font
                                    face="monospace, monospace"><br>
                                  </font></span></div>
                              <div><span style="font-size:12.8px"><font
                                    face="monospace, monospace">*
                                    (step(sum 9999999 0))</font></span></div>
                              <div><span style="font-size:12.8px"><font
                                    face="monospace, monospace">(step(sum
                                    9999999 0))</font></span></div>
                              <div><span style="font-size:12.8px"><font
                                    face="monospace, monospace">;
                                    Evaluating call:</font></span></div>
                              <div><span style="font-size:12.8px"><font
                                    face="monospace, monospace">;   (-
                                    N1 1)</font></span></div>
                              <div><span style="font-size:12.8px"><font
                                    face="monospace, monospace">; With
                                    unknown arguments</font></span></div>
                              <div><span style="font-size:12.8px"><font
                                    face="monospace, monospace"><br>
                                  </font></span></div>
                              <div><span style="font-size:12.8px"><font
                                    face="monospace, monospace">0] \
step</font></span></div>  <div><span style="font-size:12.8px"><font
                                    face="monospace, \
monospace">step</font></span></div>  <div><span style="font-size:12.8px"><font
                                    face="monospace, monospace">;
                                    Evaluating call:</font></span></div>
                              <div><span style="font-size:12.8px"><font
                                    face="monospace, monospace">;   (+
                                    N2 1)</font></span></div>
                              <div><span style="font-size:12.8px"><font
                                    face="monospace, monospace">; With
                                    unknown arguments</font></span></div>
                              <div><span style="font-size:12.8px"><font
                                    face="monospace, monospace"><br>
                                  </font></span></div>
                              <div><span style="font-size:12.8px"><font
                                    face="monospace, monospace">0] \
step</font></span></div>  <div><span style="font-size:12.8px"><font
                                    face="monospace, \
monospace">step</font></span></div>  <div><span style="font-size:12.8px"><font
                                    face="monospace, monospace">;
                                    Evaluating call:</font></span></div>
                              <div><span style="font-size:12.8px"><font
                                    face="monospace, monospace">;   (SUM
                                    (1- N1) (1+ N2))</font></span></div>
                              <div><span style="font-size:12.8px"><font
                                    face="monospace, monospace">; With
                                    arguments:</font></span></div>
                              <div><span style="font-size:12.8px"><font
                                    face="monospace, monospace">;  
                                    9999998</font></span></div>
                              <div><span style="font-size:12.8px"><font
                                    face="monospace, monospace">;   \
1</font></span></div>  <div><span style="font-size:12.8px"><font
                                    face="monospace, monospace"><br>
                                  </font></span></div>
                              <div><span style="font-size:12.8px"><font
                                    face="monospace, monospace">1] \
step</font></span></div>  <div><span style="font-size:12.8px"><font
                                    face="monospace, \
monospace">step</font></span></div>  <div><span style="font-size:12.8px"><font
                                    face="monospace, monospace">;
                                    Evaluating call:</font></span></div>
                              <div><span style="font-size:12.8px"><font
                                    face="monospace, monospace">;   (-
                                    N1 1)</font></span></div>
                              <div><span style="font-size:12.8px"><font
                                    face="monospace, monospace">; With
                                    unknown arguments</font></span></div>
                              <div><span style="font-size:12.8px"><font
                                    face="monospace, monospace"><br>
                                  </font></span></div>
                              <div><span style="font-size:12.8px"><font
                                    face="monospace, monospace">0] \
:l</font></span></div>  <div><span style="font-size:12.8px"><font
                                    face="monospace, \
monospace">:l</font></span></div>  <div><span style="font-size:12.8px"><font
                                    face="monospace, monospace">N1  =
                                     9999998</font></span></div>
                              <div><span style="font-size:12.8px"><font
                                    face="monospace, monospace">N2  =  \
1</font></span></div>  <div style="font-size:12.8px"><br>
                              </div>
                            </div>
                          </div>
                          <div class="m_-7770249389423729932HOEnZb">
                            <div class="m_-7770249389423729932h5">
                              <div class="gmail_extra"><br>
                                <div class="gmail_quote">On Sun, Mar 19,
                                  2017 at 1:05 PM, Will Senn <span
                                    dir="ltr">&lt;<a
                                      moz-do-not-send="true"
                                      href="mailto:will.senn@gmail.com"
                                      \
target="_blank">will.senn@gmail.com</a>&gt;</span>  wrote:<br>
                                  <blockquote class="gmail_quote"
                                    style="margin:0 0 0
                                    .8ex;border-left:1px #ccc
                                    solid;padding-left:1ex">
                                    <div bgcolor="#FFFFFF"
                                      text="#000000">
                                      <p>Hmm. Help says that this will
                                        work, but as I explained below,
                                        I haven't been able to see it
                                        work. Can you provide an
                                        example?<br>
                                      </p>
                                      <div>
                                        <div
                                          \
class="m_-7770249389423729932m_-630602851891091596h5">  <br>
                                          <div
class="m_-7770249389423729932m_-630602851891091596m_-9075327987872350850moz-cite-prefix">On
  3/19/17 12:01 PM, Stas
                                            Boukarev wrote:<br>
                                          </div>
                                          <blockquote type="cite">
                                            <div dir="ltr">Actually, you
                                              can start stepping from
                                              the debugger, using START.
                                              <div>I just typed HELP and
                                                found that out...</div>
                                            </div>
                                            <div class="gmail_extra"><br>
                                              <div class="gmail_quote">On
                                                Sun, Mar 19, 2017 at
                                                7:57 PM, Stas Boukarev <span
                                                  dir="ltr">&lt;<a
                                                    moz-do-not-send="true"
href="mailto:stassats@gmail.com" target="_blank">stassats@gmail.com</a>&gt;</span>
                                                wrote:<br>
                                                <blockquote
                                                  class="gmail_quote"
                                                  style="margin:0 0 0
                                                  .8ex;border-left:1px
                                                  #ccc
                                                  solid;padding-left:1ex">
                                                  <div dir="ltr">You
                                                    can't step from the
                                                    debugger, you have
                                                    to call your
                                                    function with
                                                    stepping.
                                                    <div>And it has to
                                                      be compiled with
                                                      debug 3.</div>
                                                    <div>And using
                                                      INLINE is a good
                                                      way to defeat
                                                      stepping, and
                                                      inlining of
                                                      recursive
                                                      functions isn't
                                                      going to end well.</div>
                                                  </div>
                                                  <div
                                                    class="gmail_extra">
                                                    <div>
                                                      <div
class="m_-7770249389423729932m_-630602851891091596m_-9075327987872350850h5"><br>
                                                        <div
                                                          class="gmail_quote">On
                                                          Sun, Mar 19,
                                                          2017 at 7:43
                                                          PM, Will Senn
                                                          <span
                                                          dir="ltr">&lt;<a
moz-do-not-send="true" href="mailto:will.senn@gmail.com" \
target="_blank">will.senn@gmail.com</a>&gt;</span>  wrote:<br>
                                                          <blockquote
                                                          class="gmail_quote"
style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
                                                          <br>
                                                          I've asked
                                                          about this on
                                                          the irc
                                                          channel, but
                                                          didn't get a
                                                          satisfactory<br>
                                                          response, so I
                                                          thought I
                                                          would ask
                                                          y'all. I am
                                                          trying to
                                                          understand and<br>
                                                          use debugging
                                                          with SBCL. It
                                                          isn't going
                                                          swimmingly.
                                                          Here is the
                                                          scenario...<br>
                                                          <br>
                                                          Given the
                                                          following
                                                          function:<br>
                                                          <br>
                                                          (defun sum (n1
                                                          n2)<br>
                                                            (if (zerop
                                                          n1) n2<br>
                                                                (sum (1-
                                                          n1) (1+ n2))))<br>
                                                          <br>
                                                          And the call:<br>
                                                          (sum 999999999
                                                          0)<br>
                                                          <br>
                                                          This takes a
                                                          while to
                                                          execute. So, I
                                                          hit C-c and
                                                          enter the
                                                          debugger. If<br>
                                                          it breaks in
                                                          my code, I can
                                                          then display
                                                          the values of
                                                          n1 and n2 and<br>
                                                          continue the
                                                          program,
                                                          breaking,
                                                          evaluating,
                                                          and continuing
                                                          as desired.<br>
                                                          What I really
                                                          want to do is
                                                          single step
                                                          through the
                                                          code
                                                          evaluating<br>
                                                          things as I do
                                                          so. Two
                                                          problems arise
                                                          in this, 1. I
                                                          can't seem to
                                                          break<br>
                                                          into my code
                                                          predictably.
                                                          2. I can't
                                                          seem to cause
                                                          the single
                                                          step<br>
                                                          functionality
                                                          to be enabled.<br>
                                                          <br>
                                                          Just FYI, I
                                                          also tried
                                                          adding inline
                                                          and debug
                                                          declarations
                                                          to my code<br>
                                                          (and I varied
                                                          the debug
                                                          level from 0
                                                          to 3):<br>
                                                          <br>
                                                          (defun sum (n1
                                                          n2)<br>
                                                            (declare
                                                          (inline sum))<br>
                                                            (declare
                                                          (optimize
                                                          (debug 1)))<br>
                                                            (if (zerop
                                                          n1) n2<br>
                                                                (sum (1-
                                                          n1) (1+ n2))))<br>
                                                          <br>
                                                          By way of
                                                          background, my
                                                          experience
                                                          with debuggers
                                                          is in C and
                                                          languages<br>
                                                          that are
                                                          similar. In
                                                          these
                                                          languages, you
                                                          tell the
                                                          debugger to
                                                          break at<br>
                                                          main (or the
                                                          first line of
                                                          main, or at a
                                                          breakpoint)
                                                          and then can
                                                          step<br>
                                                          into, over and
                                                          out of
                                                          function
                                                          calls. In
                                                          those
                                                          languages, you
                                                          can also<br>
                                                          break on a
                                                          signal (such
                                                          as C-c) as
                                                          well as near
                                                          limitless
                                                          number of<br>
                                                          other
                                                          conditions. I
                                                          am not looking
                                                          for the same
                                                          level of
                                                          support, but I<br>
                                                          would like to
                                                          be able to
                                                          predictably
                                                          break into my
                                                          running code
                                                          and be<br>
                                                          able to "step"
                                                          through it.<br>
                                                          <br>
                                                          I've read the
                                                          relevant
                                                          sections of
                                                          the manual,
                                                          but they are
                                                          not really<br>
                                                          that clear on
                                                          these points.
                                                          I've tried
                                                          using START,
                                                          but it either
                                                          just<br>
                                                          continues the
                                                          program or
                                                          says it's not
                                                          possible to
                                                          continue (if
                                                          there's<br>
                                                          a fatal bug),
                                                          so STEP always
                                                          says - Not
                                                          currently
                                                          single-stepping.
                                                          (Use<br>
                                                          START to
                                                          activate the
                                                          single-stepper).
                                                          I have used
                                                          BACKTRACE when
                                                          the<br>
                                                          debugger stops
                                                          outside of my
                                                          code, but
                                                          using DOWN and
                                                          UP don't seem
                                                          to<br>
                                                          get me to a
                                                          place in my
                                                          code where I
                                                          can evaluate
                                                          N1 and N2,
                                                          like I can<br>
                                                          when it breaks
                                                          inside my
                                                          code. Here's a
                                                          bit of a debug
                                                          session<br>
                                                          illustrating
                                                          the point,
                                                          followed by my
                                                          questions, I
                                                          apologize in
                                                          advance<br>
                                                          for the length
                                                          of this
                                                          discussion,
                                                          but wasn't
                                                          sure what was
                                                          critically<br>
                                                          important vs
                                                          cruft:<br>
                                                          <br>
                                                          ;; C-c to
                                                          enter the
                                                          debugger<br>
                                                          debugger
                                                          invoked on a
                                                          \
SB-SYS:INTERACTIVE-INTERRUPT  in thread<br>
                                                          #&lt;THREAD
                                                          "main thread"
                                                          RUNNING
                                                          {100216E5B3}&gt;:<br>
                                                            Interactive
                                                          interrupt at
                                                          #x200002B2.<br>
                                                          <br>
                                                          Type HELP for
                                                          debugger help,
                                                          or
                                                          (SB-EXT:EXIT)
                                                          to exit from
                                                          SBCL.<br>
                                                          <br>
                                                          restarts
                                                          (invokable by
                                                          number or by
                                                          possibly-abbreviated
                                                          name):<br>
                                                            0:
                                                          [CONTINUE]
                                                          Return from
                                                          SB-UNIX:SIGINT.<br>
                                                            1: [ABORT 
                                                           ] Exit
                                                          debugger,
                                                          returning to
                                                          top level.<br>
                                                          <br>
(SB-VM::GENERIC-+)<br>
                                                          <br>
                                                          ;; well, it's
                                                          not my code<br>
                                                          0] backtrace<br>
                                                          <br>
                                                          Backtrace for:
#&lt;SB-THREAD:THREAD "main thread" RUNNING {100216E5B3}&gt;<br>
                                                          0:
                                                          (SB-VM::GENERIC-+)<br>
                                                          1:
                                                          \
(SB-INT:SIMPLE-EVAL-IN-LEXENV  (SUM 999999999
                                                          0)
                                                          #&lt;NULL-LEXENV&gt;)<br>
                                                          2: (EVAL (SUM
                                                          999999999 0))<br>
                                                          3:
                                                          (INTERACTIVE-EVAL
                                                          (SUM 999999999
                                                          0) :EVAL NIL)<br>
                                                          4:
                                                          (SB-IMPL::REPL-FUN
                                                          NIL)<br>
                                                          5: ((LAMBDA
                                                          NIL :IN
                                                          \
SB-IMPL::TOPLEVEL-REPL))<br>  6:
                                                          \
(SB-IMPL::%WITH-REBOUND-IO-SYN<wbr>TAX  #&lt;CLOSURE
                                                          (LAMBDA NIL
                                                          :IN<br>
SB-IMPL::TOPLEVEL-REPL) {10027DA9EB}&gt;)<br>
                                                          7:
                                                          (SB-IMPL::TOPLEVEL-REPL
                                                          NIL)<br>
                                                          8:
                                                          \
(SB-IMPL::TOPLEVEL-INIT)<br>  9: ((FLET
                                                          \
#:WITHOUT-INTERRUPTS-BODY-78  :IN
                                                          SAVE-LISP-AND-DIE))<br>
                                                          10: ((LABELS
                                                          SB-IMPL::RESTART-LISP
                                                          :IN
                                                          SAVE-LISP-AND-DIE))<br>
                                                          <br>
                                                          ;; navigate to
                                                          something
                                                          looking like
                                                          my code<br>
                                                          0] d 2<br>
(SB-INT:SIMPLE-EVAL-IN-LEXENV (SUM 999999999 0) #&lt;NULL-LEXENV&gt;)<br>
                                                          1] n1<br>
                                                          <br>
                                                          ;<br>
                                                          ; caught
                                                          WARNING:<br>
                                                          ;   undefined
                                                          variable: N1<br>
                                                          ;<br>
                                                          ; compilation
                                                          unit finished<br>
                                                          ;   Undefined
                                                          variable:<br>
                                                          ;     N1<br>
                                                          ;   caught 1
                                                          WARNING
                                                          condition<br>
                                                          <br>
                                                          debugger
                                                          invoked on a
                                                          UNBOUND-VARIABLE
                                                          in thread<br>
                                                          #&lt;THREAD
                                                          "main thread"
                                                          RUNNING
                                                          {100216E5B3}&gt;:<br>
                                                            The variable
                                                          N1 is unbound.<br>
                                                          <br>
                                                          Type HELP for
                                                          debugger help,
                                                          or
                                                          (SB-EXT:EXIT)
                                                          to exit from
                                                          SBCL.<br>
                                                          <br>
                                                          restarts
                                                          (invokable by
                                                          number or by
                                                          possibly-abbreviated
                                                          name):<br>
                                                            0: [ABORT 
                                                           ] Reduce
                                                          debugger level
                                                          (to debug
                                                          level 1).<br>
                                                            1:
                                                          [CONTINUE]
                                                          Return from
                                                          SB-UNIX:SIGINT.<br>
                                                            2:         
                                                            Exit
                                                          debugger,
                                                          returning to
                                                          top level.<br>
                                                          <br>
                                                          ((LAMBDA
                                                          (#:G458))
                                                          #&lt;unused
                                                          argument&gt;)<br>
                                                             source:
                                                          (PROGN N1)<br>
                                                          0[2] 0<br>
                                                          <br>
                                                          1] backtrace<br>
                                                          <br>
                                                          Backtrace for:
#&lt;SB-THREAD:THREAD "main thread" RUNNING {100216E5B3}&gt;<br>
                                                          0:
                                                          \
(SB-INT:SIMPLE-EVAL-IN-LEXENV  (SUM 999999999
                                                          0)
                                                          #&lt;NULL-LEXENV&gt;)<br>
                                                          1: (EVAL (SUM
                                                          999999999 0))<br>
                                                          2:
                                                          (INTERACTIVE-EVAL
                                                          (SUM 999999999
                                                          0) :EVAL NIL)<br>
                                                          3:
                                                          (SB-IMPL::REPL-FUN
                                                          NIL)<br>
                                                          4: ((LAMBDA
                                                          NIL :IN
                                                          \
SB-IMPL::TOPLEVEL-REPL))<br>  5:
                                                          \
(SB-IMPL::%WITH-REBOUND-IO-SYN<wbr>TAX  #&lt;CLOSURE
                                                          (LAMBDA NIL
                                                          :IN<br>
SB-IMPL::TOPLEVEL-REPL) {10027DA9EB}&gt;)<br>
                                                          6:
                                                          (SB-IMPL::TOPLEVEL-REPL
                                                          NIL)<br>
                                                          7:
                                                          \
(SB-IMPL::TOPLEVEL-INIT)<br>  8: ((FLET
                                                          \
#:WITHOUT-INTERRUPTS-BODY-78  :IN
                                                          SAVE-LISP-AND-DIE))<br>
                                                          9: ((LABELS
                                                          SB-IMPL::RESTART-LISP
                                                          :IN
                                                          SAVE-LISP-AND-DIE))<br>
                                                          <br>
                                                          ;; maybe the
                                                          next line is
                                                          my code?<br>
                                                          <br>
                                                          1] d<br>
                                                          (EVAL (SUM
                                                          999999999 0))<br>
                                                          2] n1<br>
                                                          <br>
                                                          ;<br>
                                                          ; caught
                                                          WARNING:<br>
                                                          ;   undefined
                                                          variable: N1<br>
                                                          ;<br>
                                                          ; compilation
                                                          unit finished<br>
                                                          ;   Undefined
                                                          variable:<br>
                                                          ;     N1<br>
                                                          ;   caught 1
                                                          WARNING
                                                          condition<br>
                                                          <br>
                                                          debugger
                                                          invoked on a
                                                          UNBOUND-VARIABLE
                                                          in thread<br>
                                                          #&lt;THREAD
                                                          "main thread"
                                                          RUNNING
                                                          {100216E5B3}&gt;:<br>
                                                            The variable
                                                          N1 is unbound.<br>
                                                          <br>
                                                          Type HELP for
                                                          debugger help,
                                                          or
                                                          (SB-EXT:EXIT)
                                                          to exit from
                                                          SBCL.<br>
                                                          <br>
                                                          restarts
                                                          (invokable by
                                                          number or by
                                                          possibly-abbreviated
                                                          name):<br>
                                                            0: [ABORT 
                                                           ] Reduce
                                                          debugger level
                                                          (to debug
                                                          level 1).<br>
                                                            1:
                                                          [CONTINUE]
                                                          Return from
                                                          SB-UNIX:SIGINT.<br>
                                                            2:         
                                                            Exit
                                                          debugger,
                                                          returning to
                                                          top level.<br>
                                                          <br>
                                                          ((LAMBDA
                                                          (#:G459))
                                                          #&lt;unused
                                                          argument&gt;)<br>
                                                             source:
                                                          (PROGN N1)<br>
                                                          0[2] 0<br>
                                                          <br>
                                                          <br>
                                                          ;; or the next
                                                          line?<br>
                                                          2] d<br>
(INTERACTIVE-EVAL (SUM 999999999 0) :EVAL NIL)<br>
                                                          3] n1<br>
                                                          <br>
                                                          ;<br>
                                                          ; caught
                                                          WARNING:<br>
                                                          ;   undefined
                                                          variable: N1<br>
                                                          ;<br>
                                                          ; compilation
                                                          unit finished<br>
                                                          ;   Undefined
                                                          variable:<br>
                                                          ;     N1<br>
                                                          ;   caught 1
                                                          WARNING
                                                          condition<br>
                                                          <br>
                                                          debugger
                                                          invoked on a
                                                          UNBOUND-VARIABLE
                                                          in thread<br>
                                                          #&lt;THREAD
                                                          "main thread"
                                                          RUNNING
                                                          {100216E5B3}&gt;:<br>
                                                            The variable
                                                          N1 is unbound.<br>
                                                          <br>
                                                          Type HELP for
                                                          debugger help,
                                                          or
                                                          (SB-EXT:EXIT)
                                                          to exit from
                                                          SBCL.<br>
                                                          <br>
                                                          restarts
                                                          (invokable by
                                                          number or by
                                                          possibly-abbreviated
                                                          name):<br>
                                                            0: [ABORT 
                                                           ] Reduce
                                                          debugger level
                                                          (to debug
                                                          level 1).<br>
                                                            1:
                                                          [CONTINUE]
                                                          Return from
                                                          SB-UNIX:SIGINT.<br>
                                                            2:         
                                                            Exit
                                                          debugger,
                                                          returning to
                                                          top level.<br>
                                                          <br>
                                                          ((LAMBDA
                                                          (#:G460))
                                                          #&lt;unused
                                                          argument&gt;)<br>
                                                             source:
                                                          (PROGN N1)<br>
                                                          0[2] 0<br>
                                                          <br>
                                                          ;; hmm, the
                                                          rest doesn't
                                                          look promising
                                                          at all<br>
                                                          3] d<br>
(SB-IMPL::REPL-FUN NIL)<br>
                                                          4] backtrace<br>
                                                          <br>
                                                          Backtrace for:
#&lt;SB-THREAD:THREAD "main thread" RUNNING {100216E5B3}&gt;<br>
                                                          0:
                                                          (SB-IMPL::REPL-FUN
                                                          NIL)<br>
                                                          1: ((LAMBDA
                                                          NIL :IN
                                                          \
SB-IMPL::TOPLEVEL-REPL))<br>  2:
                                                          \
(SB-IMPL::%WITH-REBOUND-IO-SYN<wbr>TAX  #&lt;CLOSURE
                                                          (LAMBDA NIL
                                                          :IN<br>
SB-IMPL::TOPLEVEL-REPL) {10027DA9EB}&gt;)<br>
                                                          3:
                                                          (SB-IMPL::TOPLEVEL-REPL
                                                          NIL)<br>
                                                          4:
                                                          \
(SB-IMPL::TOPLEVEL-INIT)<br>  5: ((FLET
                                                          \
#:WITHOUT-INTERRUPTS-BODY-78  :IN
                                                          SAVE-LISP-AND-DIE))<br>
                                                          6: ((LABELS
                                                          SB-IMPL::RESTART-LISP
                                                          :IN
                                                          SAVE-LISP-AND-DIE))<br>
                                                          <br>
                                                          4] u<br>
(INTERACTIVE-EVAL (SUM 999999999 0) :EVAL NIL)<br>
                                                          3] u<br>
                                                          (EVAL (SUM
                                                          999999999 0))<br>
                                                          2] u<br>
(SB-INT:SIMPLE-EVAL-IN-LEXENV (SUM 999999999 0) #&lt;NULL-LEXENV&gt;)<br>
                                                          1] u<br>
(SB-VM::GENERIC-+)<br>
                                                          0] c<br>
                                                          <br>
                                                          ;; C-c again
                                                          and this time,
                                                          it's my code<br>
                                                          <br>
                                                          debugger
                                                          invoked on a
                                                          \
SB-SYS:INTERACTIVE-INTERRUPT  in thread<br>
                                                          #&lt;THREAD
                                                          "main thread"
                                                          RUNNING
                                                          {100216E5B3}&gt;:<br>
                                                            Interactive
                                                          interrupt at
                                                          #x1002472BAA.<br>
                                                          <br>
                                                          Type HELP for
                                                          debugger help,
                                                          or
                                                          (SB-EXT:EXIT)
                                                          to exit from
                                                          SBCL.<br>
                                                          <br>
                                                          restarts
                                                          (invokable by
                                                          number or by
                                                          possibly-abbreviated
                                                          name):<br>
                                                            0:
                                                          [CONTINUE]
                                                          Return from
                                                          SB-UNIX:SIGINT.<br>
                                                            1: [ABORT 
                                                           ] Exit
                                                          debugger,
                                                          returning to
                                                          top level.<br>
                                                          <br>
                                                          (SUM 70277999
                                                          929722000)<br>
                                                          unknown
                                                          location:
                                                          using block
                                                          start<br>
                                                          <br>
                                                             source:
                                                          (SUM (1- N1)
                                                          (1+ N2))<br>
                                                          0] n1<br>
                                                          <br>
                                                          70277999<br>
                                                          0]<br>
                                                          <br>
                                                          Here are my
                                                          questions:<br>
                                                          1. Is it
                                                          possible to
                                                          set a
                                                          breakpoint in
                                                          the code(say
                                                          at the first
                                                          line)?<br>
                                                          2. Is it
                                                          possible to
                                                          navigate back
                                                          into the
                                                          function
                                                          source code,
                                                          if a<br>
                                                          C-c stops the
                                                          environment
                                                          outside of the
                                                          code (say,
                                                          (SB-VM::GENERIC-+))?<br>
                                                          3. How does
                                                          one single
                                                          step the
                                                          debugger?<br>
                                                          <br>
                                                          Thanks,<br>
                                                          <br>
                                                          Will<br>
                                                          <span
class="m_-7770249389423729932m_-630602851891091596m_-9075327987872350850m_3721122889969285884HOEnZb"><font
 color="#888888"><br>
                                                          --<br>
                                                          GPG
                                                          Fingerprint:
                                                          208A 38D6 D1BF
                                                          5A6B 7F4D 
                                                          CC0D 21CB 91B3
                                                          21E5 671F<br>
                                                          <br>
                                                          <br>
                                                          <br>
------------------------------<wbr>------------------------------<wbr>------------------<br>
  Check out the
                                                          vibrant tech
                                                          community on
                                                          one of the
                                                          world's most<br>
                                                          engaging tech
                                                          sites,
                                                          Slashdot.org!
                                                          <a
                                                          moz-do-not-send="true"
href="http://sdm.link/slashdot" rel="noreferrer" \
target="_blank">http://sdm.link/slashdot</a><br> \
______________________________<wbr>_________________<br>  Sbcl-help
                                                          mailing list<br>
                                                          <a
                                                          moz-do-not-send="true"
href="mailto:Sbcl-help@lists.sourceforge.net" \
target="_blank">Sbcl-help@lists.sourceforge.ne<wbr>t</a><br>  <a
                                                          moz-do-not-send="true"
href="https://lists.sourceforge.net/lists/listinfo/sbcl-help"
                                                          rel="noreferrer"
target="_blank">https://lists.sourceforge.net/<wbr>lists/listinfo/sbcl-help</a><br>
                                                          </font></span></blockquote>
                                                        </div>
                                                        <br>
                                                        <br clear="all">
                                                        <div><br>
                                                        </div>
                                                      </div>
                                                    </div>
                                                    <span
class="m_-7770249389423729932m_-630602851891091596m_-9075327987872350850HOEnZb"><font
                                                        color="#888888">--
                                                        <br>
                                                        <div
class="m_-7770249389423729932m_-630602851891091596m_-9075327987872350850m_3721122889969285884gmail_signature"
 data-smartmail="gmail_signature">With best regards, Stas.</div>
                                                      </font></span></div>
                                                </blockquote>
                                              </div>
                                              <br>
                                              <br clear="all">
                                              <div><br>
                                              </div>
                                              -- <br>
                                              <div
class="m_-7770249389423729932m_-630602851891091596m_-9075327987872350850gmail_signature"
 data-smartmail="gmail_signature">With best regards, Stas.</div>
                                            </div>
                                          </blockquote>
                                          <br>
                                          <pre \
class="m_-7770249389423729932m_-630602851891091596m_-9075327987872350850moz-signature" \
cols="72">--  GPG Fingerprint: 208A 38D6 D1BF 5A6B 7F4D  CC0D 21CB 91B3 21E5 \
671F</pre>  </div>
                                      </div>
                                    </div>
                                    <br>
                                    \
------------------------------<wbr>------------------------------<wbr>------------------<br>
  Check out the vibrant tech community
                                    on one of the world's most<br>
                                    engaging tech sites, Slashdot.org! <a
                                      moz-do-not-send="true"
                                      href="http://sdm.link/slashdot"
                                      rel="noreferrer" \
                target="_blank">http://sdm.link/slashdot</a><br>
                                    \
______________________________<wbr>_________________<br>  Sbcl-help mailing list<br>
                                    <a moz-do-not-send="true"
                                      href="mailto:Sbcl-help@lists.sourceforge.net"
                                      \
target="_blank">Sbcl-help@lists.sourceforge.ne<wbr>t</a><br>  <a \
                moz-do-not-send="true"
                                      \
                href="https://lists.sourceforge.net/lists/listinfo/sbcl-help"
                                      rel="noreferrer" \
target="_blank">https://lists.sourceforge.net/<wbr>lists/listinfo/sbcl-help</a><br>  \
<br>  </blockquote>
                                </div>
                                <br>
                              </div>
                            </div>
                          </div>
                        </blockquote>
                      </div>
                      <br>
                    </div>
                  </blockquote>
                  <br>
                  <pre class="m_-7770249389423729932moz-signature" cols="72">-- 
GPG Fingerprint: 208A 38D6 D1BF 5A6B 7F4D  CC0D 21CB 91B3 21E5 671F</pre>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <div><br>
        </div>
        -- <br>
        <div class="gmail_signature" data-smartmail="gmail_signature">With
          best regards, Stas.</div>
      </div>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
GPG Fingerprint: 208A 38D6 D1BF 5A6B 7F4D  CC0D 21CB 91B3 21E5 671F</pre>
  </body>
</html>



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

_______________________________________________
Sbcl-help mailing list
Sbcl-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-help


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic