Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 237556 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/dd/mi/service/command/AbstractMIControl.java (-1 / +1 lines)
Lines 259-265 Link Here
259
				if (runControl != null && execDmc != null && runControl.isSuspended(execDmc)) {
259
				if (runControl != null && execDmc != null && runControl.isSuspended(execDmc)) {
260
			    	// Before the command is sent, Check the Thread Id and send it to 
260
			    	// Before the command is sent, Check the Thread Id and send it to 
261
			    	// the queue only if the id has been changed.
261
			    	// the queue only if the id has been changed.
262
			    	if (targetThread != -1 && targetThread != fCurrentThreadId) {
262
			    	if (targetThread > 0 && targetThread != fCurrentThreadId) {
263
			    		fCurrentThreadId = targetThread;
263
			    		fCurrentThreadId = targetThread;
264
			    		resetCurrentStackLevel();
264
			    		resetCurrentStackLevel();
265
			    		CommandHandle cmdHandle = new CommandHandle(new MIThreadSelect(execDmc), null);
265
			    		CommandHandle cmdHandle = new CommandHandle(new MIThreadSelect(execDmc), null);
(-)src/org/eclipse/dd/mi/service/MIRunControl.java (-4 / +6 lines)
Lines 284-290 Link Here
284
	private StateChangeReason fStateChangeReason;
284
	private StateChangeReason fStateChangeReason;
285
	private IExecutionDMContext fStateChangeTriggeringContext;
285
	private IExecutionDMContext fStateChangeTriggeringContext;
286
	
286
	
287
	private static final int DEFAULT_THREAD_ID = 1;
287
	private static final int FAKE_THREAD_ID = 0;
288
288
289
    public MIRunControl(DsfSession session) {
289
    public MIRunControl(DsfSession session) {
290
        super(session);
290
        super(session);
Lines 626-634 Link Here
626
626
627
	private IExecutionDMContext[] makeExecutionDMCs(IContainerDMContext containerCtx, MIThreadListIdsInfo info) {
627
	private IExecutionDMContext[] makeExecutionDMCs(IContainerDMContext containerCtx, MIThreadListIdsInfo info) {
628
		if (info.getThreadIds().length == 0) {
628
		if (info.getThreadIds().length == 0) {
629
			//Main thread always exist even if it is not reported by GDB.
629
			// Main thread always exist even if it is not reported by GDB.
630
			//So create thread-id= 0 when no thread is reported
630
			// So create thread-id = 0 when no thread is reported.
631
			return new IMIExecutionDMContext[]{new MIExecutionDMC(getSession().getId(), containerCtx, DEFAULT_THREAD_ID)};
631
			// This hack is necessary to prevent AbstractMIControl from issuing a thread-select
632
			// because it doesn't work if the application was not compiled with pthread.
633
			return new IMIExecutionDMContext[]{new MIExecutionDMC(getSession().getId(), containerCtx, FAKE_THREAD_ID)};
632
		} else {
634
		} else {
633
			IExecutionDMContext[] executionDmcs = new IMIExecutionDMContext[info.getThreadIds().length];
635
			IExecutionDMContext[] executionDmcs = new IMIExecutionDMContext[info.getThreadIds().length];
634
			for (int i = 0; i < info.getThreadIds().length; i++) {
636
			for (int i = 0; i < info.getThreadIds().length; i++) {

Return to bug 237556