lebr0nli/GEP

`ctrl-c` is not working when debugging kernel with qemu-system

lebr0nli opened this issue · 1 comments

Somehow, when I'm trying to debug the linux kernel with qemu-system, I can't use ctrl-c to halt it.

截圖 2023-11-25 下午3 44 16

With vanilla gdb, ctrl-c works without any issue.

Huh, this seems fix the problem:

diff --git a/gdbinit-gep.py b/gdbinit-gep.py
index b60b94f..d785414 100644
--- a/gdbinit-gep.py
+++ b/gdbinit-gep.py
@@ -541,7 +541,7 @@ def gep_prompt(current_prompt: str) -> None:
                         full_cmd += new_line

             if not quit_input_in_multiline_mode:
-                gdb.execute(full_cmd, from_tty=True)
+                gdb.execute(f"pi gdb.execute({full_cmd!r}, from_tty=True)")
         except gdb.error as e:
             print(e)
         except KeyboardInterrupt:

Weird, why it works?