]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/dwarf: rename low_set variable in dwarf2_ranges_read
authorSimon Marchi <simon.marchi@polymtl.ca>
Thu, 12 Mar 2026 16:32:03 +0000 (12:32 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Sat, 14 Mar 2026 17:33:21 +0000 (13:33 -0400)
Rename low_set to low_high_set, to reflect what it really means.

Also, change some manual min/max so use std::min/std::max, I think it
makes the intent clearer.

Change-Id: I9ca81be915962e704becabe78c39b95e0abf561b
Approved-By: Tom de Vries <tdevries@suse.de>
gdb/dwarf2/read.c

index e436e0df8571b6497db6bec4a205a89633f35478..31c44476d2ca3d79cfe5fca86433fbd5b4a393b8 100644 (file)
@@ -8717,7 +8717,7 @@ dwarf2_ranges_read (unsigned offset, unrelocated_addr *low_return,
                    unrelocated_addr *high_return, struct dwarf2_cu *cu,
                    addrmap_mutable *map, void *datum, dwarf_tag tag)
 {
-  bool low_set = false;
+  bool low_high_set = false;
   unrelocated_addr low = {};
   unrelocated_addr high = {};
   bool retval = dwarf2_ranges_process (offset, cu, tag,
@@ -8735,29 +8735,26 @@ dwarf2_ranges_read (unsigned offset, unrelocated_addr *low_return,
         segment of consecutive addresses.  We should have a
         data structure for discontiguous block ranges
         instead.  */
-      if (!low_set)
+      if (!low_high_set)
        {
          low = range_beginning;
          high = range_end;
-         low_set = true;
+         low_high_set = true;
        }
       else
        {
-         if (range_beginning < low)
-           low = range_beginning;
-
-         if (range_end > high)
-           high = range_end;
+         low = std::min (low, range_beginning);
+         high = std::max (high, range_end);
        }
     });
 
   if (!retval)
     return false;
 
-  if (!low_set)
+  if (!low_high_set)
     {
       /* If the first entry is an end-of-list marker, the range
-       describes an empty scope, i.e. no instructions.  */
+        describes an empty scope, i.e. no instructions.  */
       return false;
     }