lebr0nli / GEP

GEP (GDB Enhanced Prompt) - a GDB plug-in to enhance your GDB with fzf history search, fish-like autosuggestions, tab auto-completion with fzf, and more!
MIT License
98 stars 7 forks source link

Error in `gdb.prompt_hook` might cause infinite loop #21

Closed lebr0nli closed 1 year ago

lebr0nli commented 1 year ago

If we set gdb.prompt_hook as following:

x = 0

def foo(current_prompt):
    global x
    if x & 1:
        x += 1
        raise gdb.error("err")
    x += 1
    return "(test) "

gdb.prompt_hook = foo

GEP will step into an infinite loop after the first prompt.