unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "alin.s" <alinsoar@voila.fr>
To: Emacs-devel@gnu.org
Subject: Re: Watchpoints for emacs lisp.
Date: Sat, 15 May 2010 06:06:11 -0700 (PDT)	[thread overview]
Message-ID: <28568286.post@talk.nabble.com> (raw)
In-Reply-To: <m28w7l49oj.fsf@gmail.com>




Helmut Eller-2 wrote:
> 
> * alin.s [2010-05-15 13:56+0200] writes:
> 
>> Suppose that we have the symbol
>>
>> X = ( 3 . ( 4 . some_cons ) ) 
>>
>> and
>>
>> Y = some_cons.
>>
>> Suppose that I have set the watch bit on X, but not on Y.
>>
>> In these conditions, modifying Y will not stop into the watchpoint of X.
>>
>> That means that setting a watchpoint on a symbol X, should be a recursive
>> operation, id est, setting recursively a :watch: field for all the
>> cons-cells, symbols, strings, etc, which are present in X.
>>
>> That means that we need to insert a watch field in all lisp data
>> strucutures, not only n symbol, etc
>>
>> Is that algorithm right ?
> 
> Can't you use the MMU for this?  Protect the page(s) the watched object
> is on; in the SIGSEGV handler set the QUIT flag and store some info in a
> global place so that the debugger can figure out which object triggered
> the watchpoint.
> 
> Helmut
> 
> 
> 
> 

Probably it works. But GC would call the handler lots of times, and this
might be inconvenient.

I can set the flag :watch to 1 for that objects, and when the handler is
called, it passed the address of the object that generated the segv. it has
just to check the :watch flag first and decides so whether the debugger is
called.

Depending on the data segment, the handler knows whether a string, cons
cell, symbol , etc was modified.

Emacs is possible to run extremely slow with such a solution.

What the other think about it?



-- 
View this message in context: http://old.nabble.com/Watchpoints-for-emacs-lisp.-tp28512483p28568286.html
Sent from the Emacs - Dev mailing list archive at Nabble.com.




  reply	other threads:[~2010-05-15 13:06 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-10 16:28 Watchpoints for emacs lisp alin.s
2010-05-11 11:59 ` Richard Stallman
2010-05-11 12:54   ` alin.s
2010-05-11 13:43     ` Ken Raeburn
2010-05-11 14:10     ` Stefan Monnier
2010-05-11 15:37       ` alin.s
2010-05-15 11:16       ` alin.s
2010-05-15 11:24         ` alin.s
2010-05-15 11:44           ` alin.s
2010-05-15 11:56             ` alin.s
2010-05-15 12:43               ` Helmut Eller
2010-05-15 13:06                 ` alin.s [this message]
2010-05-15 17:48             ` Stefan Monnier
2010-05-16 13:07               ` alin.s
2010-05-16 13:09                 ` Lennart Borgman
2010-05-16 13:42                   ` alin.s
2010-05-16 16:28                     ` Lennart Borgman
2010-05-16 19:46                       ` alin.s
2010-05-16 20:42                 ` Stefan Monnier
2010-05-16 21:10                   ` alin.s
2010-05-17 13:24                     ` Stefan Monnier
2010-05-15 12:15           ` Andreas Schwab
2010-05-15 17:43         ` Stefan Monnier
2010-05-16 13:05           ` alin.s
2010-05-16 15:03             ` Chad Brown
2010-05-16 19:44               ` alin.s
2010-05-16 21:31               ` alin.s
2010-05-16 22:38                 ` alin.s
2010-05-16 23:47                 ` Lennart Borgman
2010-05-16 23:56                   ` alin.s
2010-05-17 15:52                   ` alin.s
2010-05-17 16:09                     ` Lennart Borgman
2010-05-17 16:40                       ` alin.s
2010-05-17 17:00                         ` Lennart Borgman
2010-05-17 17:29                           ` alin.s
2010-05-17 18:39                             ` alin.s
2010-05-17 18:41                               ` alin.s
2010-05-17 20:22                                 ` alin.s
2010-05-17 18:59                               ` Eli Zaretskii
2010-05-17 19:04                                 ` Lennart Borgman
2010-05-17 19:00                               ` Chad Brown
2010-05-18  8:22                                 ` Adrian Robert
2010-05-18 19:46                                   ` Chad Brown
2010-05-18 22:38                                     ` Andreas Schwab
2010-05-24 14:36                                       ` alin.s
2010-05-24 14:46                                         ` Ken Raeburn
2010-05-26  8:27                                           ` alin.s
2010-05-24 15:12                                         ` alin.s
2010-05-24 17:36                                           ` Jan Djärv
2010-05-24 17:47                                           ` Stefan Monnier
2010-05-26 10:38                                             ` alin.s
2010-05-26 13:46                                               ` Stefan Monnier
2010-05-26 16:49                                                 ` alin.s
2010-05-27 14:08                                                   ` alin.s
2010-05-27 22:05                                                     ` Andreas Schwab
2010-05-28 20:09                                                       ` alin.s
2010-07-06 12:26                                                         ` alin.s
2010-08-10 11:00                                                           ` Stefan Monnier
2010-05-29  4:25                                                       ` tomas
2010-05-19  4:30                                   ` Ken Raeburn
2010-05-19  6:20                                     ` Adrian Robert
2010-05-17 19:56                               ` Andreas Schwab
  -- strict thread matches above, loose matches on Subject: below --
2010-05-11 13:54 A. Soare
2010-05-12  1:53 ` Ken Raeburn
2010-05-12  2:04 ` Stephen J. Turnbull

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/emacs/

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

  git send-email \
    --in-reply-to=28568286.post@talk.nabble.com \
    --to=alinsoar@voila.fr \
    --cc=Emacs-devel@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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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