diff options
author | Tom Tromey <tromey@adacore.com> | 2023-03-01 07:59:44 -0700 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2023-03-01 15:33:03 -0700 |
commit | 802dace16f8c6dfa3200381669015a7dccbd5e28 (patch) | |
tree | 76652917f134ef6ca29769db06e49367e51605dc /gdb/dwarf2 | |
parent | 6e1ee99772d2f0c07b4a2c65f3c1593fbf55d9c1 (diff) | |
download | fsf-binutils-gdb-802dace16f8c6dfa3200381669015a7dccbd5e28.zip fsf-binutils-gdb-802dace16f8c6dfa3200381669015a7dccbd5e28.tar.gz fsf-binutils-gdb-802dace16f8c6dfa3200381669015a7dccbd5e28.tar.bz2 |
Make gdb property batons type-safe
gdbtypes treats dynamic property batons as 'void *', but in actuality
the only users all use dwarf2_property_baton. This patch changes this
code to be type-safe. If a new type is needed here, it seems like
that too could be done in a type-safe way.
Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb/dwarf2')
-rw-r--r-- | gdb/dwarf2/loc.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c index 4727651..bf582bc 100644 --- a/gdb/dwarf2/loc.c +++ b/gdb/dwarf2/loc.c @@ -1649,8 +1649,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop, { case PROP_LOCEXPR: { - const struct dwarf2_property_baton *baton - = (const struct dwarf2_property_baton *) prop->baton (); + const struct dwarf2_property_baton *baton = prop->baton (); gdb_assert (baton->property_type != NULL); bool is_reference = baton->locexpr.is_reference; @@ -1692,8 +1691,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop, case PROP_LOCLIST: { - struct dwarf2_property_baton *baton - = (struct dwarf2_property_baton *) prop->baton (); + struct dwarf2_property_baton *baton = prop->baton (); CORE_ADDR pc; const gdb_byte *data; struct value *val; @@ -1724,8 +1722,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop, case PROP_ADDR_OFFSET: { - struct dwarf2_property_baton *baton - = (struct dwarf2_property_baton *) prop->baton (); + struct dwarf2_property_baton *baton = prop->baton (); const struct property_addr_info *pinfo; struct value *val; @@ -1775,8 +1772,7 @@ dwarf2_compile_property_to_c (string_file *stream, CORE_ADDR pc, struct symbol *sym) { - struct dwarf2_property_baton *baton - = (struct dwarf2_property_baton *) prop->baton (); + struct dwarf2_property_baton *baton = prop->baton (); const gdb_byte *data; size_t size; dwarf2_per_cu_data *per_cu; |