mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
Bug 335235 - Deadlock when pressing trace var button in Trace Control view when GDB is running
This commit is contained in:
parent
9822a07fe2
commit
5af284cece
4 changed files with 28 additions and 20 deletions
|
@ -14,10 +14,13 @@ import java.text.SimpleDateFormat;
|
|||
import java.util.Calendar;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.RejectedExecutionException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
import org.eclipse.cdt.dsf.concurrent.DataRequestMonitor;
|
||||
import org.eclipse.cdt.dsf.concurrent.DsfRunnable;
|
||||
import org.eclipse.cdt.dsf.concurrent.IDsfStatusConstants;
|
||||
import org.eclipse.cdt.dsf.concurrent.ImmediateExecutor;
|
||||
import org.eclipse.cdt.dsf.concurrent.Query;
|
||||
import org.eclipse.cdt.dsf.concurrent.RequestMonitor;
|
||||
import org.eclipse.cdt.dsf.datamodel.DMContexts;
|
||||
|
@ -282,25 +285,16 @@ public class TraceControlView extends ViewPart implements IViewPart, SessionEnde
|
|||
return;
|
||||
}
|
||||
|
||||
Query<Object> query = new Query<Object>() {
|
||||
@Override
|
||||
protected void execute(DataRequestMonitor<Object> rm) {
|
||||
final IGDBTraceControl traceControl = getService(IGDBTraceControl.class);
|
||||
if (traceControl != null) {
|
||||
ITraceRecordDMContext emptyDmc = traceControl.createTraceRecordContext(ctx, "-1"); //$NON-NLS-1$
|
||||
traceControl.selectTraceRecord(emptyDmc, rm);
|
||||
} else {
|
||||
rm.setData(null);
|
||||
rm.done();
|
||||
}
|
||||
}
|
||||
};
|
||||
try {
|
||||
getSession().getExecutor().execute(query);
|
||||
query.get();
|
||||
} catch (InterruptedException exc) {
|
||||
} catch (ExecutionException exc) {
|
||||
}
|
||||
getSession().getExecutor().execute(
|
||||
new DsfRunnable() {
|
||||
public void run() {
|
||||
final IGDBTraceControl traceControl = getService(IGDBTraceControl.class);
|
||||
if (traceControl != null) {
|
||||
ITraceRecordDMContext emptyDmc = traceControl.createTraceRecordContext(ctx, "-1"); //$NON-NLS-1$
|
||||
traceControl.selectTraceRecord(emptyDmc, new RequestMonitor(ImmediateExecutor.getInstance(), null));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected void updateDebugContext() {
|
||||
|
@ -513,9 +507,10 @@ public class TraceControlView extends ViewPart implements IViewPart, SessionEnde
|
|||
};
|
||||
try {
|
||||
getSession().getExecutor().execute(query);
|
||||
return query.get();
|
||||
return query.get(1, TimeUnit.SECONDS);
|
||||
} catch (InterruptedException exc) {
|
||||
} catch (ExecutionException exc) {
|
||||
} catch (TimeoutException e) {
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
|
@ -250,6 +250,17 @@ public final class TraceVarDetailsDialog extends Dialog {
|
|||
|
||||
protected void handleRefresh() {
|
||||
ITraceVariableDMData[] vars = fView.getTraceVarList();
|
||||
if (vars == null) {
|
||||
setWarningVisible(TracepointsMessages.TraceControlView_refresh_variable_error);
|
||||
createButton.setEnabled(false);
|
||||
return;
|
||||
}
|
||||
|
||||
// Remove the warning and re-enable the create button, since we now
|
||||
// have a list of trace variables.
|
||||
setWarningVisible(false);
|
||||
createButton.setEnabled(true);
|
||||
|
||||
table.removeAll();
|
||||
for (ITraceVariableDMData var : vars) {
|
||||
String currentVal = var.getValue();
|
||||
|
|
|
@ -37,6 +37,7 @@ public final class TracepointsMessages extends NLS {
|
|||
public static String TraceControlView_create_variable_error;
|
||||
public static String TraceControlView_create_variable_empty_name_error;
|
||||
public static String TraceControlView_action_exit_visualization_mode;
|
||||
public static String TraceControlView_refresh_variable_error;
|
||||
|
||||
static {
|
||||
NLS.initializeMessages(TracepointsMessages.class.getName(), TracepointsMessages.class);
|
||||
|
|
|
@ -25,3 +25,4 @@ TraceControlView_trace_variable_details_value_label=Value:
|
|||
TraceControlView_create_variable_error=Error creating trace variable
|
||||
TraceControlView_create_variable_empty_name_error=Cannot create variable with empty name
|
||||
TraceControlView_action_exit_visualization_mode=Exit Visualization Mode
|
||||
TraceControlView_refresh_variable_error=Unable to retrieve trace variables
|
||||
|
|
Loading…
Add table
Reference in a new issue