Make dwarf2_evaluate_property parameter const
authorTom Tromey <tromey@adacore.com>
Fri, 20 Mar 2020 19:04:56 +0000 (13:04 -0600)
committerTom Tromey <tromey@adacore.com>
Fri, 20 Mar 2020 19:06:22 +0000 (13:06 -0600)
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  <tromey@adacore.com>

* dwarf2/loc.h (dwarf2_evaluate_property): Make "addr_stack"
const.
* dwarf2/loc.c (dwarf2_evaluate_property): Make "addr_stack"
const.

gdb/ChangeLog
gdb/dwarf2/loc.c
gdb/dwarf2/loc.h

index 393b0d278d9cefa5c24f27cb1738d19859b57ec9..186660bf9ffe937e3f6dadae102c868801924f20 100644 (file)
@@ -1,3 +1,10 @@
+2020-03-20  Tom Tromey  <tromey@adacore.com>
+
+       * 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  <simon.marchi@efficios.com>
 
        * ptrace.m4: Don't check for ptrace declaration.
index 5155cff60d02533ad05cc7ff4b650ad1416073f1..6440335ccbde8e809d78753c020e1ba82f08920c 100644 (file)
@@ -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)
index 98a7d8a60697cbe1884795ba342a4e848dd8a000..a59d3f998fd26a9b54c72f3ffe86f4d56b427719 100644 (file)
@@ -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