This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 255996
Collapse All | Expand All

(-)a/cnd.debugger.common2/src/org/netbeans/modules/cnd/debugger/common2/debugger/NativeDebuggerImpl.java (-1 / +5 lines)
Lines 129-134 Link Here
129
import org.openide.cookies.EditorCookie;
129
import org.openide.cookies.EditorCookie;
130
import org.openide.util.Lookup;
130
import org.openide.util.Lookup;
131
import org.openide.util.Pair;
131
import org.openide.util.Pair;
132
import org.openide.util.RequestProcessor;
132
import org.openide.util.actions.SystemAction;
133
import org.openide.util.actions.SystemAction;
133
134
134
/**
135
/**
Lines 981-989 Link Here
981
     * Else, if user has requested disassembly or no source information is
982
     * Else, if user has requested disassembly or no source information is
982
     * available, bring up the disassembler.
983
     * available, bring up the disassembler.
983
     */
984
     */
985
    
986
    private static final RequestProcessor RP = new RequestProcessor("Debugger location updater", 1);
987
    
984
    private void updateLocation(final boolean andShow, final ShowMode showModeOverride, final boolean focus) {
988
    private void updateLocation(final boolean andShow, final ShowMode showModeOverride, final boolean focus) {
985
        
989
        
986
        NativeDebuggerManager.getRequestProcessor().post(new Runnable() {
990
        RP.post(new Runnable() {
987
            @Override
991
            @Override
988
            public void run() {
992
            public void run() {
989
                final Location loc = getVisitedLocation();
993
                final Location loc = getVisitedLocation();
(-)a/cnd.debugger.common2/src/org/netbeans/modules/cnd/debugger/common2/debugger/assembly/Disassembly.java (-1 / +8 lines)
Lines 219-230 Link Here
219
            if (dis != null) {
219
            if (dis != null) {
220
                dis.debugger.registerDisassembly(dis);
220
                dis.debugger.registerDisassembly(dis);
221
                dis.reload();
221
                dis.reload();
222
            } else {
223
                opening = false;
224
                opened = false;
222
            }
225
            }
223
        } catch (Exception e) {
226
        } catch (Exception e) {
224
            Exceptions.printStackTrace(e);
227
            Exceptions.printStackTrace(e);
225
        }
228
        }
226
    }
229
    }
227
    
230
231
    protected final void reloadFailed() {
232
        opening = false;
233
    }
234
228
    protected abstract void reload();
235
    protected abstract void reload();
229
    
236
    
230
    public static void close() {
237
    public static void close() {
(-)a/cnd.debugger.gdb2/src/org/netbeans/modules/cnd/debugger/gdb2/GdbDebuggerImpl.java (-18 / +8 lines)
Lines 149-155 Link Here
149
    static final Logger LOG = Logger.getLogger(GdbDebuggerImpl.class.toString());
149
    static final Logger LOG = Logger.getLogger(GdbDebuggerImpl.class.toString());
150
150
151
    private final GdbHandlerExpert handlerExpert;
151
    private final GdbHandlerExpert handlerExpert;
152
    private MILocation homeLoc;
152
    private volatile MILocation homeLoc;
153
    private boolean dynamicType;
153
    private boolean dynamicType;
154
154
155
    private DisModel disModel = new DisModel();
155
    private DisModel disModel = new DisModel();
Lines 2554-2560 Link Here
2554
        }
2554
        }
2555
2555
2556
        stackUpdater.treeChanged();     // causes a pull
2556
        stackUpdater.treeChanged();     // causes a pull
2557
        disassembly.stateUpdated();
2558
    }
2557
    }
2559
2558
2560
    /*
2559
    /*
Lines 3749-3755 Link Here
3749
            MIValue frameValue = (results != null) ? results.valueOf(MI_FRAME) : null;
3748
            MIValue frameValue = (results != null) ? results.valueOf(MI_FRAME) : null;
3750
            MITList frameTuple;
3749
            MITList frameTuple;
3751
            MITList stack;
3750
            MITList stack;
3752
            boolean visited = false;
3753
	    // Mac 10.4 gdb provides no "frame" attribute
3751
	    // Mac 10.4 gdb provides no "frame" attribute
3754
3752
3755
            // For the scenario that stack view is closed and local view
3753
            // For the scenario that stack view is closed and local view
Lines 3761-3779 Link Here
3761
            }
3759
            }
3762
3760
3763
	    if (srcResults != null) {
3761
	    if (srcResults != null) {
3762
                boolean visited = false;
3764
                stack = srcResults.valueOf("stack").asList(); // NOI18N
3763
                stack = srcResults.valueOf("stack").asList(); // NOI18N
3765
		if (false) {
3764
                frameValue = ((MIResult) stack.asList().get(0)).value();
3766
		    // We have information about what src location we're
3765
                frameTuple = frameValue.asTuple();
3767
		    // stopped in.
3768
		    if (frameValue != null)
3769
			frameTuple = frameValue.asTuple();
3770
		    homeLoc = MILocation.make(this, frameTuple, srcResults, false, stack.size(), breakpoint);
3771
3772
		} else {
3773
                    frameValue = ((MIResult)stack.asList().get(0)).value();
3774
		    frameTuple = frameValue.asTuple();
3775
		    homeLoc = MILocation.make(this, frameTuple, null, false, stack.size(), breakpoint);
3776
                }
3777
3766
3778
                // find the first frame with source info if dis was not requested
3767
                // find the first frame with source info if dis was not requested
3779
                for (MITListItem stf : stack.asList()) {
3768
                for (MITListItem stf : stack.asList()) {
Lines 3783-3798 Link Here
3783
                    }
3772
                    }
3784
                    visited = true;
3773
                    visited = true;
3785
                }
3774
                }
3786
3775
                homeLoc = MILocation.make(this, frameTuple, srcResults, visited, stack.size(), breakpoint);
3787
                state().isUpAllowed = !homeLoc.bottomframe();
3776
                state().isUpAllowed = !homeLoc.bottomframe();
3788
                state().isDownAllowed = !homeLoc.topframe();
3777
                state().isDownAllowed = !homeLoc.topframe();
3789
                setStack(srcRecord);
3778
                setStack(srcRecord);
3790
	    } else {
3779
	    } else {
3791
                frameTuple = ( frameValue == null ? null : frameValue.asTuple() );
3780
                frameTuple = ( frameValue == null ? null : frameValue.asTuple() );
3792
                stack = null;
3781
                stack = null;
3782
                homeLoc = MILocation.make(this, frameTuple, null, false, 0, breakpoint);
3793
            }
3783
            }
3794
3784
            
3795
            setVisitedLocation(MILocation.make(this, frameTuple, null, visited, (stack == null ? 0 :stack.size()), breakpoint));
3785
            setVisitedLocation(homeLoc);
3796
3786
3797
//            if (get_frames || get_locals) {
3787
//            if (get_frames || get_locals) {
3798
//                showStackFrames();
3788
//                showStackFrames();
(-)a/cnd.debugger.gdb2/src/org/netbeans/modules/cnd/debugger/gdb2/GdbDisassembly.java (+4 lines)
Lines 306-325 Link Here
306
    private void reloadDis(boolean withSource, boolean force) {
306
    private void reloadDis(boolean withSource, boolean force) {
307
        this.withSource = withSource;
307
        this.withSource = withSource;
308
        if (!opened) {
308
        if (!opened) {
309
            reloadFailed();
309
            return;
310
            return;
310
        }
311
        }
311
        Frame frame = getDebugger().getCurrentFrame();
312
        Frame frame = getDebugger().getCurrentFrame();
312
        if (frame == null) {
313
        if (frame == null) {
314
            reloadFailed();
313
            return;
315
            return;
314
        }
316
        }
315
        String curAddress = frame.getCurrentPC();
317
        String curAddress = frame.getCurrentPC();
316
        if (curAddress == null || curAddress.length() == 0) {
318
        if (curAddress == null || curAddress.length() == 0) {
319
            reloadFailed();
317
            return;
320
            return;
318
        }
321
        }
319
322
320
        if (!curAddress.equals(address)) {
323
        if (!curAddress.equals(address)) {
321
            requestMode = withSource ? RequestMode.FILE_SRC : RequestMode.FILE_NO_SRC;
324
            requestMode = withSource ? RequestMode.FILE_SRC : RequestMode.FILE_NO_SRC;
322
        } else if (requestMode == RequestMode.NONE) {
325
        } else if (requestMode == RequestMode.NONE) {
326
            reloadFailed();
323
            return;
327
            return;
324
        }
328
        }
325
329

Return to bug 255996