45 #define RAW_FUNCTION_ADDRESS_FORMAT "at 0x%s" 46 #define RAW_FUNCTION_ADDRESS_SIZE (sizeof (RAW_FUNCTION_ADDRESS_FORMAT) \ 47 + 2 * sizeof (CORE_ADDR)) 81 _(
"Coercion of floats to doubles " 82 "when calling functions is %s.\n"),
99 _(
"Unwinding of stack if a signal is " 100 "received while in a call dummy is %s.\n"),
125 _(
"Unwind stack if a C++ exception is " 126 "unhandled while in a call dummy is %s.\n"),
138 static struct value *
162 struct value *new_value;
298 int found_descriptor = 0;
309 if (funaddr != nfunaddr)
310 found_descriptor = 1;
312 if (!found_descriptor)
318 error (
_(
"Invalid data type for function to be called."));
320 if (retval_type != NULL)
331 struct value **args,
int nargs,
348 if (func_name != NULL)
349 error (
_(
"'%s' has unknown return type; " 350 "cast the call to its declared return type"),
353 error (
_(
"function has unknown return type; " 354 "cast the call to its declared return type"));
418 static struct value *
421 struct value *retval = NULL;
428 if (stack_temporaries)
509 int struct_return_p,
CORE_ADDR struct_addr)
614 proceed (real_pc, GDB_SIGNAL_0);
668 if (caught_error.
reason < 0)
670 if (call_thread != NULL)
674 if (call_thread != NULL)
691 type *default_return_type,
692 int nargs,
struct value **args)
695 nargs, args, NULL, NULL);
718 type *default_return_type,
719 int nargs,
struct value **args,
721 void *dummy_dtor_data)
724 struct type *values_type, *target_values_type;
728 struct cleanup *inf_status_cleanup;
738 struct cleanup *terminate_bp_cleanup;
751 error (
_(
"May not call functions while looking at trace frames."));
754 error (
_(
"Cannot call functions in reverse mode."));
760 error (
_(
"This target does not support function calls."));
844 if (stack_temporaries)
846 struct value *lastval;
871 if (values_type == NULL)
872 values_type = default_return_type;
873 if (values_type == NULL)
876 name_buf,
sizeof (name_buf));
877 error (
_(
"'%s' has unknown return type; " 878 "cast the call to its declared return type"),
897 hidden_first_param_p = 1;
906 target_values_type = values_type;
929 target_values_type, &real_pc, &bp_addr,
943 bp_addr_as_address = bp_addr;
946 if (bp_bytes != NULL)
962 bp_addr = dummy_addr;
970 error (
_(
"Too few arguments in function call."));
975 for (i = nargs - 1; i >= 0; i--)
978 struct type *param_type;
985 && default_return_type != NULL)
1010 param_type, prototyped, &sp);
1057 if (hidden_first_param_p)
1059 struct value **new_args;
1065 memcpy (&new_args[1], &args[0],
sizeof (
struct value *) * nargs);
1077 bp_addr, nargs, args,
1148 if (dummy_dtor != NULL)
1150 dummy_dtor, dummy_dtor_data);
1173 call_thread_ptid = tp->
ptid;
1199 struct value *retval;
1235 name_buf,
sizeof (name_buf));
1247 An error occurred while in a function called from GDB.\n\ 1248 Evaluation of the expression containing the function\n\ 1249 (%s) will be abandoned.\n\ 1250 When the function is done executing, GDB will silently stop."),
1264 name_buf,
sizeof (name_buf));
1274 error (
_(
"The program being debugged exited while in a function " 1275 "called from GDB.\n" 1276 "Evaluation of the expression containing the function\n" 1277 "(%s) will be abandoned."),
1284 name_buf,
sizeof (name_buf));
1295 The program received a signal in another thread while\n\ 1296 making a function call from GDB.\n\ 1297 Evaluation of the expression containing the function\n\ 1298 (%s) will be abandoned.\n\ 1299 When the function is done executing, GDB will silently stop."),
1303 The program stopped in another thread while making a function call from GDB.\n\ 1304 Evaluation of the expression containing the function\n\ 1305 (%s) will be abandoned.\n\ 1306 When the function is done executing, GDB will silently stop."),
1336 The program being debugged was signaled while in a function called from GDB.\n\ 1337 GDB has restored the context to what it was before the call.\n\ 1338 To change this behavior use \"set unwindonsignal off\".\n\ 1339 Evaluation of the expression containing the function\n\ 1340 (%s) will be abandoned."),
1354 The program being debugged was signaled while in a function called from GDB.\n\ 1355 GDB remains in the frame where the signal was received.\n\ 1356 To change this behavior use \"set unwindonsignal on\".\n\ 1357 Evaluation of the expression containing the function\n\ 1358 (%s) will be abandoned.\n\ 1359 When the function is done executing, GDB will silently stop."),
1375 The program being debugged entered a std::terminate call, most likely\n\ 1376 caused by an unhandled C++ exception. GDB blocked this call in order\n\ 1377 to prevent the program from being terminated, and has restored the\n\ 1378 context to its original state before the call.\n\ 1379 To change this behaviour use \"set unwind-on-terminating-exception off\".\n\ 1380 Evaluation of the expression containing the function (%s)\n\ 1381 will be abandoned."),
1402 The program being debugged stopped while in a function called from GDB.\n\ 1403 Evaluation of the expression containing the function\n\ 1404 (%s) will be abandoned.\n\ 1405 When the function is done executing, GDB will silently stop."),
1420 Set coercion of floats to doubles when calling functions."),
_(
"\ 1421 Show coercion of floats to doubles when calling functions"),
_(
"\ 1422 Variables of type float should generally be converted to doubles before\n\ 1423 calling an unprototyped function, and left alone when calling a prototyped\n\ 1424 function. However, some older debug info formats do not provide enough\n\ 1425 information to determine that a function is prototyped. If this flag is\n\ 1426 set, GDB will perform the conversion for a function it considers\n\ 1428 The default is to perform the conversion.\n"),
1435 Set unwinding of stack if a signal is received while in a call dummy."),
_(
"\ 1436 Show unwinding of stack if a signal is received while in a call dummy."),
_(
"\ 1437 The unwindonsignal lets the user determine what gdb should do if a signal\n\ 1438 is received while in a function called from gdb (call dummy). If set, gdb\n\ 1439 unwinds the stack and restore the context to what as it was before the call.\n\ 1440 The default is to stop in the frame where the signal was received."),
1447 Set unwinding of stack if std::terminate is called while in call dummy."),
_(
"\ 1448 Show unwinding of stack if std::terminate() is called while in a call dummy."),
1450 The unwind on terminating exception flag lets the user determine\n\ 1451 what gdb should do if a std::terminate() call is made from the\n\ 1452 default exception handler. If set, gdb unwinds the stack and restores\n\ 1453 the context to what it was before the call. If unset, gdb allows the\n\ 1454 std::terminate call to proceed.\n\ 1455 The default is to unwind the frame."),
void() dummy_frame_dtor_ftype(void *data, int registers_valid)
struct value * call_function_by_hand_dummy(struct value *function, type *default_return_type, int nargs, struct value **args, dummy_frame_dtor_ftype *dummy_dtor, void *dummy_dtor_data)
char * hex_string(LONGEST num)
void restore_infcall_control_state(struct infcall_control_state *)
struct value * return_value
ptid_t user_visible_resume_ptid(int step)
struct frame_id frame_id_build(CORE_ADDR stack_addr, CORE_ADDR code_addr)
struct thread_info * find_thread_ptid(ptid_t ptid)
int class_or_union_p(const struct type *t)
struct value * value_addr(struct value *arg1)
struct type * builtin_long_double
#define SYMBOL_PRINT_NAME(symbol)
static int coerce_float_to_double_p
struct frame_info * get_current_frame(void)
struct value * value_from_contents_and_address(struct type *type, const gdb_byte *valaddr, CORE_ADDR address)
static const char * get_function_name(CORE_ADDR funaddr, char *buf, int buf_size)
static struct gdb_exception run_inferior_call(struct call_thread_fsm *sm, struct thread_info *call_thread, CORE_ADDR real_pc)
CORE_ADDR gdbarch_frame_align(struct gdbarch *gdbarch, CORE_ADDR address)
int gdbarch_push_dummy_code_p(struct gdbarch *gdbarch)
int gdbarch_inner_than(struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)
struct infcall_suspend_state * save_infcall_suspend_state(void)
LONGEST value_as_long(struct value *val)
void dummy_frame_pop(struct frame_id dummy_id, ptid_t ptid)
void thread_fsm_delete(struct thread_fsm *self)
void breakpoint_auto_delete(bpstat bs)
const struct builtin_type * builtin_type(struct gdbarch *gdbarch)
void register_dummy_frame_dtor(struct frame_id dummy_id, ptid_t ptid, dummy_frame_dtor_ftype *dtor, void *dtor_data)
CORE_ADDR get_frame_sp(struct frame_info *this_frame)
void internal_error(const char *file, int line, const char *fmt,...)
struct thread_info * inferior_thread(void)
CORE_ADDR gdbarch_deprecated_function_start_offset(struct gdbarch *gdbarch)
int thread_stack_temporaries_enabled_p(ptid_t ptid)
static int unwind_on_terminating_exception_p
const struct gdb_exception exception_none
void read_value_memory(struct value *val, LONGEST bit_offset, int stack, CORE_ADDR memaddr, gdb_byte *buffer, size_t length)
void thread_fsm_clean_up(struct thread_fsm *self, struct thread_info *thread)
enum language la_language
struct obj_section * section
static int call_thread_fsm_should_stop(struct thread_fsm *self, struct thread_info *thread)
struct cleanup * make_cleanup_restore_infcall_suspend_state(struct infcall_suspend_state *)
breakpoint * related_breakpoint
#define TYPE_PROTOTYPED(t)
#define TYPE_FIELD_TYPE(thistype, n)
struct value * allocate_value(struct type *type)
struct regcache * get_current_regcache(void)
struct thread_fsm thread_fsm
struct obj_section * find_pc_overlay(CORE_ADDR pc)
#define TYPE_IS_REFERENCE(t)
scoped_restore_tmpl< T > make_scoped_restore(T *var)
void null_cleanup(void *arg)
#define MSYMBOL_PRINT_NAME(symbol)
static struct thread_fsm_ops call_thread_fsm_ops
struct cmd_list_element * setlist
int gdbarch_call_dummy_location(struct gdbarch *gdbarch)
int gdbarch_frame_align_p(struct gdbarch *gdbarch)
struct type * check_typedef(struct type *type)
#define TYPE_GNU_IFUNC(t)
enum exec_direction_kind execution_direction
#define CATCH(EXCEPTION, MASK)
void dummy_frame_push(struct infcall_suspend_state *caller_state, const struct frame_id *dummy_id, ptid_t ptid)
struct target_ops current_target
static int call_thread_fsm_should_notify_stop(struct thread_fsm *self)
void fprintf_filtered(struct ui_file *stream, const char *format,...)
struct symbol * find_pc_function(CORE_ADDR pc)
struct value * value_cast_pointers(struct type *type, struct value *arg2, int subclass_check)
enum prompt_state prompt_state
CORE_ADDR gdbarch_push_dummy_code(struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr, struct regcache *regcache)
CORE_ADDR gdbarch_convert_from_func_ptr_addr(struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ)
int using_struct_return(struct gdbarch *gdbarch, struct value *function, struct type *value_type)
struct cmd_list_element * showlist
#define gdb_assert_not_reached(message)
int get_traceframe_number(void)
struct cleanup * make_cleanup(make_cleanup_ftype *function, void *arg)
struct value * value_coerce_to_target(struct value *val)
void finish_thread_state(ptid_t ptid)
struct gdbarch * get_type_arch(const struct type *type)
void _initialize_infcall(void)
enum return_value_convention gdbarch_return_value(struct gdbarch *gdbarch, struct value *function, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
void maybe_remove_breakpoints(void)
void push_thread_stack_temporary(ptid_t ptid, struct value *v)
struct value * value_cast(struct type *type, struct value *arg2)
struct thread_fsm * thread_fsm
int thread_fsm_finished_p(struct thread_fsm *self)
#define target_has_execution
char * xstrprintf(const char *format,...)
CORE_ADDR gdbarch_push_dummy_call(struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
struct value * get_last_thread_stack_temporary(ptid_t)
static CORE_ADDR push_dummy_code(struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr, struct regcache *regcache)
void disable_watchpoints_before_interactive_call_start(void)
int stopped_by_random_signal
struct value * value_ref(struct value *arg1, enum type_code refcode)
void discard_infcall_control_state(struct infcall_control_state *)
void throw_exception(struct gdb_exception exception)
struct value * value_from_pointer(struct type *type, CORE_ADDR addr)
void discard_cleanups(struct cleanup *old_chain)
breakpoint_up set_momentary_breakpoint(struct gdbarch *gdbarch, struct symtab_and_line sal, struct frame_id frame_id, enum bptype type)
const struct language_defn * current_language
CORE_ADDR entry_point_address(void)
#define TYPE_TARGET_TYPE(thistype)
int gdbarch_frame_red_zone_size(struct gdbarch *gdbarch)
struct type * builtin_double
struct bound_minimal_symbol lookup_minimal_symbol_by_pc(CORE_ADDR pc)
void proceed(CORE_ADDR addr, enum gdb_signal siggnal)
void ui_register_input_event_handler(struct ui *ui)
#define SYMBOL_BLOCK_VALUE(symbol)
struct breakpoint * set_longjmp_breakpoint_for_call_dummy(void)
#define RAW_FUNCTION_ADDRESS_FORMAT
#define TYPE_CODE(thistype)
static void show_unwind_on_terminating_exception_p(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
void clear_proceed_status(int step)
thread_control_state control
void error_call_unknown_return_type(const char *func_name)
void wait_sync_command_done(void)
const gdb_byte * gdbarch_breakpoint_from_pc(struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
CORE_ADDR find_function_addr(struct value *function, struct type **retval_type)
struct minimal_symbol * minsym
struct interp * command_interp(void)
struct program_space * pspace
void add_setshow_boolean_cmd(const char *name, enum command_class theclass, int *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_const_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
#define TYPE_NFIELDS(thistype)
void set_std_terminate_breakpoint(void)
static struct value * value_arg_coerce(struct gdbarch *gdbarch, struct value *arg, struct type *param_type, int is_prototyped, CORE_ADDR *sp)
static struct call_thread_fsm * new_call_thread_fsm(struct ui *waiting_ui, struct interp *cmd_interp, struct gdbarch *gdbarch, struct value *function, struct type *value_type, int struct_return_p, CORE_ADDR struct_addr)
void observer_notify_inferior_call_post(ptid_t thread, CORE_ADDR address)
int ptid_equal(const ptid_t &ptid1, const ptid_t &ptid2)
static struct value * get_call_return_value(struct call_return_meta_info *ri)
void observer_notify_inferior_call_pre(ptid_t thread, CORE_ADDR address)
struct program_space * current_program_space
static void show_unwind_on_signal_p(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static int ignore(struct target_ops *ops, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
struct value * call_function_by_hand(struct value *function, type *default_return_type, int nargs, struct value **args)
void value_force_lval(struct value *v, CORE_ADDR addr)
static void cleanup_delete_std_terminate_breakpoint(void *ignore)
struct type * value_type(const struct value *value)
#define SYMBOL_TYPE(symbol)
struct value * ada_convert_actual(struct value *actual, struct type *formal_type0)
CORE_ADDR value_as_address(struct value *val)
int gdbarch_push_dummy_call_p(struct gdbarch *gdbarch)
gdb_byte * value_contents_raw(struct value *value)
static void show_coerce_float_to_double_p(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
void delete_std_terminate_breakpoint(void)
void thread_fsm_ctor(struct thread_fsm *self, struct thread_fsm_ops *ops, struct interp *cmd_interp)
#define TYPE_LENGTH(thistype)
enum stop_stack_kind stop_stack_dummy
static struct type * find_function_return_type(CORE_ADDR pc)
void write_memory(CORE_ADDR memaddr, const bfd_byte *myaddr, ssize_t len)
#define RAW_FUNCTION_ADDRESS_SIZE
CORE_ADDR value_address(const struct value *value)
void enable_watchpoints_after_interactive_call_stop(void)
static int unwind_on_signal_p
struct type * builtin_void
void error(const char *fmt,...)
void delete_file_handler(int fd)
struct type * lookup_pointer_type(struct type *type)
void thread_fsm_set_finished(struct thread_fsm *self)
struct gdbarch * get_frame_arch(struct frame_info *this_frame)
struct cleanup * make_cleanup_restore_infcall_control_state(struct infcall_control_state *)
void throw_error(enum errors error, const char *fmt,...)
#define gnu_ifunc_resolve_addr
void do_cleanups(struct cleanup *old_chain)
struct call_return_meta_info return_meta_info
int language_pass_by_reference(struct type *type)
enum return_reason reason
struct type * builtin_int
struct infcall_control_state * save_infcall_control_state(void)
int gdbarch_return_in_first_hidden_param_p(struct gdbarch *gdbarch, struct type *type)