aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2022-06-12 14:13:22 -0600
committerTom Tromey <tom@tromey.com>2022-12-19 08:18:59 -0700
commitdad6b350f986a58abe469f4584ac515e7ac17879 (patch)
treed0112c62a3ff0ae9addccd5983035b443d8742a0 /gdb/python
parent6829683679ce66f3ff3aa184609afa59ac349637 (diff)
downloadbinutils-dad6b350f986a58abe469f4584ac515e7ac17879.zip
binutils-dad6b350f986a58abe469f4584ac515e7ac17879.tar.gz
binutils-dad6b350f986a58abe469f4584ac515e7ac17879.tar.bz2
Use bool constants for value_print_options
This changes the uses of value_print_options to use 'true' and 'false' rather than integers.
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/py-framefilter.c6
-rw-r--r--gdb/python/py-prettyprint.c6
-rw-r--r--gdb/python/py-value.c4
3 files changed, 8 insertions, 8 deletions
diff --git a/gdb/python/py-framefilter.c b/gdb/python/py-framefilter.c
index 0d7dc48..30968d1 100644
--- a/gdb/python/py-framefilter.c
+++ b/gdb/python/py-framefilter.c
@@ -428,10 +428,10 @@ enumerate_args (PyObject *iter,
if (args_type == CLI_SCALAR_VALUES)
{
/* True in "summary" mode, false otherwise. */
- opts.summary = 1;
+ opts.summary = true;
}
- opts.deref_ref = 1;
+ opts.deref_ref = true;
annotate_frame_args ();
@@ -555,7 +555,7 @@ enumerate_locals (PyObject *iter,
struct value_print_options opts;
get_user_print_options (&opts);
- opts.deref_ref = 1;
+ opts.deref_ref = true;
while (true)
{
diff --git a/gdb/python/py-prettyprint.c b/gdb/python/py-prettyprint.c
index 9276807..eb3a3fd 100644
--- a/gdb/python/py-prettyprint.c
+++ b/gdb/python/py-prettyprint.c
@@ -303,7 +303,7 @@ print_string_repr (PyObject *printer, const char *hint,
gdbpy_extract_lazy_string (py_str.get (), &addr, &type,
&length, &encoding);
- local_opts.addressprint = 0;
+ local_opts.addressprint = false;
val_print_string (type, encoding.get (), addr, (int) length,
stream, &local_opts);
}
@@ -338,7 +338,7 @@ print_string_repr (PyObject *printer, const char *hint,
{
struct value_print_options opts = *options;
- opts.addressprint = 0;
+ opts.addressprint = false;
common_val_print (replacement, stream, recurse, &opts, language);
}
else
@@ -506,7 +506,7 @@ print_children (PyObject *printer, const char *hint,
gdbpy_extract_lazy_string (py_v, &addr, &type, &length, &encoding);
- local_opts.addressprint = 0;
+ local_opts.addressprint = false;
val_print_string (type, encoding.get (), addr, (int) length, stream,
&local_opts);
}
diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c
index 92a1530..44b4ebc 100644
--- a/gdb/python/py-value.c
+++ b/gdb/python/py-value.c
@@ -675,7 +675,7 @@ valpy_format_string (PyObject *self, PyObject *args, PyObject *kw)
struct value_print_options opts;
gdbpy_get_print_options (&opts);
- opts.deref_ref = 0;
+ opts.deref_ref = false;
/* We need objects for booleans as the "p" flag for bools is new in
Python 3.3. */
@@ -1169,7 +1169,7 @@ valpy_str (PyObject *self)
struct value_print_options opts;
gdbpy_get_print_options (&opts);
- opts.deref_ref = 0;
+ opts.deref_ref = false;
string_file stb;