]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Call error_value_optimized_out from value_assign
authorTom Tromey <tromey@adacore.com>
Tue, 21 Apr 2026 14:25:04 +0000 (08:25 -0600)
committerTom Tromey <tromey@adacore.com>
Fri, 24 Apr 2026 14:37:36 +0000 (08:37 -0600)
value_assign will throw an exception indicating that the value is
optimized out, but it seemed better to me for it to use the utility
function error_value_optimized_out.

Approved-By: Tom de Vries <tdevries@suse.de>
gdb/valops.c

index 515e43ccdfabcd2a6e205f9ffef3a93df4d40011..fccadae6cf6450e42531719d45d5d34cfc04227d 100644 (file)
@@ -1225,8 +1225,7 @@ value_assign (struct value *toval, struct value *fromval)
                                           &unavail))
              {
                if (optim)
-                 throw_error (OPTIMIZED_OUT_ERROR,
-                              _("value has been optimized out"));
+                 error_value_optimized_out ();
                if (unavail)
                  throw_error (NOT_AVAILABLE_ERROR,
                               _("value is not available"));