gdb: Convert dwarf2_evaluate_property to return bool
authorAndrew Burgess <andrew.burgess@embecosm.com>
Sat, 4 May 2019 23:15:07 +0000 (00:15 +0100)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Fri, 12 Jul 2019 11:09:52 +0000 (12:09 +0100)
Convert dwarf2_evaluate_property to return a bool, there should be no
user visible change after this commit.

gdb/ChangeLog:

* dwarf2loc.c (dwarf2_evaluate_property): Change return type, and
update return statements.
* dwarf2loc.h (dwarf2_evaluate_property): Update return type on
declaration, and update comment to match.
* gdbtypes.c (resolve_dynamic_array): Update call to
dwarf2_evaluate_property to match new return type.

gdb/ChangeLog
gdb/dwarf2loc.c
gdb/dwarf2loc.h
gdb/gdbtypes.c

index 33cff4edf878f6e68ebcd3fc58a55b94ef82d718..29b675d0bcf6fac855046a69bd8916262350375a 100644 (file)
@@ -1,3 +1,12 @@
+2019-07-12  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * dwarf2loc.c (dwarf2_evaluate_property): Change return type, and
+       update return statements.
+       * dwarf2loc.h (dwarf2_evaluate_property): Update return type on
+       declaration, and update comment to match.
+       * gdbtypes.c (resolve_dynamic_array): Update call to
+       dwarf2_evaluate_property to match new return type.
+
 2019-07-12  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * valarith.c (value_subscripted_rvalue): Change lowerbound
index 83ff1f45d5a9752a6aba25aadce2e78f0efa5bf7..ea6b36e6ed8b99942d2ef9aadb81db1906b926b4 100644 (file)
@@ -2425,14 +2425,14 @@ dwarf2_locexpr_baton_eval (const struct dwarf2_locexpr_baton *dlbaton,
 
 /* See dwarf2loc.h.  */
 
-int
+bool
 dwarf2_evaluate_property (const struct dynamic_prop *prop,
                          struct frame_info *frame,
                          struct property_addr_info *addr_stack,
                          CORE_ADDR *value)
 {
   if (prop == NULL)
-    return 0;
+    return false;
 
   if (frame == NULL && has_stack_frames ())
     frame = get_selected_frame (NULL);
@@ -2454,7 +2454,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop,
 
                *value = value_as_address (val);
              }
-           return 1;
+           return true;
          }
       }
       break;
@@ -2476,7 +2476,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop,
            if (!value_optimized_out (val))
              {
                *value = value_as_address (val);
-               return 1;
+               return true;
              }
          }
       }
@@ -2484,7 +2484,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop,
 
     case PROP_CONST:
       *value = prop->data.const_val;
-      return 1;
+      return true;
 
     case PROP_ADDR_OFFSET:
       {
@@ -2510,11 +2510,11 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop,
          val = value_at (baton->offset_info.type,
                          pinfo->addr + baton->offset_info.offset);
        *value = value_as_address (val);
-       return 1;
+       return true;
       }
     }
 
-  return 0;
+  return false;
 }
 
 /* See dwarf2loc.h.  */
index 955e6f1b48a8535e1fd9323f39aec98fd7451f2c..ac1a771a9f3ec902f843fa5803ca6c272b87c425 100644 (file)
@@ -135,13 +135,13 @@ struct property_addr_info
    property. When evaluating a property that is not related to a type, it can
    be NULL.
 
-   Returns 1 if PROP could be converted and the static value is passed back
-   into VALUE, otherwise returns 0.  */
+   Returns true if PROP could be converted and the static value is passed
+   back into VALUE, otherwise returns false.  */
 
-int dwarf2_evaluate_property (const struct dynamic_prop *prop,
-                             struct frame_info *frame,
-                             struct property_addr_info *addr_stack,
-                             CORE_ADDR *value);
+bool dwarf2_evaluate_property (const struct dynamic_prop *prop,
+                              struct frame_info *frame,
+                              struct property_addr_info *addr_stack,
+                              CORE_ADDR *value);
 
 /* A helper for the compiler interface that compiles a single dynamic
    property to C code.
index e329adc368e049608fb953a349d463247c744af2..d7a14b7ace953cf50b95730e3ad4e57e342407da 100644 (file)
@@ -2065,10 +2065,7 @@ resolve_dynamic_array (struct type *type,
   prop = get_dyn_prop (DYN_PROP_BYTE_STRIDE, type);
   if (prop != NULL)
     {
-      int prop_eval_ok
-       = dwarf2_evaluate_property (prop, NULL, addr_stack, &value);
-
-      if (prop_eval_ok)
+      if (dwarf2_evaluate_property (prop, NULL, addr_stack, &value))
        {
          remove_dyn_prop (DYN_PROP_BYTE_STRIDE, type);
          bit_stride = (unsigned int) (value * 8);
This page took 0.033985 seconds and 4 git commands to generate.