Add basic Python API for convenience variables
authorTom Tromey <tom@tromey.com>
Sun, 22 Apr 2018 21:13:09 +0000 (15:13 -0600)
committerTom Tromey <tom@tromey.com>
Thu, 31 May 2018 21:00:40 +0000 (15:00 -0600)
commit7729052b5377bfbf1c5ec5eaab59dd5071d4c5b1
tree750e865b7e765e41e28c93214bcbdd1f98f8ce75
parent8a60efe714e636c9f958058a8dfb12de81bdcbfa
Add basic Python API for convenience variables

This adds a basic Python API for accessing convenience variables.
With this, convenience variables can be read and set from Python.
Although gdb supports convenience variables whose value changes at
each call, this is not exposed to Python; it could be, but I think
it's just as good to write a convenience function in this situation.

This is PR python/23080.

Tested on x86-64 Fedora 26.

2018-04-22  Tom Tromey  <tom@tromey.com>

PR python/23080:
* NEWS: Update for new functions.
* python/py-value.c (gdbpy_set_convenience_variable)
(gdbpy_convenience_variable): New functions.
* python/python-internal.h (gdbpy_convenience_variable)
(gdbpy_set_convenience_variable): Declare.
* python/python.c (python_GdbMethods): Add convenience_variable,
set_convenience_variable.

doc/ChangeLog
2018-04-22  Tom Tromey  <tom@tromey.com>

PR python/23080:
* python.texi (Basic Python): Document gdb.convenience_variable,
gdb.set_convenience_variable.

testsuite/ChangeLog
2018-04-22  Tom Tromey  <tom@tromey.com>

PR python/23080:
* gdb.python/python.exp: Add convenience variable tests.
gdb/NEWS
gdb/doc/python.texi
gdb/python/py-value.c
gdb/python/python-internal.h
gdb/python/python.c
gdb/testsuite/gdb.python/python.exp