mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-10 17:55:39 +02:00
Bug 327061 - [Mac] Run To Line throws exceptions, breaks debugging
This commit is contained in:
parent
c2239d41b8
commit
112b975c2d
1 changed files with 15 additions and 6 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2006, 2010 Wind River Systems and others.
|
* Copyright (c) 2006, 2011 Wind River Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -43,6 +43,7 @@ import org.eclipse.cdt.dsf.mi.service.command.events.MIInferiorExitEvent;
|
||||||
import org.eclipse.cdt.dsf.mi.service.command.events.MIStoppedEvent;
|
import org.eclipse.cdt.dsf.mi.service.command.events.MIStoppedEvent;
|
||||||
import org.eclipse.cdt.dsf.mi.service.command.events.MIThreadExitEvent;
|
import org.eclipse.cdt.dsf.mi.service.command.events.MIThreadExitEvent;
|
||||||
import org.eclipse.cdt.dsf.mi.service.command.output.MIBreakInsertInfo;
|
import org.eclipse.cdt.dsf.mi.service.command.output.MIBreakInsertInfo;
|
||||||
|
import org.eclipse.cdt.dsf.mi.service.command.output.MIFrame;
|
||||||
import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo;
|
import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo;
|
||||||
import org.eclipse.cdt.dsf.service.DsfServiceEventHandler;
|
import org.eclipse.cdt.dsf.service.DsfServiceEventHandler;
|
||||||
import org.eclipse.cdt.dsf.service.DsfSession;
|
import org.eclipse.cdt.dsf.service.DsfSession;
|
||||||
|
@ -360,8 +361,7 @@ public class GDBRunControl extends MIRunControl {
|
||||||
if (e instanceof MIBreakpointHitEvent) {
|
if (e instanceof MIBreakpointHitEvent) {
|
||||||
bpId = ((MIBreakpointHitEvent)e).getNumber();
|
bpId = ((MIBreakpointHitEvent)e).getNumber();
|
||||||
}
|
}
|
||||||
String fileLocation = e.getFrame().getFile() + ":" + e.getFrame().getLine(); //$NON-NLS-1$
|
|
||||||
String addrLocation = e.getFrame().getAddress();
|
|
||||||
// Here we check three different things to see if we are stopped at the right place
|
// Here we check three different things to see if we are stopped at the right place
|
||||||
// 1- The actual location in the file. But this does not work for breakpoints that
|
// 1- The actual location in the file. But this does not work for breakpoints that
|
||||||
// were set on non-executable lines
|
// were set on non-executable lines
|
||||||
|
@ -373,9 +373,18 @@ public class GDBRunControl extends MIRunControl {
|
||||||
// So this works for the large majority of cases. The case that won't work is when the user
|
// So this works for the large majority of cases. The case that won't work is when the user
|
||||||
// does a runToLine to a line that is non-executable AND has another breakpoint AND
|
// does a runToLine to a line that is non-executable AND has another breakpoint AND
|
||||||
// has multiple addresses for the breakpoint. I'm mean, come on!
|
// has multiple addresses for the breakpoint. I'm mean, come on!
|
||||||
if (fileLocation.equals(fRunToLineActiveOperation.getFileLocation()) ||
|
boolean equalFileLocation = false;
|
||||||
addrLocation.equals(fRunToLineActiveOperation.getAddrLocation()) ||
|
boolean equalAddrLocation = false;
|
||||||
bpId == fRunToLineActiveOperation.getBreakointId()) {
|
boolean equalBpId = bpId == fRunToLineActiveOperation.getBreakointId();
|
||||||
|
MIFrame frame = e.getFrame();
|
||||||
|
if(frame != null) {
|
||||||
|
String fileLocation = frame.getFile() + ":" + frame.getLine(); //$NON-NLS-1$
|
||||||
|
String addrLocation = frame.getAddress();
|
||||||
|
equalFileLocation = fileLocation.equals(fRunToLineActiveOperation.getFileLocation());
|
||||||
|
equalAddrLocation = addrLocation.equals(fRunToLineActiveOperation.getAddrLocation());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (equalFileLocation || equalAddrLocation || equalBpId) {
|
||||||
// We stopped at the right place. All is well.
|
// We stopped at the right place. All is well.
|
||||||
fRunToLineActiveOperation = null;
|
fRunToLineActiveOperation = null;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue