equal
deleted
inserted
replaced
24 def select(i: Int): Context = copy(index = i + 1) |
24 def select(i: Int): Context = copy(index = i + 1) |
25 |
25 |
26 def thread_state: Option[Debug_State] = debug_states.headOption |
26 def thread_state: Option[Debug_State] = debug_states.headOption |
27 |
27 |
28 def stack_state: Option[Debug_State] = |
28 def stack_state: Option[Debug_State] = |
29 if (1 <= index && index <= debug_states.length) |
29 if (1 <= index && index <= debug_states.length) Some(debug_states(index - 1)) |
30 Some(debug_states(index - 1)) |
|
31 else None |
30 else None |
32 |
31 |
33 def debug_index: Option[Int] = |
32 def debug_index: Option[Int] = |
34 if (stack_state.isDefined) Some(index - 1) |
33 if (stack_state.isDefined) Some(index - 1) |
35 else if (debug_states.nonEmpty) Some(0) |
34 else if (debug_states.nonEmpty) Some(0) |
163 delay_update.invoke() |
162 delay_update.invoke() |
164 } |
163 } |
165 |
164 |
166 def is_active(): Boolean = session.is_ready && state.value.is_active |
165 def is_active(): Boolean = session.is_ready && state.value.is_active |
167 |
166 |
168 def ready(): Unit = { |
167 def ready(): Unit = |
169 if (is_active()) |
168 if (is_active()) session.protocol_command("Debugger.init") |
170 session.protocol_command("Debugger.init") |
|
171 } |
|
172 |
169 |
173 def init(): Unit = |
170 def init(): Unit = |
174 state.change { st => |
171 state.change { st => |
175 val st1 = st.inc_active |
172 val st1 = st.inc_active |
176 if (session.is_ready && !st.is_active && st1.is_active) |
173 if (session.is_ready && !st.is_active && st1.is_active) { |
177 session.protocol_command("Debugger.init") |
174 session.protocol_command("Debugger.init") |
|
175 } |
178 st1 |
176 st1 |
179 } |
177 } |
180 |
178 |
181 def exit(): Unit = |
179 def exit(): Unit = |
182 state.change { st => |
180 state.change { st => |
183 val st1 = st.dec_active |
181 val st1 = st.dec_active |
184 if (session.is_ready && st.is_active && !st1.is_active) |
182 if (session.is_ready && st.is_active && !st1.is_active) { |
185 session.protocol_command("Debugger.exit") |
183 session.protocol_command("Debugger.exit") |
|
184 } |
186 st1 |
185 st1 |
187 } |
186 } |
188 |
187 |
189 def is_break(): Boolean = state.value.break |
188 def is_break(): Boolean = state.value.break |
190 def set_break(b: Boolean): Unit = { |
189 def set_break(b: Boolean): Unit = { |