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.

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


Back to the top