Re: recent commit breaks multi-module debugging

Bill Clementson <[email protected]> Thu, 21 Jun 2007 23:29:12 -0700
Newsgroups gmane.comp.lang.erlang.distel.devel
Message-ID <[email protected]>
Matthias Radestock <[email protected]> writes:

> Bill Clementson <[email protected]> writes:
>
>> The problem is that when a node goes down during debugging and the
>> interpreting state is "on", when you re-connect to the node, you have
>> to turn interpreting "off".
>
> Why? When the node goes down, the interpreting status is turned off
> automatically by edb-monitor-cleanup.

After re-connecting to the node and reloading the module, the first
time that I press "C-c C-d i", interpreting is toggled "off".

>> So, the first time you press "C-c C-d i", edb-toggle-interpret calls
>> edb-ensure-monitoring which calls edb-monitor-node-change-p which
>> returns nil in the call to edb-monitor-live-p because the edb monitor
>> buffer has been deleted.  So, the "(if (edb-monitor-live-p)" returns
>> nil and edb-start-monitor is called.
>
> Right.
>
>> By clearing out edb-monitor-node when the node goes down, the node is
>> treated (correctly) as a new node that hasn't been debugged previously
>> and edb-interpreted-modules gets updated correctly after the call to
>> edb-start-monitor.
>>
>> Does that make sense? 
>
> No. setting edb-monitor-node to nil in edb-monitor-cleanup should make
> no difference to the above sequence since edb-monitor-node-change-p will
> still return nil, due to edb-monitor-live-p returning nil.

And yet, the first time that I would start up debugging, the trace
buffer would have messages for the module showing that interpreting has
been turned on. After the node was killed and restarted, the trace
buffer would not have these messages (even after pressing "C-c C-d i"
several times). So, there must have been something that was lingering
around and affecting the communication with the node. As I mentioned
in my previous email, this appeared to occur at the point that
edb-start-monitor was called after the connection to the node had been
re-established.

>>> However, I'd still like to know what the *real* cause of the problem
>>> is. It looks like in your setup edb-monitor-live-p is returning t when
>>> it shouldn't, which could easily cause problems elsewhere.
>>
>> No, edb-monitor-live-p was working correctly. Hope my explanation
>> above made sense.
>
> The the value of edb-monitor-node can only have an impact when
> edb-monitor-live-p returns t. Te latter shouldn't (and, you say, indeed
> doesn't) happen after the debugged node went down.
>
> So the only way for your patch to have any effect is if
> edb-monitor-live-p incorrectly returns t instead of nil at some point.

In fact, my patch does have an effect for me in that I can now restart
debugging in distel when I reconnect to a node (even though
edb-monitor-live-p did return the correct value prior to the
patch). As I mentioned in my email, the problem occurs when
edb-start-monitor is called after the node has died and been restarted
and was not a result of edb-monitor-live-p returning an incorrect
value.

Unfortunately, for some reason, you are not able to replicate the
problem that I was experiencing. Perhaps there is some slight
difference in the sequence of commands that you use from what I
use. However, my patch works for me and you agree that it has no
deleterious effects, so I've committed it.

>> I'll commit my patch. Thanks for all your help with this.
>
> You are welcome.

- Bill


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