GDB (xrefs)

Classes | Macros | Functions | Variables
/tmp/gdb-8.1/gdb/infcall.c File Reference
`#include "defs.h"`
`#include "infcall.h"`
`#include "breakpoint.h"`
`#include "tracepoint.h"`
`#include "target.h"`
`#include "regcache.h"`
`#include "inferior.h"`
`#include "infrun.h"`
`#include "block.h"`
`#include "gdbcore.h"`
`#include "language.h"`
`#include "objfiles.h"`
`#include "gdbcmd.h"`
`#include "command.h"`
`#include "dummy-frame.h"`
`#include "ada-lang.h"`
`#include "gdbthread.h"`
`#include "event-top.h"`
`#include "observer.h"`
`#include "top.h"`
`#include "interps.h"`
`#include "thread-fsm.h"`

Go to the source code of this file.

## Classes
struct | call_return_meta_info
struct | call_thread_fsm

## Macros
#define | RAW_FUNCTION_ADDRESS_FORMAT "at 0x%s"
#define | RAW_FUNCTION_ADDRESS_SIZE

## Functions
static void | show_coerce_float_to_double_p (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static void | show_unwind_on_signal_p (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static void | show_unwind_on_terminating_exception_p (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static struct value * | value_arg_coerce (struct gdbarch *gdbarch, struct value *arg, struct type *param_type, int is_prototyped, CORE_ADDR *sp)
static struct type * | find_function_return_type (CORE_ADDR pc)
CORE_ADDR | find_function_addr (struct value *function, struct type **retval_type)
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 | error_call_unknown_return_type (const char *func_name)
static const char * | get_function_name (CORE_ADDR funaddr, char *buf, int buf_size)
static struct value * | get_call_return_value (struct call_return_meta_info *ri)
static int | call_thread_fsm_should_stop (struct thread_fsm *self, struct thread_info *thread)
static int | call_thread_fsm_should_notify_stop (struct thread_fsm *self)
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)
static struct gdb_exception | run_inferior_call (struct call_thread_fsm *sm, struct thread_info *call_thread, CORE_ADDR real_pc)
static void | cleanup_delete_std_terminate_breakpoint (void *ignore)
struct value * | call_function_by_hand (struct value *function, type *default_return_type, int nargs, struct value **args)
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)
void | _initialize_infcall (void)

## Variables
static int | coerce_float_to_double_p = 1
static int | unwind_on_signal_p = 0
static int | unwind_on_terminating_exception_p = 1
static struct thread_fsm_ops | call_thread_fsm_ops

## Macro Definition Documentation

## ◆ RAW_FUNCTION_ADDRESS_FORMAT

#define RAW_FUNCTION_ADDRESS_FORMAT "at 0x%s"

Definition at line 45 of file infcall.c.

Referenced by get_function_name().

## ◆ RAW_FUNCTION_ADDRESS_SIZE

#define RAW_FUNCTION_ADDRESS_SIZE

Value:
(sizeof (RAW_FUNCTION_ADDRESS_FORMAT) \
+ 2 * sizeof (CORE_ADDR))
CORE_ADDR
bfd_vma CORE_ADDR
Definition: common-types.h:41
RAW_FUNCTION_ADDRESS_FORMAT
#define RAW_FUNCTION_ADDRESS_FORMAT
Definition: infcall.c:45

Definition at line 46 of file infcall.c.

Referenced by call_function_by_hand_dummy().

## Function Documentation

## ◆ _initialize_infcall()

void _initialize_infcall | ( | void |  | ) |

Definition at line 1416 of file infcall.c.

References _, add_setshow_boolean_cmd(), class_obscure, coerce_float_to_double_p, no_class, setlist, show_coerce_float_to_double_p(), show_unwind_on_signal_p(), show_unwind_on_terminating_exception_p(), showlist, unwind_on_signal_p, and unwind_on_terminating_exception_p.

## ◆ call_function_by_hand()

struct value* call_function_by_hand | ( | struct value * | function,
|  | type * | default_return_type,
|  | int | nargs,
|  | struct value ** | args
| ) |  |

Definition at line 690 of file infcall.c.

References call_function_by_hand_dummy().

Referenced by ada_evaluate_subexp(), call_target_sbrk(), checkpoint_command(), elf_gnu_ifunc_resolve_addr(), eval_call(), evaluate_subexp_standard(), flush_ea_cache(), gdbscm_value_call(), inferior_call_waitpid(), linux_infcall_mmap(), linux_infcall_munmap(), lookup_child_selector(), lookup_objc_class(), print_object_command(), rust_evaluate_funcall(), valpy_call(), value_allocate_space_in_inferior(), value_nsstring(), value_x_binop(), and value_x_unop().

## ◆ call_function_by_hand_dummy()

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
| ) |  |

