]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/value.c
Add dynamic_prop::is_constant
authorTom Tromey <tromey@adacore.com>
Wed, 19 Apr 2023 15:40:20 +0000 (09:40 -0600)
committerTom Tromey <tromey@adacore.com>
Fri, 12 May 2023 18:30:28 +0000 (12:30 -0600)
commit9c0fb73485cb2c90bb10cb4d3cf1d27e36f9ff01
tree88f1ca4555a484b28c4fcbe822ac8c925835fd8b
parent14e8fded85efa824e6652ed876229e5c24758b72
Add dynamic_prop::is_constant

I noticed many spots checking whether a dynamic property's kind is
PROP_CONST.  Some spots, I think, are doing a slightly incorrect check
-- checking for != PROP_UNDEFINED where == PROP_CONST is actually
required, the key thing being that const_val may only be called for
PROP_CONST properties.

This patch adds dynamic::is_constant and then updates these checks to
use it.

Regression tested on x86-64 Fedora 36.
14 files changed:
gdb/ada-lang.c
gdb/ada-tasks.c
gdb/compile/compile-c-types.c
gdb/compile/compile-cplus-types.c
gdb/dwarf2/read.c
gdb/f-typeprint.c
gdb/f-valprint.c
gdb/gdbtypes.c
gdb/gdbtypes.h
gdb/guile/scm-type.c
gdb/m2-typeprint.c
gdb/p-typeprint.c
gdb/python/py-type.c
gdb/value.c