GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Macros | Functions | Variables
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 "f-lang.h"
#include "gdbthread.h"
#include "event-top.h"
#include "observable.h"
#include "top.h"
#include "ui.h"
#include "interps.h"
#include "thread-fsm.h"
#include <algorithm>
#include "gdbsupport/scope-exit.h"
#include <list>

Go to the source code of this file.

Classes

struct  call_return_meta_info
 
struct  call_thread_fsm
 
struct  destructor_info
 

Macros

#define infcall_debug_printf(fmt, ...)    debug_prefixed_printf_cond (debug_infcall, "infcall", fmt, ##__VA_ARGS__)
 
#define INFCALL_SCOPED_DEBUG_ENTER_EXIT    scoped_debug_enter_exit (debug_infcall, "infcall")
 
#define INFCALL_SCOPED_DEBUG_START_END(fmt, ...)    scoped_debug_start_end (debug_infrun, "infcall", fmt, ##__VA_ARGS__)
 
#define RAW_FUNCTION_ADDRESS_FORMAT   "at 0x%s"
 
#define RAW_FUNCTION_ADDRESS_SIZE
 

Functions

static void show_debug_infcall (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
 
static void show_may_call_functions_p (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
 
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 valuevalue_arg_coerce (struct gdbarch *gdbarch, struct value *arg, struct type *param_type, int is_prototyped)
 
CORE_ADDR find_function_addr (struct value *function, struct type **retval_type, struct type **function_type)
 
static CORE_ADDR push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, gdb::array_view< value * > args, 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 valueget_call_return_value (struct call_return_meta_info *ri)
 
static struct gdb_exception run_inferior_call (std::unique_ptr< call_thread_fsm > sm, struct thread_info *call_thread, CORE_ADDR real_pc)
 
static CORE_ADDR reserve_stack_space (const type *values_type, CORE_ADDR &sp)
 
static void call_destructors (const std::list< destructor_info > &dtors_to_invoke, struct type *default_return_type)
 
struct valuecall_function_by_hand (struct value *function, type *default_return_type, gdb::array_view< value * > args)
 
struct valuecall_function_by_hand_dummy (struct value *function, type *default_return_type, gdb::array_view< value * > args, dummy_frame_dtor_ftype *dummy_dtor, void *dummy_dtor_data)
 
void _initialize_infcall ()
 

Variables

static bool debug_infcall = false
 
static bool may_call_functions_p = true
 
static bool coerce_float_to_double_p = true
 
static bool unwind_on_signal_p = false
 
static bool unwind_on_terminating_exception_p = true
 

Macro Definition Documentation

◆ infcall_debug_printf

#define infcall_debug_printf ( fmt,
... )    debug_prefixed_printf_cond (debug_infcall, "infcall", fmt, ##__VA_ARGS__)

◆ INFCALL_SCOPED_DEBUG_ENTER_EXIT

#define INFCALL_SCOPED_DEBUG_ENTER_EXIT    scoped_debug_enter_exit (debug_infcall, "infcall")

◆ INFCALL_SCOPED_DEBUG_START_END

#define INFCALL_SCOPED_DEBUG_START_END ( fmt,
... )    scoped_debug_start_end (debug_infrun, "infcall", fmt, ##__VA_ARGS__)

Definition at line 64 of file infcall.c.

◆ RAW_FUNCTION_ADDRESS_FORMAT

#define RAW_FUNCTION_ADDRESS_FORMAT   "at 0x%s"

Definition at line 78 of file infcall.c.

Referenced by get_function_name().

◆ RAW_FUNCTION_ADDRESS_SIZE

#define RAW_FUNCTION_ADDRESS_SIZE
Value:
+ 2 * sizeof (CORE_ADDR))
#define RAW_FUNCTION_ADDRESS_FORMAT
Definition infcall.c:78

Definition at line 79 of file infcall.c.

Referenced by call_function_by_hand_dummy().

Function Documentation

◆ _initialize_infcall()

void _initialize_infcall ( )

Definition at line 1641 of file infcall.c.

Referenced by initialize_all_files().

◆ call_destructors()

static void call_destructors ( const std::list< destructor_info > & dtors_to_invoke,
struct type * default_return_type )
static

Definition at line 811 of file infcall.c.

References call_function_by_hand().

Referenced by call_function_by_hand_dummy().

◆ call_function_by_hand()

struct value * call_function_by_hand ( struct value * function,
type * default_return_type,
gdb::array_view< value * > args )

◆ call_function_by_hand_dummy()

struct value * call_function_by_hand_dummy ( struct value * function,
type * default_return_type,
gdb::array_view< value * > args,
dummy_frame_dtor_ftype * dummy_dtor,
void * dummy_dtor_data )

Definition at line 851 of file infcall.c.

References value::address, AT_ENTRY_POINT, bp_call_dummy, builtin_type(), builtin_type::builtin_void, call_destructors(), call_function_by_hand(), call_thread_fsm::call_thread_fsm(), check_typedef(), class_or_union_p(), type::code(), command_interp(), current_program_space, current_ui, delete_std_terminate_breakpoint(), discard_infcall_control_state(), disp_del, breakpoint::disposition, dummy_frame_pop(), dummy_frame_push(), entry_point_address(), EVAL_NORMAL, EXEC_REVERSE, execution_direction, type::field(), field_name(), find_function_addr(), find_function_in_inferior(), find_overload_match(), find_pc_overlay(), frame_id_build(), 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(), infcall_debug_printf, INFCALL_SCOPED_DEBUG_ENTER_EXIT, gdb::observers::inferior_call_post, gdb::observers::inferior_call_pre, inferior_ptid, inferior_thread(), is_nocall_function(), type::is_prototyped(), type::is_stub(), language_pass_by_reference(), type::length(), lookup_pointer_type(), may_call_functions_p, maybe_remove_breakpoints(), METHOD, name, type::name(), noprocess(), type::num_fields(), ON_STACK, symtab_and_line::pc, symtab_and_line::pspace, push_dummy_code(), push_thread_stack_temporary(), RAW_FUNCTION_ADDRESS_SIZE, register_dummy_frame_dtor(), breakpoint::related_breakpoint, reserve_stack_space(), restore_infcall_control_state(), return_method_hidden_param, return_method_normal, return_method_struct, 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, target_has_execution(), type::target_type(), THREAD_EXITED, thread_stack_temporaries_enabled_p(), thread_state_string(), field::type(), value::type(), TYPE_FN_FIELD_PHYSNAME, TYPE_FN_FIELDLIST1, TYPE_FN_FIELDLIST_NAME, TYPE_NFN_FIELDS, unwind_on_signal_p, unwind_on_terminating_exception_p, using_struct_return(), value_arg_coerce(), value_from_contents_and_address(), value_from_pointer(), and write_memory().

Referenced by call_function_by_hand(), and compile_object_run().

◆ error_call_unknown_return_type()

void error_call_unknown_return_type ( const char * func_name)

Definition at line 395 of file infcall.c.

Referenced by expr::ada_funcall_operation::evaluate(), and evaluate_subexp_do_call().

◆ find_function_addr()

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

◆ get_call_return_value()

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

◆ get_function_name()

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

◆ push_dummy_code()

static CORE_ADDR push_dummy_code ( struct gdbarch * gdbarch,
CORE_ADDR sp,
CORE_ADDR funaddr,
gdb::array_view< value * > args,
struct type * value_type,
CORE_ADDR * real_pc,
CORE_ADDR * bp_addr,
struct regcache * regcache )
static

◆ reserve_stack_space()

static CORE_ADDR reserve_stack_space ( const type * values_type,
CORE_ADDR & sp )
static

◆ run_inferior_call()

static struct gdb_exception run_inferior_call ( std::unique_ptr< call_thread_fsm > sm,
struct thread_info * call_thread,
CORE_ADDR real_pc )
static

◆ 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 121 of file infcall.c.

References gdb_printf().

◆ show_debug_infcall()

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

Definition at line 70 of file infcall.c.

References gdb_printf().

◆ show_may_call_functions_p()

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

Definition at line 90 of file infcall.c.

References gdb_printf().

◆ 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 139 of file infcall.c.

References gdb_printf().

◆ 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 163 of file infcall.c.

References gdb_printf().

◆ value_arg_coerce()

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

Variable Documentation

◆ coerce_float_to_double_p

bool coerce_float_to_double_p = true
static

Definition at line 119 of file infcall.c.

Referenced by value_arg_coerce().

◆ debug_infcall

bool debug_infcall = false
static

Definition at line 50 of file infcall.c.

◆ may_call_functions_p

bool may_call_functions_p = true
static

Definition at line 88 of file infcall.c.

Referenced by call_function_by_hand_dummy().

◆ unwind_on_signal_p

bool unwind_on_signal_p = false
static

Definition at line 137 of file infcall.c.

Referenced by call_function_by_hand_dummy(), and call_thread_fsm::should_notify_stop().

◆ unwind_on_terminating_exception_p

bool unwind_on_terminating_exception_p = true
static

Definition at line 160 of file infcall.c.

Referenced by call_function_by_hand_dummy(), and call_thread_fsm::should_notify_stop().