Definition at line 717 of file infcall.c.

References _, AT_ENTRY_POINT, bp_call_dummy, builtin_type(), builtin_type::builtin_void, check_typedef(), class_or_union_p(), cleanup_delete_std_terminate_breakpoint(), command_interp(), current_program_space, current_ui, discard_cleanups(), discard_infcall_control_state(), disp_del, breakpoint::disposition, do_cleanups(), dummy_frame_pop(), dummy_frame_push(), entry_point_address(), error(), gdb_exception::error, EXEC_REVERSE, execution_direction, find_function_addr(), find_pc_overlay(), find_thread_ptid(), frame_id_build(), gdb_assert, gdb_assert_not_reached, gdbarch_breakpoint_from_pc(), gdbarch_call_dummy_location(), gdbarch_frame_align(), gdbarch_frame_align_p(), gdbarch_frame_red_zone_size(), gdbarch_inner_than(), gdbarch_push_dummy_call(), gdbarch_push_dummy_call_p(), gdbarch_return_in_first_hidden_param_p(), get_current_frame(), get_current_regcache(), get_frame_arch(), get_frame_sp(), get_function_name(), get_last_thread_stack_temporary(), get_traceframe_number(), inferior_ptid, inferior_thread(), internal_error(), language_pass_by_reference(), lookup_pointer_type(), make_cleanup(), make_cleanup_restore_infcall_control_state(), make_cleanup_restore_infcall_suspend_state(), maybe_remove_breakpoints(), gdb_exception::message, name, new_call_thread_fsm(), noprocess(), null_cleanup(), observer_notify_inferior_call_post(), observer_notify_inferior_call_pre(), ON_STACK, symtab_and_line::pc, symtab_and_line::pspace, thread_info::ptid, ptid_equal(), push_dummy_code(), RAW_FUNCTION_ADDRESS_SIZE, gdb_exception::reason, register_dummy_frame_dtor(), breakpoint::related_breakpoint, restore_infcall_control_state(), RETURN_ERROR, RETURN_QUIT, call_thread_fsm::return_value, run_inferior_call(), save_infcall_control_state(), save_infcall_suspend_state(), symtab_and_line::section, set_longjmp_breakpoint_for_call_dummy(), set_momentary_breakpoint(), set_std_terminate_breakpoint(), STOP_NONE, stop_stack_dummy, STOP_STD_TERMINATE, stopped_by_random_signal, string, target_has_execution, thread_info::thread_fsm, call_thread_fsm::thread_fsm, thread_fsm_clean_up(), thread_fsm_delete(), thread_fsm_finished_p(), thread_stack_temporaries_enabled_p(), throw_error(), throw_exception(), TYPE_CODE, TYPE_CODE_METHOD, TYPE_CODE_PTR, TYPE_FIELD_TYPE, TYPE_LENGTH, TYPE_NFIELDS, TYPE_PROTOTYPED, TYPE_TARGET_TYPE, unwind_on_signal_p, unwind_on_terminating_exception_p, using_struct_return(), value_addr(), value_address(), value_arg_coerce(), value_from_pointer(), value_type(), write_memory(), xfree(), and XNEWVEC.

Referenced by call_function_by_hand(), and compile_object_run().

## ◆ call_thread_fsm_should_notify_stop()

static int call_thread_fsm_should_notify_stop | ( | struct thread_fsm * | self | ) |
| static

Definition at line 557 of file infcall.c.

References thread_fsm_finished_p().

## ◆ call_thread_fsm_should_stop()

static int call_thread_fsm_should_stop | ( | struct thread_fsm * | self,
|  | struct thread_info * | thread
| ) |  |
| static

Definition at line 530 of file infcall.c.

References current_ui, get_call_return_value(), make_scoped_restore(), target_terminal::ours(), PROMPT_NEEDED, ui::prompt_state, call_thread_fsm::return_meta_info, call_thread_fsm::return_value, stop_stack_dummy, STOP_STACK_DUMMY, thread_fsm_set_finished(), and call_thread_fsm::waiting_ui.

## ◆ cleanup_delete_std_terminate_breakpoint()

static void cleanup_delete_std_terminate_breakpoint | ( | void * | ignore | ) |
| static

Definition at line 682 of file infcall.c.

References delete_std_terminate_breakpoint().

Referenced by call_function_by_hand_dummy().

## ◆ error_call_unknown_return_type()

void error_call_unknown_return_type | ( | const char * | func_name | ) |

Definition at line 346 of file infcall.c.

References _, and error().

Referenced by ada_evaluate_subexp(), and eval_call().

## ◆ find_function_addr()

