summaryrefslogtreecommitdiff
path: root/gdb/dwarf2
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2023-03-01 08:03:49 -0700
committerTom Tromey <tromey@adacore.com>2023-03-01 15:33:03 -0700
commit5f27603700c0d89023f00b6521b36cc911c23f85 (patch)
tree46042eee0d83bd584e2a36612b6c2db50428bc54 /gdb/dwarf2
parent802dace16f8c6dfa3200381669015a7dccbd5e28 (diff)
downloadbinutils-gdb-5f27603700c0d89023f00b6521b36cc911c23f85.tar.gz
Use const for dwarf2_property_baton
Once a baton is stored in a struct type, it doesn't make sense to modify it. This patch constifies the API. Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb/dwarf2')
-rw-r--r--gdb/dwarf2/loc.c8
-rw-r--r--gdb/dwarf2/loc.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c
index bf582bcfeff..914e016f085 100644
--- a/gdb/dwarf2/loc.c
+++ b/gdb/dwarf2/loc.c
@@ -347,7 +347,7 @@ decode_debug_loc_dwo_addresses (dwarf2_per_cu_data *per_cu,
can be more than one in the list. */
const gdb_byte *
-dwarf2_find_location_expression (struct dwarf2_loclist_baton *baton,
+dwarf2_find_location_expression (const dwarf2_loclist_baton *baton,
size_t *locexpr_length, CORE_ADDR pc)
{
dwarf2_per_objfile *per_objfile = baton->per_objfile;
@@ -1691,7 +1691,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop,
case PROP_LOCLIST:
{
- struct dwarf2_property_baton *baton = prop->baton ();
+ const dwarf2_property_baton *baton = prop->baton ();
CORE_ADDR pc;
const gdb_byte *data;
struct value *val;
@@ -1722,7 +1722,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop,
case PROP_ADDR_OFFSET:
{
- struct dwarf2_property_baton *baton = prop->baton ();
+ const dwarf2_property_baton *baton = prop->baton ();
const struct property_addr_info *pinfo;
struct value *val;
@@ -1772,7 +1772,7 @@ dwarf2_compile_property_to_c (string_file *stream,
CORE_ADDR pc,
struct symbol *sym)
{
- struct dwarf2_property_baton *baton = prop->baton ();
+ const dwarf2_property_baton *baton = prop->baton ();
const gdb_byte *data;
size_t size;
dwarf2_per_cu_data *per_cu;
diff --git a/gdb/dwarf2/loc.h b/gdb/dwarf2/loc.h
index 37925f48497..ad60177e93c 100644
--- a/gdb/dwarf2/loc.h
+++ b/gdb/dwarf2/loc.h
@@ -37,7 +37,7 @@ extern unsigned int entry_values_debug;
/* Find a particular location expression from a location list. */
const gdb_byte *dwarf2_find_location_expression
- (struct dwarf2_loclist_baton *baton,
+ (const dwarf2_loclist_baton *baton,
size_t *locexpr_length,
CORE_ADDR pc);