]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Use tuples for default arguments in DAP
authorTom Tromey <tromey@adacore.com>
Fri, 12 May 2023 14:28:28 +0000 (08:28 -0600)
committerTom Tromey <tromey@adacore.com>
Mon, 12 Jun 2023 18:09:28 +0000 (12:09 -0600)
commit5e20b4cd17c6627f93e2618f369e62228a38367e
tree5805aa4425de7b510294124eb0046eadea427ea6
parent5c7cdc95aaace0f2eb7a13199a3cbf479617a009
Use tuples for default arguments in DAP

My co-worker Kévin taught me that using a mutable object as a default
argument in Python is somewhat dangerous, because the object is
created a single time (when the function is defined), and so if it is
mutated in the body of the function, the changes will stick around.

This patch changes the cases like this in DAP to use () rather than []
as the default.  This patch is merely preventative, as no bugs like
this are in the code.
gdb/python/lib/gdb/dap/breakpoint.py
gdb/python/lib/gdb/dap/launch.py