CORE_ADDR find_function_addr | ( | struct value * | function,
|  | struct type ** | retval_type
| ) |  |

Definition at line 250 of file infcall.c.

References _, check_typedef(), current_target, error(), find_function_return_type(), gdbarch_convert_from_func_ptr_addr(), gdbarch_deprecated_function_start_offset(), get_type_arch(), gnu_ifunc_resolve_addr, lval_memory, TYPE_CODE, TYPE_CODE_FUNC, TYPE_CODE_INT, TYPE_CODE_METHOD, TYPE_CODE_PTR, TYPE_GNU_IFUNC, TYPE_LENGTH, TYPE_TARGET_TYPE, value_addr(), value_address(), value_as_address(), value_as_long(), VALUE_LVAL, and value_type().

Referenced by alpha_push_dummy_call(), call_function_by_hand_dummy(), evaluate_subexp_standard(), frv_push_dummy_call(), ia64_push_dummy_call(), mep_push_dummy_call(), mips_eabi_push_dummy_call(), mips_n32n64_push_dummy_call(), mips_o32_push_dummy_call(), mips_o32_return_value(), mips_o64_push_dummy_call(), mips_o64_return_value(), mn10300_push_dummy_call(), nios2_push_dummy_call(), ppc64_sysv_abi_push_dummy_call(), rs6000_lynx178_push_dummy_call(), rs6000_push_dummy_call(), tic6x_push_dummy_call(), and value_ind().

## ◆ find_function_return_type()

static struct type* find_function_return_type | ( | CORE_ADDR | pc | ) |
| static

Definition at line 235 of file infcall.c.

References BLOCK_START, find_pc_function(), SYMBOL_BLOCK_VALUE, SYMBOL_TYPE, and TYPE_TARGET_TYPE.

Referenced by find_function_addr().

## ◆ get_call_return_value()

static struct value* get_call_return_value | ( | struct call_return_meta_info * | ri | ) |
| static

Definition at line 419 of file infcall.c.

References allocate_value(), class_or_union_p(), call_return_meta_info::function, gdb_assert, call_return_meta_info::gdbarch, gdbarch_return_value(), get_current_regcache(), inferior_ptid, push_thread_stack_temporary(), read_value_memory(), call_return_meta_info::struct_addr, call_return_meta_info::struct_return_p, thread_stack_temporaries_enabled_p(), TYPE_CODE, TYPE_CODE_VOID, TYPE_LENGTH, value_contents_raw(), value_force_lval(), value_from_contents_and_address(), and call_return_meta_info::value_type.

Referenced by call_thread_fsm_should_stop().

## ◆ get_function_name()

static const char* get_function_name | ( | CORE_ADDR | funaddr,
|  | char * | buf,
|  | int | buf_size
| ) |  |
| static

Definition at line 364 of file infcall.c.

References _, find_pc_function(), gdb_assert, hex_string(), lookup_minimal_symbol_by_pc(), bound_minimal_symbol::minsym, MSYMBOL_PRINT_NAME, RAW_FUNCTION_ADDRESS_FORMAT, SYMBOL_PRINT_NAME, xfree(), and xstrprintf().

Referenced by call_function_by_hand_dummy().

## ◆ new_call_thread_fsm()

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
| ) |  |
| static

Definition at line 506 of file infcall.c.

References call_thread_fsm_ops, call_return_meta_info::function, call_return_meta_info::gdbarch, call_thread_fsm::return_meta_info, call_return_meta_info::struct_addr, call_return_meta_info::struct_return_p, call_thread_fsm::thread_fsm, thread_fsm_ctor(), call_return_meta_info::value_type, value_type(), call_thread_fsm::waiting_ui, and XCNEW.

Referenced by call_function_by_hand_dummy().

## ◆ push_dummy_code()

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
| ) |  |
| static

Definition at line 329 of file infcall.c.

References gdb_assert, gdbarch_push_dummy_code(), gdbarch_push_dummy_code_p(), and value_type().

Referenced by call_function_by_hand_dummy(), and set_gdbarch_push_dummy_code().

## ◆ run_inferior_call()

static struct gdb_exception run_inferior_call | ( | struct call_thread_fsm * | sm,
|  | struct thread_info * | call_thread,
|  | CORE_ADDR | real_pc
| ) |  |
| static

Definition at line 580 of file infcall.c.

