diff --git a/README.md b/README.md index f878995..82f5208 100644 --- a/README.md +++ b/README.md @@ -857,3 +857,17 @@ Based on the C way of @dbalatero ```vim :let script = ['.intel_syntax noprefix', '.global _start', '_start:', 'mov rdi, ' . getpid() . '', 'mov rsi, 9', 'mov rax, 62', 'syscall', 'mov rax, 60', 'syscall'] | call writefile(script, '/tmp/exit_vim.S', 'b') | execute "!gcc -nostdlib /tmp/exit_vim.S -o /tmp/exit_vim" | execute "! /tmp/exit_vim" ``` + +## The GDB way + +Credit: @jz543fm + +```bash +sudo gdb -p $(pgrep vim) +``` + +And in gdb use: + +```bash +call (int)kill((int)getpid(), 9) +``` \ No newline at end of file