public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Ensure all DAP requests are keyword-only
@ 2023-02-10 19:00 Tom Tromey
  2023-02-10 20:57 ` Simon Marchi
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2023-02-10 19:00 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

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.
---
 gdb/python/lib/gdb/dap/breakpoint.py | 6 +++---
 gdb/python/lib/gdb/dap/evaluate.py   | 4 ++--
 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 502beb0478e..f0e1f103d1b 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 c05e62d17a3..f01bf0f33c9 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,
-- 
2.39.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-02-10 21:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-10 19:00 [PATCH] Ensure all DAP requests are keyword-only Tom Tromey
2023-02-10 20:57 ` Simon Marchi
2023-02-10 21:03   ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).