aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2023-02-10 11:59:03 -0700
committerTom Tromey <tromey@adacore.com>2023-02-10 14:04:34 -0700
commit5036bde964bc1a18282dde536a95aecd0d2c08fb (patch)
treee84f6f199dea6bc58d253f568a33bfb9502b0793
parent71bb560755cad815f5159170822cb66df71f916f (diff)
downloadfsf-binutils-gdb-5036bde964bc1a18282dde536a95aecd0d2c08fb.zip
fsf-binutils-gdb-5036bde964bc1a18282dde536a95aecd0d2c08fb.tar.gz
fsf-binutils-gdb-5036bde964bc1a18282dde536a95aecd0d2c08fb.tar.bz2
Ensure all DAP requests are keyword-only
Python functions implementing DAP requests should not use positional parameters -- it only makes sense to call them with keyword arguments. This patch changes the few remaining cases to start with the special "*" parameter, following this rule.
-rw-r--r--gdb/python/lib/gdb/dap/breakpoint.py6
-rw-r--r--gdb/python/lib/gdb/dap/evaluate.py4
2 files changed, 5 insertions, 5 deletions
diff --git a/gdb/python/lib/gdb/dap/breakpoint.py b/gdb/python/lib/gdb/dap/breakpoint.py
index 502beb0..f0e1f10 100644
--- a/gdb/python/lib/gdb/dap/breakpoint.py
+++ b/gdb/python/lib/gdb/dap/breakpoint.py
@@ -1,4 +1,4 @@
-# Copyright 2022 Free Software Foundation, Inc.
+# Copyright 2022, 2023 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -85,7 +85,7 @@ def _set_breakpoints(kind, specs):
@request("setBreakpoints")
-def set_breakpoint(source, *, breakpoints=[], **args):
+def set_breakpoint(*, source, breakpoints=[], **args):
if "path" not in source:
result = []
else:
@@ -108,7 +108,7 @@ def set_breakpoint(source, *, breakpoints=[], **args):
@request("setFunctionBreakpoints")
@capability("supportsFunctionBreakpoints")
-def set_fn_breakpoint(breakpoints, **args):
+def set_fn_breakpoint(*, breakpoints, **args):
specs = []
for bp in breakpoints:
specs.append(
diff --git a/gdb/python/lib/gdb/dap/evaluate.py b/gdb/python/lib/gdb/dap/evaluate.py
index c05e62d..f01bf0f 100644
--- a/gdb/python/lib/gdb/dap/evaluate.py
+++ b/gdb/python/lib/gdb/dap/evaluate.py
@@ -1,4 +1,4 @@
-# Copyright 2022 Free Software Foundation, Inc.
+# Copyright 2022, 2023 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -33,7 +33,7 @@ def _evaluate(expr, frame_id):
# FIXME return a structured response using pretty-printers / varobj
# FIXME supportsVariableType handling
@request("evaluate")
-def eval_request(expression, *, frameId=None, **args):
+def eval_request(*, expression, frameId=None, **args):
result = send_gdb_with_response(lambda: _evaluate(expression, frameId))
return {
"result": result,