aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2025-04-15 12:29:50 -0600
committerTom Tromey <tromey@adacore.com>2025-04-17 09:25:55 -0600
commit2b4909278a4c664b9f457efbcc475ed288b730ac (patch)
treecff38301a403690474689dc1e08fd4f412d89f70 /gdb/python
parent64a6faa2b6ce9a4c8049fe55a5247733b4aa3cfd (diff)
downloadgdb-2b4909278a4c664b9f457efbcc475ed288b730ac.zip
gdb-2b4909278a4c664b9f457efbcc475ed288b730ac.tar.gz
gdb-2b4909278a4c664b9f457efbcc475ed288b730ac.tar.bz2
Clean up value_struct_elt_bitpos
value_struct_elt_bitpos is weird: it takes an in/out value parameter, and it takes an error string parameter. However, it only has a single caller, which never uses the "out" value. I think it was done this way to mimic value_struct_elt. However, value_struct_elt is pretty ugly and I don't think it's worth imitating. This patch cleans up value_struct_elt_bitpos a bit. Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/py-value.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c
index 3855bde..8a2e263 100644
--- a/gdb/python/py-value.c
+++ b/gdb/python/py-value.c
@@ -1096,8 +1096,7 @@ valpy_getitem (PyObject *self, PyObject *key)
res_val = value_struct_elt (&tmp, {}, field.get (), NULL,
"struct/class/union");
else if (bitpos >= 0)
- res_val = value_struct_elt_bitpos (&tmp, bitpos, field_type,
- "struct/class/union");
+ res_val = value_struct_elt_bitpos (tmp, bitpos, field_type);
else if (base_class_type != NULL)
{
struct type *val_type;