Lines 14-19
Link Here
|
14 |
import java.util.Observer; |
14 |
import java.util.Observer; |
15 |
|
15 |
|
16 |
import org.eclipse.cdt.debug.mi.core.GDBProcess; |
16 |
import org.eclipse.cdt.debug.mi.core.GDBProcess; |
|
|
17 |
import org.eclipse.cdt.debug.mi.core.cdi.model.Target; |
17 |
import org.eclipse.cdt.debug.mi.ui.console.actions.MiConsoleSaveAction; |
18 |
import org.eclipse.cdt.debug.mi.ui.console.actions.MiConsoleSaveAction; |
18 |
import org.eclipse.cdt.debug.mi.ui.console.actions.MiConsoleVerboseModeAction; |
19 |
import org.eclipse.cdt.debug.mi.ui.console.actions.MiConsoleVerboseModeAction; |
19 |
import org.eclipse.debug.core.DebugEvent; |
20 |
import org.eclipse.debug.core.DebugEvent; |
Lines 44-50
Link Here
|
44 |
} |
45 |
} |
45 |
|
46 |
|
46 |
public void dispose() { |
47 |
public void dispose() { |
47 |
if(GDBProcess != null) { |
48 |
if (GDBProcess != null) { |
48 |
DebugPlugin.getDefault().removeDebugEventListener(this); |
49 |
DebugPlugin.getDefault().removeDebugEventListener(this); |
49 |
} |
50 |
} |
50 |
fSaveConsole = null; |
51 |
fSaveConsole = null; |
Lines 73-81
Link Here
|
73 |
|
74 |
|
74 |
// add a debug event listener |
75 |
// add a debug event listener |
75 |
DebugPlugin.getDefault().addDebugEventListener(this); |
76 |
DebugPlugin.getDefault().addDebugEventListener(this); |
76 |
|
77 |
// if we miss change event update enablement manually |
77 |
// register this object as MISession observer |
78 |
fVerboseMode.updateStateAndEnablement(); |
78 |
GDBProcess.getTarget().getMISession().addObserver(this); |
79 |
Target target = GDBProcess.getTarget(); |
|
|
80 |
if (target != null) { |
81 |
// register this object as MISession observer |
82 |
target.getMISession().addObserver(this); |
83 |
} |
79 |
} |
84 |
} |
80 |
} |
85 |
} |
81 |
} |
86 |
} |
Lines 89-95
Link Here
|
89 |
DebugEvent event = events[i]; |
94 |
DebugEvent event = events[i]; |
90 |
if (event.getSource().equals(GDBProcess)) { |
95 |
if (event.getSource().equals(GDBProcess)) { |
91 |
if (fVerboseMode != null) { |
96 |
if (fVerboseMode != null) { |
92 |
fVerboseMode.setEnabled(!GDBProcess.isTerminated()); |
97 |
fVerboseMode.updateStateAndEnablement(); |
|
|
98 |
Target target = GDBProcess.getTarget(); |
99 |
if (target != null) { |
100 |
// register this object as MISession observer |
101 |
target.getMISession().addObserver(this); |
102 |
} |
93 |
} |
103 |
} |
94 |
} |
104 |
} |
95 |
} |
105 |
} |
Lines 101-109
Link Here
|
101 |
public void update(Observable arg0, Object arg1) { |
111 |
public void update(Observable arg0, Object arg1) { |
102 |
if((arg1!=null) && (arg1 instanceof VerboseModeChangedEvent) && (fVerboseMode != null)) { |
112 |
if((arg1!=null) && (arg1 instanceof VerboseModeChangedEvent) && (fVerboseMode != null)) { |
103 |
try { |
113 |
try { |
104 |
fVerboseMode.setChecked(GDBProcess.getTarget().isVerboseModeEnabled()); |
114 |
fVerboseMode.updateStateAndEnablement(); |
105 |
} catch (Exception e) { |
115 |
} catch (Exception e) { |
106 |
} |
116 |
} |
107 |
} |
117 |
} |
108 |
} |
118 |
} |
109 |
|
119 |
|