mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-05 00:36:16 +02:00
Bug 349736: DSF-GDB breakpoint deleted when modifying thread filter
This commit is contained in:
parent
dabed9f3db
commit
0b1aec3226
4 changed files with 29 additions and 13 deletions
|
@ -24,16 +24,16 @@ import org.eclipse.cdt.dsf.concurrent.Query;
|
||||||
import org.eclipse.cdt.dsf.datamodel.DMContexts;
|
import org.eclipse.cdt.dsf.datamodel.DMContexts;
|
||||||
import org.eclipse.cdt.dsf.datamodel.IDMContext;
|
import org.eclipse.cdt.dsf.datamodel.IDMContext;
|
||||||
import org.eclipse.cdt.dsf.debug.service.IProcesses;
|
import org.eclipse.cdt.dsf.debug.service.IProcesses;
|
||||||
import org.eclipse.cdt.dsf.debug.service.IRunControl;
|
import org.eclipse.cdt.dsf.debug.service.IProcesses.IProcessDMContext;
|
||||||
import org.eclipse.cdt.dsf.debug.service.IProcesses.IThreadDMContext;
|
import org.eclipse.cdt.dsf.debug.service.IProcesses.IThreadDMContext;
|
||||||
import org.eclipse.cdt.dsf.debug.service.IProcesses.IThreadDMData;
|
import org.eclipse.cdt.dsf.debug.service.IProcesses.IThreadDMData;
|
||||||
|
import org.eclipse.cdt.dsf.debug.service.IRunControl;
|
||||||
import org.eclipse.cdt.dsf.debug.service.IRunControl.IContainerDMContext;
|
import org.eclipse.cdt.dsf.debug.service.IRunControl.IContainerDMContext;
|
||||||
import org.eclipse.cdt.dsf.debug.service.IRunControl.IExecutionDMContext;
|
import org.eclipse.cdt.dsf.debug.service.IRunControl.IExecutionDMContext;
|
||||||
import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService;
|
import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService;
|
||||||
import org.eclipse.cdt.dsf.gdb.breakpoints.CBreakpointGdbThreadsFilterExtension;
|
import org.eclipse.cdt.dsf.gdb.breakpoints.CBreakpointGdbThreadsFilterExtension;
|
||||||
import org.eclipse.cdt.dsf.gdb.internal.ui.GdbUIPlugin;
|
import org.eclipse.cdt.dsf.gdb.internal.ui.GdbUIPlugin;
|
||||||
import org.eclipse.cdt.dsf.gdb.launching.GdbLaunch;
|
import org.eclipse.cdt.dsf.gdb.launching.GdbLaunch;
|
||||||
import org.eclipse.cdt.dsf.gdb.service.IGDBBackend;
|
|
||||||
import org.eclipse.cdt.dsf.mi.service.IMIExecutionDMContext;
|
import org.eclipse.cdt.dsf.mi.service.IMIExecutionDMContext;
|
||||||
import org.eclipse.cdt.dsf.mi.service.IMIProcesses;
|
import org.eclipse.cdt.dsf.mi.service.IMIProcesses;
|
||||||
import org.eclipse.cdt.dsf.service.DsfServicesTracker;
|
import org.eclipse.cdt.dsf.service.DsfServicesTracker;
|
||||||
|
@ -256,7 +256,7 @@ public class GdbThreadFilterEditor {
|
||||||
|
|
||||||
private void createThreadViewer(Composite parent) {
|
private void createThreadViewer(Composite parent) {
|
||||||
Label label = new Label(parent, SWT.NONE);
|
Label label = new Label(parent, SWT.NONE);
|
||||||
label.setText("&Restrict to Selected Targets and Threads:"); //$NON-NLS-1$
|
label.setText(Messages.GdbThreadFilterEditor_RestrictToSelected);
|
||||||
label.setFont(parent.getFont());
|
label.setFont(parent.getFont());
|
||||||
label.setLayoutData(new GridData());
|
label.setLayoutData(new GridData());
|
||||||
GridData data = new GridData(GridData.FILL_BOTH);
|
GridData data = new GridData(GridData.FILL_BOTH);
|
||||||
|
@ -388,7 +388,7 @@ public class GdbThreadFilterEditor {
|
||||||
IContainerDMContext[] containerDmcs = (IContainerDMContext[])getData();
|
IContainerDMContext[] containerDmcs = (IContainerDMContext[])getData();
|
||||||
rm.setData(containerDmcs);
|
rm.setData(containerDmcs);
|
||||||
} else {
|
} else {
|
||||||
rm.setStatus(getFailStatus(IDsfStatusConstants.INVALID_STATE, "Wront type of container contexts.")); //$NON-NLS-1$
|
rm.setStatus(getFailStatus(IDsfStatusConstants.INVALID_STATE, "Wrong type of container contexts.")); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
rm.done();
|
rm.done();
|
||||||
}
|
}
|
||||||
|
@ -458,7 +458,7 @@ public class GdbThreadFilterEditor {
|
||||||
|
|
||||||
class ContainerLabelQuery extends Query<String> {
|
class ContainerLabelQuery extends Query<String> {
|
||||||
@Override
|
@Override
|
||||||
protected void execute(DataRequestMonitor<String> rm) {
|
protected void execute(final DataRequestMonitor<String> rm) {
|
||||||
if (!session.isActive()) {
|
if (!session.isActive()) {
|
||||||
rm.setStatus(getFailStatus(IDsfStatusConstants.INVALID_STATE, "Container's session not active.")); //$NON-NLS-1$
|
rm.setStatus(getFailStatus(IDsfStatusConstants.INVALID_STATE, "Container's session not active.")); //$NON-NLS-1$
|
||||||
rm.done();
|
rm.done();
|
||||||
|
@ -466,13 +466,22 @@ public class GdbThreadFilterEditor {
|
||||||
}
|
}
|
||||||
|
|
||||||
DsfServicesTracker tracker = new DsfServicesTracker(GdbUIPlugin.getBundleContext(), session.getId());
|
DsfServicesTracker tracker = new DsfServicesTracker(GdbUIPlugin.getBundleContext(), session.getId());
|
||||||
IGDBBackend backend = tracker.getService(IGDBBackend.class);
|
IProcesses processService = tracker.getService(IProcesses.class);
|
||||||
if (backend != null) {
|
IProcessDMContext procDmc = DMContexts.getAncestorOfType(container, IProcessDMContext.class);
|
||||||
rm.setData(backend.getProgramPath().toOSString());
|
if (processService != null && procDmc != null) {
|
||||||
|
processService.getExecutionData(
|
||||||
|
procDmc,
|
||||||
|
new DataRequestMonitor<IThreadDMData>(ImmediateExecutor.getInstance(), rm) {
|
||||||
|
@Override
|
||||||
|
public void handleSuccess() {
|
||||||
|
rm.setData(getData().getName());
|
||||||
|
rm.done();
|
||||||
|
}
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
rm.setStatus(getFailStatus(IDsfStatusConstants.INVALID_STATE, "GDB Backend not accessible.")); //$NON-NLS-1$
|
rm.setStatus(getFailStatus(IDsfStatusConstants.INVALID_STATE, "Processes service not accessible.")); //$NON-NLS-1$
|
||||||
|
rm.done();
|
||||||
}
|
}
|
||||||
rm.done();
|
|
||||||
tracker.dispose();
|
tracker.dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -511,7 +520,8 @@ public class GdbThreadFilterEditor {
|
||||||
ImmediateExecutor.getInstance(), rm) {
|
ImmediateExecutor.getInstance(), rm) {
|
||||||
@Override
|
@Override
|
||||||
protected void handleSuccess() {
|
protected void handleSuccess() {
|
||||||
final StringBuilder builder = new StringBuilder("Thread["); //$NON-NLS-1$
|
final StringBuilder builder = new StringBuilder(Messages.GdbThreadFilterEditor_Thread);
|
||||||
|
builder.append("["); //$NON-NLS-1$
|
||||||
builder.append(((IMIExecutionDMContext)thread).getThreadId());
|
builder.append(((IMIExecutionDMContext)thread).getThreadId());
|
||||||
builder.append("] "); //$NON-NLS-1$
|
builder.append("] "); //$NON-NLS-1$
|
||||||
builder.append(getData().getId());
|
builder.append(getData().getId());
|
||||||
|
|
|
@ -31,7 +31,10 @@ public class Messages extends NLS {
|
||||||
public static String TracepointPropertyPage_PassCount;
|
public static String TracepointPropertyPage_PassCount;
|
||||||
public static String TracepointPropertyPage_Class;
|
public static String TracepointPropertyPage_Class;
|
||||||
public static String TracepointPropertyPage_Enabled;
|
public static String TracepointPropertyPage_Enabled;
|
||||||
|
|
||||||
|
public static String GdbThreadFilterEditor_Thread;
|
||||||
|
public static String GdbThreadFilterEditor_RestrictToSelected;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
// initialize resource bundle
|
// initialize resource bundle
|
||||||
NLS.initializeMessages(Messages.class.getName(), Messages.class);
|
NLS.initializeMessages(Messages.class.getName(), Messages.class);
|
||||||
|
|
|
@ -29,3 +29,6 @@ TracepointPropertyPage_IgnoreCount=&Ignore count:
|
||||||
TracepointPropertyPage_PassCount=&Pass count:
|
TracepointPropertyPage_PassCount=&Pass count:
|
||||||
TracepointPropertyPage_Class=Class:
|
TracepointPropertyPage_Class=Class:
|
||||||
TracepointPropertyPage_Enabled=Enabled
|
TracepointPropertyPage_Enabled=Enabled
|
||||||
|
|
||||||
|
GdbThreadFilterEditor_Thread=Thread
|
||||||
|
GdbThreadFilterEditor_RestrictToSelected=&Restrict to Selected Processes and Threads:
|
|
@ -1669,7 +1669,7 @@ public class MIBreakpointsManager extends AbstractDsfService implements IBreakpo
|
||||||
|
|
||||||
// Extract the thread IDs (if there is none, we are covered)
|
// Extract the thread IDs (if there is none, we are covered)
|
||||||
for (IContainerDMContext ctxt : targets) {
|
for (IContainerDMContext ctxt : targets) {
|
||||||
if (DMContexts.isAncestorOf(ctxt, context)) {
|
if (ctxt.equals(context) || DMContexts.isAncestorOf(ctxt, context)) {
|
||||||
threads.add(filterExtension.getThreadFilters(ctxt));
|
threads.add(filterExtension.getThreadFilters(ctxt));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue