[binutils-gdb] Call error_value_optimized_out from value_assign

Tom Tromey tromey@sourceware.org
Fri Apr 24 14:40:16 GMT 2026


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=989ac09520f7d421a6be515ea6b346c597111eab

commit 989ac09520f7d421a6be515ea6b346c597111eab
Author: Tom Tromey <tromey@adacore.com>
Date:   Tue Apr 21 08:25:04 2026 -0600

    Call error_value_optimized_out from value_assign
    
    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>

Diff:
---
 gdb/valops.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/gdb/valops.c b/gdb/valops.c
index 515e43ccdfa..fccadae6cf6 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -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"));


More information about the Gdb-cvs mailing list