Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [Dltk-dev] The new async code in DbgpDebuggingEngineCommuncatior does lock everything.

I added option DBGP_ASYNC, by default it is true, for TCLActiveState it is false.
Though we need to think more about it and test different debugging engines.

Regards,
Alex

----- Original Message -----
From: "Johan Compagner" <jcompagner@xxxxxxxxx>
To: "DLTK Developer Discussions" <dltk-dev@xxxxxxxxxxx>
Sent: Tuesday, July 8, 2008 11:03:34 PM GMT +06:00 Almaty, Novosibirsk
Subject: Re: [Dltk-dev] The new async code in DbgpDebuggingEngineCommuncatior does lock everything.


Its not about the property_set or something 

By default we are in waiting in a run state, and if this run state isn't async (continuations commands arent that) 
then when i set a breakpoint after that somewhere and it wants to set the breakpoint 
bang that just hangs because the sync request is then waiting for the run request which is for ever waiting until i hit a breakpoint 

What i did now is making the continuations request/commands all async and then i dont have problems anymore 
But looking at your problem that will reintroduce your bug. 

Maybe we should make the run command a async command? Because it really is an async command nothing should wait on the run 
command because thats a command that can wait for ever 

The problem is that step over and step into and those things can also go into a endless wait (until the next break) when i debug a script 
that then ends. 

So i think the real fix has to be in the TCL ActiveState debugger.. That should just handled multiply command at one time 
i dont think you can fix this at this side. 

johan 



On Tue, Jul 8, 2008 at 5:57 PM, Alexey Panchenko < alex@xxxxxxxxx > wrote: 


Hi Johan, 

I have added wait yesterday, because TCL ActiveState debugger does not support simultaneous commands. 
There was an error that if user quickly presses F5/F6 that command is sent when there is active some of the commands used to update Variables view. Debugger returned the error and the debugger session terminates. 

Looking at http://xdebug.org/docs-dbgp.php#packet-communications I modified the code to send as async only break & status commands. 

Can your describe your situation - what debugger engine do you use and why do you want to send property_set when there is active run? 

If needed we can make waiting optional (I have recently introduced IDebugOptions interface for that purpose) but before that we need to understand the situation thoroughly. 

Regards, 
Alex 




----- Original Message ----- 
From: "Johan Compagner" < jcompagner@xxxxxxxxx > 
To: "DLTK Developer list" < dltk-dev@xxxxxxxxxxx > 
Sent: Tuesday, July 8, 2008 10:21:12 PM GMT +06:00 Almaty, Novosibirsk 
Subject: [Dltk-dev] The new async code in DbgpDebuggingEngineCommuncatior does lock everything. 


I added a view log statements to test this and i see this in the log 


Worker-6:: putting request: run -i 9 in map: {} 
Worker-4:: putting request: property_set -d -1 -n suspendOnEntry -i 10 -- in map: {run -i 9=run -i 9} 
main:: putting request: property_set -d -1 -n suspendOnException -i 11 -- dHJ1ZQ== in map: {run -i 9=run -i 9} 


So run is not an Async() command/action 

But run will wait for every so then there is suddenly 1 activeRequest in that map 
Then 2 other are coming 1 is a worker thread thats then going to wait for ever 
then i place a break point and then the main thread also tries to but something in and then the main threads hangs. 

So i guess the DbgpContinuationCommands must create a async command: 

protected IDbgpStatus execCommand(String command) throws DbgpException { 
return DbgpXmlEntityParser 
.parseStatus(communicate(createAsyncRequest(command))); 
} 

The problem is what is really meant to be an Async request and not? 



if (request.isAsync()) { 
sendRequest(request.toString()); 
packet = receiveResponse(requestId); 
} else { 
final long startTime = DEBUG ? System.currentTimeMillis() : 0; 
System.err.println(Thread.currentThread().getName() 
+ ":: putting request: " + request + " in map: " 
+ activeRequests); 
synchronized (activeRequests) { 
while (!activeRequests.isEmpty()) { 
activeRequests.wait(); 
} 
activeRequests.put(request, request); 
} 
if (DEBUG) { 
final long waited = System.currentTimeMillis() - startTime; 
if (waited > 0) { 
System.out.println("Waited " + waited + " ms"); //$NON-NLS-1$ //$NON-NLS-2$ 
} 
} 
try { 
sendRequest(request.toString()); 
packet = receiveResponse(requestId); 
} finally { 
System.err.println(Thread.currentThread().getName() 
+ ":: removing request: " + request + " from map: " 
+ activeRequests); 

synchronized (activeRequests) { 
activeRequests.remove(request); 
activeRequests.notifyAll(); 
} 
} 
} 


_______________________________________________ 
dltk-dev mailing list 
dltk-dev@xxxxxxxxxxx 
https://dev.eclipse.org/mailman/listinfo/dltk-dev 
_______________________________________________ 
dltk-dev mailing list 
dltk-dev@xxxxxxxxxxx 
https://dev.eclipse.org/mailman/listinfo/dltk-dev 


_______________________________________________
dltk-dev mailing list
dltk-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dltk-dev


Back to the top