aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/py-auto-load.c2
-rw-r--r--gdb/python/py-param.c9
-rw-r--r--gdb/python/py-value.c4
-rw-r--r--gdb/python/python.c2
4 files changed, 10 insertions, 7 deletions
diff --git a/gdb/python/py-auto-load.c b/gdb/python/py-auto-load.c
index c7b9afd..ade2aa1 100644
--- a/gdb/python/py-auto-load.c
+++ b/gdb/python/py-auto-load.c
@@ -29,7 +29,7 @@
set auto-load python-scripts on|off
This is true if we should auto-load associated Python scripts when an
objfile is opened, false otherwise. */
-static int auto_load_python_scripts = 1;
+static bool auto_load_python_scripts = true;
/* "show" command for the auto_load_python_scripts configuration variable. */
diff --git a/gdb/python/py-param.c b/gdb/python/py-param.c
index afeff58..4794366 100644
--- a/gdb/python/py-param.c
+++ b/gdb/python/py-param.c
@@ -55,7 +55,10 @@ struct parm_constant parm_constants[] =
/* A union that can hold anything described by enum var_types. */
union parmpy_variable
{
- /* Hold an integer value, for boolean and integer types. */
+ /* Hold a boolean value. */
+ bool boolval;
+
+ /* Hold an integer value. */
int intval;
/* Hold an auto_boolean. */
@@ -198,7 +201,7 @@ set_parameter_value (parmpy_object *self, PyObject *value)
cmp = PyObject_IsTrue (value);
if (cmp < 0)
return -1;
- self->value.intval = cmp;
+ self->value.boolval = cmp;
break;
case var_auto_boolean:
@@ -475,7 +478,7 @@ add_setshow_generic (int parmclass, enum command_class cmdclass,
case var_boolean:
add_setshow_boolean_cmd (cmd_name, cmdclass,
- &self->value.intval, set_doc, show_doc,
+ &self->value.boolval, set_doc, show_doc,
help_doc, get_set_value, get_show_value,
set_list, show_list);
diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c
index ede4c0e..1428b7a 100644
--- a/gdb/python/py-value.c
+++ b/gdb/python/py-value.c
@@ -580,7 +580,7 @@ valpy_string (PyObject *self, PyObject *args, PyObject *kw)
encoding, errors);
}
-/* Given a Python object, copy its truth value to a C int (the value
+/* Given a Python object, copy its truth value to a C bool (the value
pointed by dest).
If src_obj is NULL, then *dest is not modified.
@@ -588,7 +588,7 @@ valpy_string (PyObject *self, PyObject *args, PyObject *kw)
in case of error. */
static bool
-copy_py_bool_obj (int *dest, PyObject *src_obj)
+copy_py_bool_obj (bool *dest, PyObject *src_obj)
{
if (src_obj)
{
diff --git a/gdb/python/python.c b/gdb/python/python.c
index 9c8c635..ddf0e72 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -441,7 +441,7 @@ gdbpy_parameter_value (enum var_types type, void *var)
case var_boolean:
{
- if (* (int *) var)
+ if (* (bool *) var)
Py_RETURN_TRUE;
else
Py_RETURN_FALSE;