References ui::async, breakpoint_auto_delete(), CATCH, clear_proceed_status(), thread_info::control, current_ui, delete_file_handler(), disable_watchpoints_before_interactive_call_start(), enable_watchpoints_after_interactive_call_stop(), END_CATCH, exception_none, find_thread_ptid(), finish_thread_state(), thread_control_state::in_infcall, inferior_ptid, ui::input_fd, proceed(), thread_control_state::proceed_to_finish, PROMPT_BLOCKED, ui::prompt_state, thread_info::ptid, ptid_equal(), gdb_exception::reason, RETURN_MASK_ALL, thread_info::state, thread_control_state::stop_bpstat, stop_stack_dummy, STOP_STACK_DUMMY, thread_info::thread_fsm, THREAD_RUNNING, TRY, ui_register_input_event_handler(), user_visible_resume_ptid(), and wait_sync_command_done().

Referenced by call_function_by_hand_dummy().

## ◆ show_coerce_float_to_double_p()

static void show_coerce_float_to_double_p | ( | struct ui_file * | file,
|  | int | from_tty,
|  | struct cmd_list_element * | c,
|  | const char * | value
| ) |  |
| static

Definition at line 77 of file infcall.c.

References _, and fprintf_filtered().

Referenced by _initialize_infcall().

## ◆ show_unwind_on_signal_p()

static void show_unwind_on_signal_p | ( | struct ui_file * | file,
|  | int | from_tty,
|  | struct cmd_list_element * | c,
|  | const char * | value
| ) |  |
| static

Definition at line 95 of file infcall.c.

References _, and fprintf_filtered().

Referenced by _initialize_infcall().

## ◆ show_unwind_on_terminating_exception_p()

static void show_unwind_on_terminating_exception_p | ( | struct ui_file * | file,
|  | int | from_tty,
|  | struct cmd_list_element * | c,
|  | const char * | value
| ) |  |
| static

Definition at line 119 of file infcall.c.

References _, and fprintf_filtered().

Referenced by _initialize_infcall().

## ◆ value_arg_coerce()

static struct value* value_arg_coerce | ( | struct gdbarch * | gdbarch,
|  | struct value * | arg,
|  | struct type * | param_type,
|  | int | is_prototyped,
|  | CORE_ADDR * | sp
| ) |  |
| static

Definition at line 139 of file infcall.c.

References ada_convert_actual(), builtin_type::builtin_double, builtin_type::builtin_int, builtin_type::builtin_long_double, builtin_type(), language_defn::c_style_arrays, check_typedef(), coerce_float_to_double_p, current_language, language_defn::la_language, language_ada, lookup_pointer_type(), TYPE_CODE, TYPE_CODE_ARRAY, TYPE_CODE_BOOL, TYPE_CODE_CHAR, TYPE_CODE_COMPLEX, TYPE_CODE_ENUM, TYPE_CODE_ERROR, TYPE_CODE_FLT, TYPE_CODE_FUNC, TYPE_CODE_INT, TYPE_CODE_MEMBERPTR, TYPE_CODE_METHOD, TYPE_CODE_METHODPTR, TYPE_CODE_PTR, TYPE_CODE_RANGE, TYPE_CODE_REF, TYPE_CODE_RVALUE_REF, TYPE_CODE_SET, TYPE_CODE_STRING, TYPE_CODE_STRUCT, TYPE_CODE_UNDEF, TYPE_CODE_UNION, TYPE_CODE_VOID, TYPE_IS_REFERENCE, TYPE_LENGTH, TYPE_TARGET_TYPE, TYPE_VECTOR, value_cast(), value_cast_pointers(), value_coerce_to_target(), value_ref(), and value_type().

Referenced by call_function_by_hand_dummy().

## Variable Documentation

## ◆ call_thread_fsm_ops

struct thread_fsm_ops call_thread_fsm_ops
| static

Initial value:
=
{
NULL,
NULL,
call_thread_fsm_should_stop,
NULL,
NULL,
call_thread_fsm_should_notify_stop,
}
call_thread_fsm_should_stop
static int call_thread_fsm_should_stop(struct thread_fsm *self, struct thread_info *thread)
Definition: infcall.c:530
call_thread_fsm_should_notify_stop
static int call_thread_fsm_should_notify_stop(struct thread_fsm *self)
Definition: infcall.c:557

Definition at line 493 of file infcall.c.

Referenced by new_call_thread_fsm().

## ◆ coerce_float_to_double_p

int coerce_float_to_double_p = 1
| static

Definition at line 75 of file infcall.c.

Referenced by _initialize_infcall(), and value_arg_coerce().

## ◆ unwind_on_signal_p

int unwind_on_signal_p = 0
| static

Definition at line 93 of file infcall.c.

Referenced by _initialize_infcall(), and call_function_by_hand_dummy().

## ◆ unwind_on_terminating_exception_p

int unwind_on_terminating_exception_p = 1
| static

Definition at line 116 of file infcall.c.

Referenced by _initialize_infcall(), and call_function_by_hand_dummy().