+2021-01-25  Bernd Edlinger  <bernd.edlinger@hotmail.de>
+           Simon Marchi  <simon.marchi@polymtl.ca>
+           Tom de Vries  <tdevries@suse.de>
+
+       * dwarf2/read.c (partial_die_info::read): Use as_unsigned () for
+       DW_AT_ranges.
+
 2021-01-25  Tom Tromey  <tromey@adacore.com>
 
        * dwarf2/read.c (get_mpz): New function.
 
            /* It would be nice to reuse dwarf2_get_pc_bounds here,
               but that requires a full DIE, so instead we just
               reimplement it.  */
-           unsigned int ranges_offset = (attr.constant_value (0)
+           unsigned int ranges_offset = (attr.as_unsigned ()
                                          + (need_ranges_base
                                             ? cu->ranges_base
                                             : 0));
 
+2021-01-25  Tom de Vries  <tdevries@suse.de>
+
+       * gdb.dwarf2/dw2-ranges-psym.exp (gdb_load_no_complaints): New proc.
+       * lib/gdb.exp: Use gdb_load_no_complaints.
+
 2021-01-25  Tom Tromey  <tromey@adacore.com>
 
        * gdb.ada/fixed_points.exp: Add regression test.
 
     return 0
 }
 
+#
+# gdb_load_no_complaints -- As gdb_load, but in addition verifies that
+# loading caused no symbol reading complaints.
+#
+proc gdb_load_no_complaints { arg } {
+    global gdb_prompt gdb_file_cmd_msg decimal
+
+    # Save current setting of complaints.
+    set save ""
+    set show_complaints_re \
+       "Max number of complaints about incorrect symbols is ($decimal)\\."
+    gdb_test_multiple "show complaints" "" {
+       -re -wrap $show_complaints_re {
+           set save $expect_out(1,string)
+       }
+    }
+
+    # Fall back to regular gdb_load if we couldn't get the current setting
+    # of complaints.
+    if { $save == "" } {
+       return gdb_load $arg
+    }
+
+    # Temporarily set complaint to a small non-zero number.
+    gdb_test_no_output "set complaints 5" ""
+
+    gdb_load $arg
+
+    # Verify that there were no complaints.
+    set re "^Reading symbols from \[^\r\n\]*\r\n$gdb_prompt $"
+    gdb_assert {[regexp $re $gdb_file_cmd_msg]} "No complaints"
+
+    # Restore saved setting of complaints.
+    gdb_test_no_output "set complaints $save" ""
+}
+
 # gdb_reload -- load a file into the target.  Called before "running",
 # either the first time or after already starting the program once,
 # for remote targets.  Most files that override gdb_load should now