[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Lisp watchpoints

From: Noam Postavsky
Subject: Re: Lisp watchpoints
Date: Sun, 22 Nov 2015 21:31:53 -0500

On Sun, Nov 22, 2015 at 3:41 PM, Eli Zaretskii <address@hidden> wrote:
> Is it possible to have watchers that don't require a Funcall, or avoid
> exposing the watcher function to Lisp to begin with?  Funcall can GC,
> so the usability of such watchers for internal purposes might be
> limited in some situations.

Yes, avoiding exposure to Lisp is what I had in mind when I said

    We could make `add-variable-watcher' callable only from C, and
    manipulate some internal hash table instead of the symbol's plist. Of
    course this would make it less flexible, but it avoids the whole
    problem of running arbitrary Lisp code for variable-write (and read,
    though I don't plan to implement read watchpoints for now).

But I wasn't aware of the Funcall GC thing.

> How about allowing special, say, integer values for a watcher, which
> will then cause a call to a C function from a table indexed by the
> watcher value?  Or something else to that effect.

That could work.

> Another comment is: do we care about scalability of property lists for
> storing watchers?

I actually tried to use a hashtable first but it didn't work so I
switched to property lists because it's simpler. (I think my problem
with the hashtable was that I missed the note about staticpro).

> The debug command might be more mnemonic (at least for me ;-) if it
> were called 'debug-watch', or maybe 'debug-set-watchpoint'.  A similar
> command for Edebug would also be nice.

Sure, I have no particular attachment to the current names. When I
figure out how to do plain debug properly, I'll look at an Edebug
version. :)

> P.S. We should decide whether we ad this to the emacs-25 branch or to
> master.

Right, so I think the arguments for emacs-25 despite feature freeze would be

- watchpoints would be useful for catching all those bugs we have to
fix before release :)
- fixing a performance regression (I guess? I haven't made any
measurements though)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]