File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -266,4 +266,12 @@ void* DebugSession::single_step()
266
266
return (void *)regs.eip ;
267
267
}
268
268
269
+ void DebugSession::detach ()
270
+ {
271
+ for (auto & breakpoint : m_breakpoints.keys ()) {
272
+ remove_breakpoint (breakpoint);
273
+ }
274
+ continue_debugee ();
275
+ }
276
+
269
277
}
Original file line number Diff line number Diff line change @@ -90,11 +90,14 @@ class DebugSession {
90
90
};
91
91
void continue_debugee (ContinueType type = ContinueType::FreeRun);
92
92
93
- // returns the wstatus result of waitpid()
93
+ // Returns the wstatus result of waitpid()
94
94
int continue_debugee_and_wait (ContinueType type = ContinueType::FreeRun);
95
95
96
+ // Returns the new eip
96
97
void * single_step ();
97
98
99
+ void detach ();
100
+
98
101
template <typename Callback>
99
102
void run (Callback callback);
100
103
@@ -236,7 +239,11 @@ void DebugSession::run(Callback callback)
236
239
state = State::SingleStep;
237
240
}
238
241
239
- if (decision == DebugDecision::Kill || decision == DebugDecision::Detach) {
242
+ if (decision == DebugDecision::Detach) {
243
+ detach ();
244
+ break ;
245
+ }
246
+ if (decision == DebugDecision::Kill) {
240
247
ASSERT_NOT_REACHED (); // TODO: implement
241
248
}
242
249
You can’t perform that action at this time.
0 commit comments