emacs-devel
[Top][All Lists]
Advanced

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

Re: Watchpoints for emacs lisp.


From: alin.s
Subject: Re: Watchpoints for emacs lisp.
Date: Sat, 15 May 2010 06:06:11 -0700 (PDT)



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 via email to

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