mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +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.IDMContext;
|
||||
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.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.IExecutionDMContext;
|
||||
import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService;
|
||||
import org.eclipse.cdt.dsf.gdb.breakpoints.CBreakpointGdbThreadsFilterExtension;
|
||||
import org.eclipse.cdt.dsf.gdb.internal.ui.GdbUIPlugin;
|
||||
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.IMIProcesses;
|
||||
import org.eclipse.cdt.dsf.service.DsfServicesTracker;
|
||||
|
@ -256,7 +256,7 @@ public class GdbThreadFilterEditor {
|
|||
|
||||
private void createThreadViewer(Composite parent) {
|
||||
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.setLayoutData(new GridData());
|
||||
GridData data = new GridData(GridData.FILL_BOTH);
|
||||
|
@ -388,7 +388,7 @@ public class GdbThreadFilterEditor {
|
|||
IContainerDMContext[] containerDmcs = (IContainerDMContext[])getData();
|
||||
rm.setData(containerDmcs);
|
||||
} 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();
|
||||
}
|
||||
|
@ -458,7 +458,7 @@ public class GdbThreadFilterEditor {
|
|||
|
||||
class ContainerLabelQuery extends Query<String> {
|
||||
@Override
|
||||
protected void execute(DataRequestMonitor<String> rm) {
|
||||
protected void execute(final DataRequestMonitor<String> rm) {
|
||||
if (!session.isActive()) {
|
||||
rm.setStatus(getFailStatus(IDsfStatusConstants.INVALID_STATE, "Container's session not active.")); //$NON-NLS-1$
|
||||
rm.done();
|
||||
|
@ -466,13 +466,22 @@ public class GdbThreadFilterEditor {
|
|||
}
|
||||
|
||||
DsfServicesTracker tracker = new DsfServicesTracker(GdbUIPlugin.getBundleContext(), session.getId());
|
||||
IGDBBackend backend = tracker.getService(IGDBBackend.class);
|
||||
if (backend != null) {
|
||||
rm.setData(backend.getProgramPath().toOSString());
|
||||
IProcesses processService = tracker.getService(IProcesses.class);
|
||||
IProcessDMContext procDmc = DMContexts.getAncestorOfType(container, IProcessDMContext.class);
|
||||
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 {
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
@ -511,7 +520,8 @@ public class GdbThreadFilterEditor {
|
|||
ImmediateExecutor.getInstance(), rm) {
|
||||
@Override
|
||||
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("] "); //$NON-NLS-1$
|
||||
builder.append(getData().getId());
|
||||
|
|
|
@ -31,7 +31,10 @@ public class Messages extends NLS {
|
|||
public static String TracepointPropertyPage_PassCount;
|
||||
public static String TracepointPropertyPage_Class;
|
||||
public static String TracepointPropertyPage_Enabled;
|
||||
|
||||
|
||||
public static String GdbThreadFilterEditor_Thread;
|
||||
public static String GdbThreadFilterEditor_RestrictToSelected;
|
||||
|
||||
static {
|
||||
// initialize resource bundle
|
||||
NLS.initializeMessages(Messages.class.getName(), Messages.class);
|
||||
|
|
|
@ -29,3 +29,6 @@ TracepointPropertyPage_IgnoreCount=&Ignore count:
|
|||
TracepointPropertyPage_PassCount=&Pass count:
|
||||
TracepointPropertyPage_Class=Class:
|
||||
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)
|
||||
for (IContainerDMContext ctxt : targets) {
|
||||
if (DMContexts.isAncestorOf(ctxt, context)) {
|
||||
if (ctxt.equals(context) || DMContexts.isAncestorOf(ctxt, context)) {
|
||||
threads.add(filterExtension.getThreadFilters(ctxt));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue