RCS file: /cvs/cnd/gdb/src/org/netbeans/modules/cnd/debugger/gdb/GdbDebugger.java,v retrieving revision 1.49 retrieving revision 1.50 diff -u -r1.49 -r1.50 --- GdbDebugger.java 6 Nov 2007 00:14:59 -0000 1.49 +++ GdbDebugger.java 8 Nov 2007 02:01:37 -0000 1.50 @@ -1538,13 +1538,29 @@ } /** - * Returns list of cached local variables for this debugger. + * Returns list of cached local variables for this debugger. This typically gets + * called from an evaluator thread. If we don't have the type, it should be coming + * on the GdbReaderRP thread so we wait for it. * * @return list of local variables */ @SuppressWarnings("unchecked") public List getLocalVariables() { + assert !(Thread.currentThread().getName().equals("GdbReaderRP")); synchronized (localVariables) { + for (GdbVariable var : localVariables) { + if (var.getType() == null) { + for (int i = 0; i < 40; i++) { + try { + Thread.sleep(100); + } catch (InterruptedException ex) { + } + if (var.getType() != null) { + break; + } + } + } + } return (List) localVariables.clone(); } }