#include <algorithm>
#include "gdbsupport/scope-exit.h"
#include <list>
+#include "cli/cli-style.h"
/* True if we are debugging inferior calls. */
CORE_ADDR funaddr = find_function_addr (function, &values_type, &ftype);
if (is_nocall_function (ftype))
- error (_("Cannot call the function '%s' which does not follow the "
+ error (_("Cannot call the function '%ps' which does not follow the "
"target calling convention."),
- get_function_name (funaddr, name_buf, sizeof (name_buf)));
+ styled_string (function_name_style.style (),
+ get_function_name (funaddr, name_buf,
+ sizeof (name_buf))));
if (values_type == NULL || values_type->is_stub ())
values_type = default_return_type;
{
const char *name = get_function_name (funaddr,
name_buf, sizeof (name_buf));
- error (_("'%s' has unknown return type; "
+ error (_("'%ps' has unknown return type; "
"cast the call to its declared return type"),
- name);
+ styled_string (function_name_style.style (), name));
}
values_type = check_typedef (values_type);
throw_error (e.error, _("%s\n\
An error occurred while in a function called from GDB.\n\
Evaluation of the expression containing the function\n\
-(%s) will be abandoned.\n\
+(%ps) will be abandoned.\n\
When the function is done executing, GDB will silently stop."),
- e.what (), name);
+ e.what (),
+ styled_string (function_name_style.style (), name));
case RETURN_QUIT:
default:
throw_exception (std::move (e));
error (_("The program being debugged exited while in a function "
"called from GDB.\n"
"Evaluation of the expression containing the function\n"
- "(%s) will be abandoned."),
- name);
+ "(%ps) will be abandoned."),
+ styled_string (function_name_style.style (), name));
}
if (call_thread_ptid != inferior_ptid)
The program received a signal in another thread while\n\
making a function call from GDB.\n\
Evaluation of the expression containing the function\n\
-(%s) will be abandoned.\n\
+(%ps) will be abandoned.\n\
When the function is done executing, GDB will silently stop."),
- name);
+ styled_string (function_name_style.style (), name));
else
error (_("\
The program stopped in another thread while making a function call from GDB.\n\
Evaluation of the expression containing the function\n\
-(%s) will be abandoned.\n\
+(%ps) will be abandoned.\n\
When the function is done executing, GDB will silently stop."),
- name);
+ styled_string (function_name_style.style (), name));
}
{
while in a function called from GDB. GDB has restored the context\n\
to what it was before the call. To change this behavior use\n\
\"set unwind-on-signal off\". Evaluation of the expression containing\n\
-the function (%s) will be abandoned."),
+the function (%ps) will be abandoned."),
gdb_signal_to_name (stop_signal),
gdb_signal_to_string (stop_signal),
- name.c_str ());
+ styled_string (function_name_style.style (),
+ name.c_str ()));
}
else
{
GDB remains in the frame where the signal was received.\n\
To change this behavior use \"set unwind-on-signal on\".\n\
Evaluation of the expression containing the function\n\
-(%s) will be abandoned.\n\
+(%ps) will be abandoned.\n\
When the function is done executing, GDB will silently stop."),
- name.c_str ());
+ styled_string (function_name_style.style (),
+ name.c_str ()));
}
}
GDB has restored the context to what it was before the call.\n\
To change this behavior use \"set unwind-on-timeout off\".\n\
Evaluation of the expression containing the function\n\
-(%s) will be abandoned."),
- name.c_str ());
+(%ps) will be abandoned."),
+ styled_string (function_name_style.style (),
+ name.c_str ()));
}
else
{
GDB remains in the frame where the timeout occurred.\n\
To change this behavior use \"set unwind-on-timeout on\".\n\
Evaluation of the expression containing the function\n\
-(%s) will be abandoned.\n\
+(%ps) will be abandoned.\n\
When the function is done executing, GDB will silently stop."),
- name.c_str ());
+ styled_string (function_name_style.style (),
+ name.c_str ()));
}
}
to prevent the program from being terminated, and has restored the\n\
context to its original state before the call.\n\
To change this behavior use \"set unwind-on-terminating-exception off\".\n\
-Evaluation of the expression containing the function (%s)\n\
+Evaluation of the expression containing the function (%ps)\n\
will be abandoned."),
- name.c_str ());
+ styled_string (function_name_style.style (),
+ name.c_str ()));
}
else if (stop_stack_dummy == STOP_NONE)
{
error (_("\
The program being debugged stopped while in a function called from GDB.\n\
Evaluation of the expression containing the function\n\
-(%s) will be abandoned.\n\
+(%ps) will be abandoned.\n\
When the function is done executing, GDB will silently stop."),
- name.c_str ());
+ styled_string (function_name_style.style (),
+ name.c_str ()));
}
}
{
std::string hint = incomplete_type_hint (args);
if (method == METHOD)
- error (_("Cannot resolve method %s%s%s to any overloaded instance%s"),
+ error (_("Cannot resolve method %p[%s%s%s%p] to any overloaded instance%s"),
+ function_name_style.style ().ptr (),
obj_type_name,
(obj_type_name && *obj_type_name) ? "::" : "",
- name, hint.c_str ());
+ name, nullptr, hint.c_str ());
else
- error (_("Cannot resolve function %s to any overloaded instance%s"),
- func_name, hint.c_str ());
+ error (_("Cannot resolve function %ps to any overloaded instance%s"),
+ styled_string (function_name_style.style (), func_name),
+ hint.c_str ());
}
else if (match_quality == NON_STANDARD)
{
if (method == METHOD)
warning (_("Using non-standard conversion to match "
- "method %s%s%s to supplied arguments"),
+ "method %p[%s%s%s%p] to supplied arguments"),
+ function_name_style.style ().ptr (),
obj_type_name,
(obj_type_name && *obj_type_name) ? "::" : "",
- name);
+ name, nullptr);
else
warning (_("Using non-standard conversion to match "
- "function %s to supplied arguments"),
- func_name);
+ "function %ps to supplied arguments"),
+ styled_string (function_name_style.style (), func_name));
}
if (staticp != NULL)
else if (noside == EVAL_AVOID_SIDE_EFFECTS)
return value::allocate (TYPE_FN_FIELD_TYPE (f, j));
else
- error (_("Cannot reference virtual member function \"%s\""),
- name);
+ error (_("Cannot reference virtual member function \"%ps\""),
+ styled_string (function_name_style.style (), name));
}
else
{