]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Use function style with throw_error
authorTom Tromey <tom@tromey.com>
Wed, 8 Apr 2026 00:22:42 +0000 (18:22 -0600)
committerTom Tromey <tom@tromey.com>
Fri, 8 May 2026 19:02:32 +0000 (13:02 -0600)
This changes some calls to throw_error to use function_name_style.

gdb/infcall.c
gdb/linespec.c
gdb/valarith.c

index a1328479d0a86906d30c04674dc9932f8cfe5b3a..8b26f541de6b2363a0e15baa16098f0e4d51260f 100644 (file)
@@ -29,6 +29,7 @@
 #include "language.h"
 #include "objfiles.h"
 #include "cli/cli-cmds.h"
+#include "cli/cli-style.h"
 #include "command.h"
 #include "dummy-frame.h"
 #include "ada-lang.h"
index c9c442ad125621e110e30292e76f29f40dd4fd84..5371d8426aec6ea1b0ea9bdf227bc62af8c19ae8 100644 (file)
@@ -1549,12 +1549,13 @@ symbol_not_found_error (const char *symbol, const char *filename)
     {
       if (filename)
        throw_error (NOT_FOUND_ERROR,
-                    _("Function \"%s\" not defined in \"%ps\"."),
-                    symbol,
+                    _("Function \"%ps\" not defined in \"%ps\"."),
+                    styled_string (function_name_style.style (), symbol),
                     styled_string (file_name_style.style (), filename));
       else
        throw_error (NOT_FOUND_ERROR,
-                    _("Function \"%s\" not defined."), symbol);
+                    _("Function \"%ps\" not defined."),
+                    styled_string (function_name_style.style (), symbol));
     }
 }
 
@@ -1593,8 +1594,9 @@ undefined_label_error (const char *function, const char *label)
 {
   if (function != NULL)
     throw_error (NOT_FOUND_ERROR,
-               _("No label \"%s\" defined in function \"%s\"."),
-               label, function);
+                _("No label \"%s\" defined in function \"%ps\"."),
+                label,
+                styled_string (function_name_style.style (), function));
   else
     throw_error (NOT_FOUND_ERROR,
                _("No label \"%s\" defined in current function."),
index 673bdee2d11ff8896c6378beff1a7e71e758ea1e..ed5b5d8adf9adea1e4593e4017f77bf500997c6a 100644 (file)
@@ -30,6 +30,7 @@
 #include "gdbarch.h"
 #include "rust-lang.h"
 #include "ada-lang.h"
+#include "cli/cli-style.h"
 
 /* Forward declarations.  */
 static struct value *value_subscripted_rvalue (struct value *array,
@@ -559,7 +560,8 @@ value_x_binop (struct value *arg1, struct value *arg2, enum exp_opcode op,
                                    argvec.slice (1, 2 - static_memfuncp));
     }
   throw_error (NOT_FOUND_ERROR,
-              _("member function %s not found"), tstr);
+              _("member function %ps not found"),
+              styled_string (function_name_style.style (), tstr));
 }
 
 /* We know that arg1 is a structure, so try to find a unary user
@@ -672,7 +674,8 @@ value_x_unop (struct value *arg1, enum exp_opcode op, enum noside noside)
                                    argvec.slice (1, nargs));
     }
   throw_error (NOT_FOUND_ERROR,
-              _("member function %s not found"), tstr);
+              _("member function %ps not found"),
+              styled_string (function_name_style.style (), tstr));
 }
 \f