unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Re: Anyone relying on "break-at" breakpoints?
@ 2007-10-28 20:54 Neil Jerram
  2007-10-28 20:57 ` Neil Jerram
  2007-10-28 21:24 ` Neil Jerram
  0 siblings, 2 replies; 8+ messages in thread
From: Neil Jerram @ 2007-10-28 20:54 UTC (permalink / raw)
  To: Guile Users

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.  ;-)

> 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.

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?

Thanks,
Ludovic.



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


^ permalink raw reply	[flat|nested] 8+ messages in thread
* Anyone relying on "break-at" breakpoints?
@ 2007-10-25 21:14 Neil Jerram
  2007-10-26 12:10 ` Ludovic Courtès
  0 siblings, 1 reply; 8+ messages in thread
From: Neil Jerram @ 2007-10-25 21:14 UTC (permalink / raw)
  To: Guile Users

This email pertains to the debugging and breakpoint infrastructure in
Guile CVS, which has so far only been released as part of my
guile-debugging package.  If you've never looked at or used this
infrastructure, you can safely skip the rest of this message.

I've been wrestling for a while with specifying and documenting
exactly how "break-at" breakpoints should behave, and have concluded
that the problem arises from how these breakpoints are defined.
Therefore I'm looking at removing them (in their current form), and
hence this email to check if anyone would be inconvenienced by that.

A break-at breakpoint is defined by a file name, a line number and a
column number, and it means that Guile should break when executing the
code from the named file whose opening parenthesis is at the specified
line and column.  It should work both if the relevant code was loaded
before the breakpoint was defined, and if the code is loaded after the
breakpoint is defined.  In other words, it's the Guile equivalent of
GDB's "break <filename>:<line>" for C.

The trouble is that Guile (unlike C) is an interactive environment.
Someone might write a first version of a function:

(define (my-func . args)
  (let ((a (car args))
        ...)
    ...))

then evaluate and try it, then decide that it works better with an
internal definition:

(define (my-func . args)
  (define (helper arg1)
    ...)
  (let ((a (car args))
        ...)
    ...))

then evaluate the new version, and so on.  Suppose that when trying
out the first version, the coder defined a break-at breakpoint at the
position of the "(let".  Then after the redefinition (and assuming the
current specification and implementation of break-at breakpoints), the
breakpoint would be in the wrong place: it would apply to the
"(define", and would not apply to the "(let" in its new position.

This is a simple example, but there are many possible variations and
complications of it (for example, lambda-constructing code, which has
the consequence that we cannot say that there is only one "correct"
version of the source code at a given time), which make finding a nice
general solution very difficult.

By way of contrast, the other kind of breakpoint ("break-in") does not
suffer from this problem, because it is defined in a way that relates
more persistently to the code (even as the code changes).  A break-in
breakpoint is defined as

  break-in <procedure-name> [<module-or-file-name>]

and means break at the start of that procedure.

It could be argued that break-at breakpoints are fine for the "static"
case - i.e. for debugging a program and not changing it at the same
time - and hence we should keep them for this.  But I'd much rather
develop a better conceptual solution that works equally well for both
the static and interactive cases.

Therefore, I'm planning to simply drop "break-at" breakpoints (and the
associated <location-trap> trap), and then to reconsider the scenarios
for which I thought "break-at" was the solution, to work out better
solutions instead.

If there are scenarios that you (anyone!) are actually using and
relying on, please let me know, so that I can make sure that I have an
alternative solution ready for you.  If you have any questions,
suggestions or concerns about all this, please let me know those too.

Thanks for reading; I hope it all made some kind of sense. :-)

Regards,
        Neil



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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-10-29  8:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).