You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<spanclass="k">raise</span><spanclass="ne">TypeError</span><spanclass="p">(</span><spanclass="s2">"kill_on_exit must be a boolean"</span><spanclass="p">)</span>
<spanclass="w"></span><spanclass="sd">"""A flag that indicates if the debugger should kill the debugged process when it exits."""</span>
<spanclass="n">liblog</span><spanclass="o">.</span><spanclass="n">debugger</span><spanclass="p">(</span><spanclass="sa">f</span><spanclass="s2">"Error while interrupting debuggee: </span><spanclass="si">{</span><spanclass="n">e</span><spanclass="si">}</span><spanclass="s2">"</span><spanclass="p">)</span>
<spanclass="n">liblog</span><spanclass="o">.</span><spanclass="n">debugger</span><spanclass="p">(</span><spanclass="sa">f</span><spanclass="s2">"Error while terminating the debugger: </span><spanclass="si">{</span><spanclass="n">e</span><spanclass="si">}</span><spanclass="s2">"</span><spanclass="p">)</span>
<spanclass="w"></span><spanclass="sd">"""This function is used to create a new `Debugger` object. It returns a `Debugger` object.</span>
451
452
@@ -457,6 +458,7 @@ <h1>Source code for libdebug.libdebug</h1><div class="highlight"><pre>
457
458
<spanclass="sd"> continue_to_binary_entrypoint (bool, optional): Whether to automatically continue to the binary entrypoint. Defaults to True.</span>
458
459
<spanclass="sd"> auto_interrupt_on_command (bool, optional): Whether to automatically interrupt the process when a command is issued. Defaults to False.</span>
459
460
<spanclass="sd"> fast_memory (bool, optional): Whether to use a faster memory reading method. Defaults to False.</span>
461
+
<spanclass="sd"> kill_on_exit (bool, optional): Whether to kill the debugged process when the debugger exits. Defaults to True.</span>
460
462
461
463
<spanclass="sd"> Returns:</span>
462
464
<spanclass="sd"> Debugger: The `Debugger` object.</span>
@@ -472,6 +474,7 @@ <h1>Source code for libdebug.libdebug</h1><div class="highlight"><pre>
Copy file name to clipboardExpand all lines: dev/_sources/basic_features.rst.txt
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,8 @@ After creating the debugger object, you can start the execution of the program u
36
36
37
37
The `run()` command returns a `PipeManager` object, which you can use to interact with the program's standard input, output, and error. To read more about the PipeManager interface, please refer to the PipeManager documentation :class:`libdebug.utils.pipe_manager.PipeManager`. Please note that breakpoints are not kept between different runs of the program. If you want to set a breakpoint again, you should do so after the program has restarted.
38
38
39
+
Any process will be automatically killed when the debugging script exits. If you want to prevent this behavior, you can set the `kill_on_exit` parameter to False when creating the debugger object, or set the companion attribute `kill_on_exit` to False at runtime.
40
+
39
41
The command queue
40
42
-----------------
41
43
Control flow commands, register access and memory access are all done through the command queue. This is a FIFO queue of commands that are executed in order.
@@ -275,6 +277,9 @@ An alternative to running the program from the beginning and to resume libdebug
275
277
276
278
d.attach(pid)
277
279
280
+
Do note that libdebug automatically kills any running process when the debugging script exits, even if the debugger has detached from it.
281
+
If you want to prevent this behavior, you can set the `kill_on_exit` parameter to False when creating the debugger object, or set the companion attribute `kill_on_exit` to False at runtime.
0 commit comments