diff options
author | Tom Tromey <tromey@adacore.com> | 2023-05-11 12:20:05 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2023-06-12 12:09:28 -0600 |
commit | 510586589e74f2ff27f4c563daa395a22c68501c (patch) | |
tree | 60b085e0aa026e63a65b32c3b323fec380a00711 /gdb/NEWS | |
parent | 5e20b4cd17c6627f93e2618f369e62228a38367e (diff) | |
download | gdb-510586589e74f2ff27f4c563daa395a22c68501c.zip gdb-510586589e74f2ff27f4c563daa395a22c68501c.tar.gz gdb-510586589e74f2ff27f4c563daa395a22c68501c.tar.bz2 |
Add type-checking to DAP requests
It occurred to me recently that gdb's DAP implementation should
probably check the types of objects coming from the client. This
patch implements this idea by reusing Python's existing type
annotations, and supplying a decorator that verifies these at runtime.
Python doesn't make it very easy to do runtime type-checking, so the
core of the checker is written by hand. I haven't tried to make a
fully generic runtime type checker. Instead, this only checks the
subset that is needed by DAP. For example, only keyword-only
functions are handled.
Furthermore, in a few spots, it wasn't convenient to spell out the
type that is accepted. I've added a couple of comments to this effect
in breakpoint.py.
I've tried to make this code compatible with older versions of Python,
but I've only been able to try it with 3.9 and 3.10.
Diffstat (limited to 'gdb/NEWS')
0 files changed, 0 insertions, 0 deletions