Re: recent commit breaks multi-module debugging

Bill Clementson <[email protected]> Tue, 19 Jun 2007 13:53:36 -0700
Newsgroups gmane.comp.lang.erlang.distel.devel
Message-ID <[email protected]>
Bill Clementson <[email protected]> writes:

> Matthias Radestock <[email protected]> writes:
>
>> I do not understand the rationale behind the following recently
>> committed change:
>>
>> rade@tanto:/usr/local/src/distel$ svn diff -r18 elisp/edb.el         
>> Index: elisp/edb.el
>> ===================================================================
>> --- elisp/edb.el        (revision 18)
>> +++ elisp/edb.el        (working copy)
>> @@ -91,7 +91,9 @@
>>           ((['rex 'interpreted]
>>             (message "Interpreting: %S" module))
>>            (['rex 'uninterpreted]
>> -           (message "Stopped interpreting: %S" module))
>> +           (message "Stopped interpreting: %S" module)
>> +           (if (edb-monitor-live-p) (kill-buffer edb-monitor-buffer))
>> +           (setq edb-interpreted-modules nil))
>>            (['rex ['badrpc reason]]
>>             (message "Failed to interpret-toggle: %S" reason)))))))
>>
>>
>> Why should stopping the interpretation of *one* module kill off the
>> monitor buffer and clear the entire list of interpreted modules?
>
> Hi Matthias,
>
> I submitted the patch. I was encountering a situation where I would be
> debugging a module in a node, would lose the connection to the node,
> and, after re-attaching to the node, would not be able to set
> breakpoints or debug any module. This seems to be something that
> others have experienced in the past as well. (Mats Cronqvist reported
> something similar here:
> http://thread.gmane.org/gmane.comp.lang.erlang.distel.devel/18/focus=27)
> There didn't seem to be any way to "reset" debugging in distel other
> than toggling interactivity so I applied the patch there. However,
> since this causes a problem when you're debugging multiple modules,
> perhaps a better place for the patch would be in the
> erl-choose-nodename function (since, if you're changing the node that
> distel is attached to, it would make sense to kill any existing
> monitor buffer and list of interpreted modules)?

Try the following patch (which reverses my mod to edb.el and makes the
mod in erl-choose-nodename instead) and let me know if it works better
for you.

--
Bill Clementson

Index: elisp/erl-service.el
===================================================================
--- elisp/erl-service.el	(revision 18)
+++ elisp/erl-service.el	(working copy)
@@ -50,7 +50,9 @@
       (error "No node name given"))
     (setq erl-nodename-cache name)
     (setq distel-modeline-node name-string)
-    (force-mode-line-update))
+    (force-mode-line-update)
+    (if (edb-monitor-live-p) (kill-buffer edb-monitor-buffer))
+    (setq edb-interpreted-modules nil))
   erl-nodename-cache)
 
 ;;;;; Call MFA lookup
Index: elisp/edb.el
===================================================================
--- elisp/edb.el	(revision 19)
+++ elisp/edb.el	(working copy)
@@ -91,9 +91,7 @@
 	  ((['rex 'interpreted]
 	    (message "Interpreting: %S" module))
 	   (['rex 'uninterpreted]
-	    (message "Stopped interpreting: %S" module)
-	    (if (edb-monitor-live-p) (kill-buffer edb-monitor-buffer))
-	    (setq edb-interpreted-modules nil))
+	    (message "Stopped interpreting: %S" module))
 	   (['rex ['badrpc reason]]
 	    (message "Failed to interpret-toggle: %S" reason)))))))
 


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/