summaryrefslogtreecommitdiff
path: root/gdb/python/py-frame.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/python/py-frame.c')
-rw-r--r--gdb/python/py-frame.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/gdb/python/py-frame.c b/gdb/python/py-frame.c
index 00cd4bee492..3a033ac7570 100644
--- a/gdb/python/py-frame.c
+++ b/gdb/python/py-frame.c
@@ -238,13 +238,15 @@ frapy_pc (PyObject *self, PyObject *args)
Returns the value of a register in this frame. */
static PyObject *
-frapy_read_register (PyObject *self, PyObject *args)
+frapy_read_register (PyObject *self, PyObject *args, PyObject *kw)
{
PyObject *pyo_reg_id;
PyObject *result = nullptr;
- if (!PyArg_UnpackTuple (args, "read_register", 1, 1, &pyo_reg_id))
- return NULL;
+ static const char *keywords[] = { "register", nullptr };
+ if (!gdb_PyArg_ParseTupleAndKeywords (args, kw, "O", keywords, &pyo_reg_id))
+ return nullptr;
+
try
{
scoped_value_mark free_values;
@@ -766,7 +768,8 @@ Return the reason why it's not possible to find frames older than this." },
{ "pc", frapy_pc, METH_NOARGS,
"pc () -> Long.\n\
Return the frame's resume address." },
- { "read_register", frapy_read_register, METH_VARARGS,
+ { "read_register", (PyCFunction) frapy_read_register,
+ METH_VARARGS | METH_KEYWORDS,
"read_register (register_name) -> gdb.Value\n\
Return the value of the register in the frame." },
{ "block", frapy_block, METH_NOARGS,