asynchronous inferior function call implementation, and that in
turn means restructuring the code so that it is event driven. */
+static int may_call_functions_p = 1;
+static void
+show_may_call_functions_p (struct ui_file *file, int from_tty,
+ struct cmd_list_element *c,
+ const char *value)
+{
+ fprintf_filtered (file,
+ _("Permission to call functions in the program is %s.\n"),
+ value);
+}
+
/* How you should pass arguments to a function depends on whether it
was defined in K&R style or prototype style. If you define a
function using the K&R syntax that takes a `float' argument, then
target supports asynchronous execution. */
wait_sync_command_done ();
}
- catch (const gdb_exception &e)
+ catch (gdb_exception &e)
{
- caught_error = e;
+ caught_error = std::move (e);
}
/* If GDB has the prompt blocked before, then ensure that it remains
struct gdb_exception e;
char name_buf[RAW_FUNCTION_ADDRESS_SIZE];
+ if (!may_call_functions_p)
+ error (_("Cannot call functions in the program: "
+ "may-call-functions is off."));
+
if (!target_has_execution)
noprocess ();
e.what (), name);
case RETURN_QUIT:
default:
- throw_exception (e);
+ throw_exception (std::move (e));
}
}
void
_initialize_infcall (void)
{
+ add_setshow_boolean_cmd ("may-call-functions", no_class,
+ &may_call_functions_p, _("\
+Set permission to call functions in the program."), _("\
+Show permission to call functions in the program."), _("\
+When this permission is on, GDB may call functions in the program.\n\
+Otherwise, any sort of attempt to call a function in the program\n\
+will result in an error."),
+ NULL,
+ show_may_call_functions_p,
+ &setlist, &showlist);
+
add_setshow_boolean_cmd ("coerce-float-to-double", class_obscure,
&coerce_float_to_double_p, _("\
Set coercion of floats to doubles when calling functions."), _("\
information to determine that a function is prototyped. If this flag is\n\
set, GDB will perform the conversion for a function it considers\n\
unprototyped.\n\
-The default is to perform the conversion.\n"),
+The default is to perform the conversion."),
NULL,
show_coerce_float_to_double_p,
&setlist, &showlist);