From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "alin.s" Newsgroups: gmane.emacs.devel Subject: Re: Watchpoints for emacs lisp. Date: Sat, 15 May 2010 06:06:11 -0700 (PDT) Message-ID: <28568286.post@talk.nabble.com> References: <28512483.post@talk.nabble.com> <28523705.post@talk.nabble.com> <28567671.post@talk.nabble.com> <28567697.post@talk.nabble.com> <28567803.post@talk.nabble.com> <28567880.post@talk.nabble.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1273928783 29096 80.91.229.12 (15 May 2010 13:06:23 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 15 May 2010 13:06:23 +0000 (UTC) To: Emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 15 15:06:22 2010 connect(): No such file or directory Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ODH4P-0006kl-Ed for ged-emacs-devel@m.gmane.org; Sat, 15 May 2010 15:06:21 +0200 Original-Received: from localhost ([127.0.0.1]:50020 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ODH4O-00018z-Qo for ged-emacs-devel@m.gmane.org; Sat, 15 May 2010 09:06:20 -0400 Original-Received: from [140.186.70.92] (port=59895 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ODH4I-000187-HN for Emacs-devel@gnu.org; Sat, 15 May 2010 09:06:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ODH4G-00073e-Tj for Emacs-devel@gnu.org; Sat, 15 May 2010 09:06:14 -0400 Original-Received: from kuber.nabble.com ([216.139.236.158]:47297) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ODH4G-00073X-N3 for Emacs-devel@gnu.org; Sat, 15 May 2010 09:06:12 -0400 Original-Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1ODH4F-0006Ha-Iu for Emacs-devel@gnu.org; Sat, 15 May 2010 06:06:11 -0700 In-Reply-To: X-Nabble-From: alinsoar@voila.fr X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:124806 Archived-At: 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.