]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/dwarf: change dwarf2_locexpr_baton_eval to return bool
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 11 Mar 2026 18:05:40 +0000 (14:05 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Thu, 12 Mar 2026 14:20:51 +0000 (10:20 -0400)
Change-Id: Ib22b4ca4365e9943cc17b0d510bf5590842eb258
Approved-By: Tom Tromey <tom@tromey.com>
gdb/dwarf2/loc.c

index 8dfd04461be0a51808a85937e67b629c9d2264f1..c310fa3d8afd1e01081764899ef0819dca06cb95 100644 (file)
@@ -1577,9 +1577,9 @@ dwarf2_evaluate_loc_desc (struct type *type, const frame_info_ptr &frame,
    before evaluation starts.  PUSH_VALUES[0] is pushed first, then
    PUSH_VALUES[1], and so on.
 
-   Returns 1 on success, 0 otherwise.  */
+   Returns true on success, false otherwise.  */
 
-static int
+static bool
 dwarf2_locexpr_baton_eval (const struct dwarf2_locexpr_baton *dlbaton,
                           const frame_info_ptr &frame,
                           const struct property_addr_info *addr_stack,
@@ -1588,7 +1588,7 @@ dwarf2_locexpr_baton_eval (const struct dwarf2_locexpr_baton *dlbaton,
                           bool *is_reference)
 {
   if (dlbaton->size == 0)
-    return 0;
+    return false;
 
   dwarf2_per_objfile *per_objfile = dlbaton->per_objfile;
   dwarf2_per_cu *per_cu = dlbaton->per_cu;
@@ -1610,20 +1610,20 @@ dwarf2_locexpr_baton_eval (const struct dwarf2_locexpr_baton *dlbaton,
     {
       if (ex.error == NOT_AVAILABLE_ERROR)
        {
-         return 0;
+         return false;
        }
       else if (ex.error == NO_ENTRY_VALUE_ERROR)
        {
          if (entry_values_debug)
            exception_print (gdb_stdout, ex);
-         return 0;
+         return false;
        }
       else
        throw;
     }
 
   if (result->optimized_out ())
-    return 0;
+    return false;
 
   if (result->lval () == lval_memory)
     *valp = result->address ();
@@ -1635,7 +1635,7 @@ dwarf2_locexpr_baton_eval (const struct dwarf2_locexpr_baton *dlbaton,
       *valp = value_as_address (result);
     }
 
-  return 1;
+  return true;
 }
 
 /* See dwarf2/loc.h.  */