lebr0nli/GEP

Consider using GDB MI commands

lebr0nli opened this issue · 2 comments

gdb.execute_mi is added after GDB 14.1

GDB MI -complete command somehow can provide better competitions then normal complete command:

>>> gdb.execute_mi("-complete","enable ")
{'completion': 'enable ', 'matches': ['enable breakpoints', 'enable count', 'enable delete', 'enable display', 'enable frame-filter', 'enable mem', 'enable once', 'enable pretty-printer', 'enable probes', 'enable type-printer', 'enable unwinder', 'enable xmethod'], 'max_completions_reached': '0'}
>>> gdb.execute("complete enable ")
enable

Wow, the performance seems also better:

>>> timeit.timeit("import gdb;gdb.execute('complete',to_string=True)", number=1000)
2.3764819998759776
>>> timeit.timeit("import gdb;gdb.execute_mi('-complete','')",number=1000)
1.2388369999825954

Should be resolved in #42