unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Neil Jerram <neil@ossau.uklinux.net>
To: Guile Users <guile-user@gnu.org>
Subject: Re: Anyone relying on "break-at" breakpoints?
Date: Sun, 28 Oct 2007 21:24:40 +0000	[thread overview]
Message-ID: <87y7dngcfb.fsf@ossau.uklinux.net> (raw)
In-Reply-To: <87k5p7hsev.fsf@ossau.uklinux.net> (Neil Jerram's message of "Sun, 28 Oct 2007 20:54:00 +0000")

Ludovic wrote:

> Hi,
>
> Neil Jerram <address@hidden> writes:
>
>> There are (at least) three possibly interesting requirements that this
>> doesn't cover.  Right now I'm still wondering about these, so ideas
>> are welcome.
>>
>> 1. The Guile application is going to load a file that contains
>>    directly-executed code as well as procedure definitions, and you
>>    want to set a breakpoint (ahead of time) on some of the
>>    directly-executed code.
>
> But this ("directly-executed" code) is bad style anyway.  ;-)

Well there has to be some directly executed code somewhere, or else
nothing will happen.  But I agree that it might be reasonable to
expect any lexically non-trivial block of code to be defined as a
procedure first.

In that case, the requirement is for procedure-based breakpoints to
become effective before the procedure is called, even when called from
the same file as that that defined the procedure.

>> 2. You want to set a breakpoint somewhere in the middle of a complex
>>    procedure, not right at the beginning of it.
>>
>> 3. You're using Guile interactively (e.g. using the GDS interface in
>>    Emacs) and want to step through the evaluation of some code (which
>>    isn't a procedure definition).
>>
>> I think your question was aiming at (2) - is that right?
>
> Exactly.

Well I haven't tried this at all yet, but I'm wondering about a form
of specification like

(break-in <proc-name> '(let if string-append))

- which would mean to break at the start of a string-append call that
is lexically within an (if ...), which is itself lexically within a
(let ...).

Something like this might work for internal definitions, too.

> But wasn't `break-at' useful when, e.g., hitting `C-x SPC' in an Emacs
> buffer (GDS)?  Or probably it works differently because the code is not
> loaded into the GDS "server" from the file you're editing in Emacs,
> right?

Yes, it certainly was useful in the case where you're evaluating some
scratch code and want to step through it (e.g. the appended example
from the GDS tutorial), so something like that needs to carry on
working.

I have two possibilities in mind for this.  (1) is for C-x SPC to
appear to work exactly as it has in the past, but not actually to send
a `break-at' instruction to Guile.  Instead, the positions of the
breakpoints are sent along with the code to be evaluated, and the
gds-client code sets the 'breakpoint source property in all the right
places, then evaluates the code.  (2) is to enhance the gds-eval*
function so that a C-u prefix argument will cause them to set the
'breakpoint source property on the start of the code to be evaluated.

Regards,
        Neil


=== from guile-debugging's gds-tutorial.txt ===

;; ** Breakpoints

;; Before evaluating Scheme code from an Emacs buffer, you may want to
;; set some breakpoints in it.  With GDS you can set breakpoints in
;; Scheme code by typing `C-x SPC'.
;;
;; To see how this works, select the second line of the following code
;; (the `(format ...)' line) and type `C-x SPC'.

(for-each (lambda (x)
	    (format #t "~A cubed is ~A\n" x (* x x x)))
	  (iota 6))

;; The two opening parentheses in that line should now be highlighted
;; in red, to show that breakpoints have been set at the start of the
;; `(format ...)' and `(* x x x)' expressions.  Then evaluate the
;; whole for-each expression by typing `C-M-x' ...
;;
;; In the upper half of your Emacs, a buffer appears showing you the
;; Scheme stack.  [...]



_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


  parent reply	other threads:[~2007-10-28 21:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-28 20:54 Anyone relying on "break-at" breakpoints? Neil Jerram
2007-10-28 20:57 ` Neil Jerram
2007-10-28 21:24 ` Neil Jerram [this message]
2007-10-29  8:45   ` Ludovic Courtès
  -- strict thread matches above, loose matches on Subject: below --
2007-10-25 21:14 Neil Jerram
2007-10-26 12:10 ` Ludovic Courtès
2007-10-26 18:26   ` Neil Jerram
2007-10-27  9:33     ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y7dngcfb.fsf@ossau.uklinux.net \
    --to=neil@ossau.uklinux.net \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).