aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/lib/gdb/dap/completions.py
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/python/lib/gdb/dap/completions.py')
-rw-r--r--gdb/python/lib/gdb/dap/completions.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/gdb/python/lib/gdb/dap/completions.py b/gdb/python/lib/gdb/dap/completions.py
index 85acc43..e5003ff 100644
--- a/gdb/python/lib/gdb/dap/completions.py
+++ b/gdb/python/lib/gdb/dap/completions.py
@@ -39,8 +39,11 @@ def completions(
line = 1
else:
line = import_line(line)
- text = text.splitlines()[line - 1]
- text = text[: column - 1]
+ if text:
+ text = text.splitlines()[line - 1]
+ text = text[: column - 1]
+ else:
+ text = ""
mi_result = exec_mi_and_log("-complete", text)
result = []
completion = None