From: Tom Tromey Date: Fri, 20 Mar 2020 19:04:56 +0000 (-0600) Subject: Make dwarf2_evaluate_property parameter const X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fe26d3a34a223a86fddb59ed70a621a13940a088;p=binutils-gdb.git Make dwarf2_evaluate_property parameter const dwarf2_evaluate_property should not modify its "addr_stack" parameter's contents. This patch makes this part of the API, by marking it const. gdb/ChangeLog 2020-03-20 Tom Tromey * dwarf2/loc.h (dwarf2_evaluate_property): Make "addr_stack" const. * dwarf2/loc.c (dwarf2_evaluate_property): Make "addr_stack" const. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 393b0d278d9..186660bf9ff 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2020-03-20 Tom Tromey + + * dwarf2/loc.h (dwarf2_evaluate_property): Make "addr_stack" + const. + * dwarf2/loc.c (dwarf2_evaluate_property): Make "addr_stack" + const. + 2020-03-20 Simon Marchi * ptrace.m4: Don't check for ptrace declaration. diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c index 5155cff60d0..6440335ccbd 100644 --- a/gdb/dwarf2/loc.c +++ b/gdb/dwarf2/loc.c @@ -2453,7 +2453,7 @@ dwarf2_locexpr_baton_eval (const struct dwarf2_locexpr_baton *dlbaton, bool dwarf2_evaluate_property (const struct dynamic_prop *prop, struct frame_info *frame, - struct property_addr_info *addr_stack, + const struct property_addr_info *addr_stack, CORE_ADDR *value) { if (prop == NULL) @@ -2542,7 +2542,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop, { struct dwarf2_property_baton *baton = (struct dwarf2_property_baton *) prop->data.baton; - struct property_addr_info *pinfo; + const struct property_addr_info *pinfo; struct value *val; for (pinfo = addr_stack; pinfo != NULL; pinfo = pinfo->next) diff --git a/gdb/dwarf2/loc.h b/gdb/dwarf2/loc.h index 98a7d8a6069..a59d3f998fd 100644 --- a/gdb/dwarf2/loc.h +++ b/gdb/dwarf2/loc.h @@ -96,7 +96,7 @@ struct property_addr_info bool dwarf2_evaluate_property (const struct dynamic_prop *prop, struct frame_info *frame, - struct property_addr_info *addr_stack, + const struct property_addr_info *addr_stack, CORE_ADDR *value); /* A helper for the compiler interface that compiles a single dynamic