GDB (xrefs)

Macros | Functions | Variables
fork-inferior.h File Reference
`#include <string>`

Go to the source code of this file.

## Macros
#define | START_INFERIOR_TRAPS_EXPECTED 1

## Functions
pid_t | fork_inferior (const char *exec_file_arg, const std::string &allargs, char **env, void(*traceme_fun)(), void(*init_trace_fun)(int), void(*pre_trace_fun)(), const char *shell_file_arg, void(*exec_fun)(const char *file, char *const *argv, char *const *env))
ptid_t | startup_inferior (pid_t pid, int ntraps, struct target_waitstatus *mystatus, ptid_t *myptid)
void | prefork_hook (const char *args)
void | postfork_hook (pid_t pid)
void | postfork_child_hook ()
void | gdb_flush_out_err ()
void | trace_start_error (const char *fmt,...) ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF(1
void void | trace_start_error_with_name (const char *string) ATTRIBUTE_NORETURN

## Variables
int | startup_with_shell

## Macro Definition Documentation

## ◆ START_INFERIOR_TRAPS_EXPECTED

#define START_INFERIOR_TRAPS_EXPECTED 1

Definition at line 29 of file fork-inferior.h.

Referenced by darwin_ptrace_him(), gnu_create_inferior(), inf_ptrace_create_inferior(), and procfs_init_inferior().

## Function Documentation

## ◆ fork_inferior()

pid_t fork_inferior | ( | const char * | exec_file_arg,
|  | const std::string & | allargs,
|  | char ** | env,
|  | void(*)() | traceme_fun,
|  | void(*)(int) | init_trace_fun,
|  | void(*)() | pre_trace_fun,
|  | const char * | shell_file_arg,
|  | void(*)(const char *file, char *const *argv, char *const *env) | exec_fun
| ) |  |

Definition at line 287 of file fork-inferior.c.

References execv_argv::argv(), gdb::argv, close_most_fds(), environ, gdb_assert, gdb_flush_out_err(), gdb_tilde_expand(), get_exec_file(), get_inferior_cwd(), get_startup_shell(), perror_with_name(), pid, postfork_child_hook(), postfork_hook(), prefork_hook(), restore_original_signals_state(), safe_strerror(), startup_with_shell, string, trace_start_error_with_name(), and warning().

Referenced by darwin_create_inferior(), gnu_create_inferior(), inf_ptrace_create_inferior(), and procfs_create_inferior().

## ◆ gdb_flush_out_err()

void gdb_flush_out_err | ( |  | ) |

Definition at line 49 of file fork-child.c.

References gdb_flush(), ui::m_gdb_stderr, ui::m_gdb_stdout, and main_ui.

Referenced by fork_inferior(), and trace_start_error().

## ◆ postfork_child_hook()

void postfork_child_hook | ( |  | ) |

Definition at line 103 of file fork-child.c.

References _, create_tty_session(), current_ui, gdb_setpgid(), main_ui, and new_tty().

Referenced by fork_inferior().

## ◆ postfork_hook()

void postfork_hook | ( | pid_t | pid | ) |

Definition at line 79 of file fork-child.c.

References current_inferior(), current_ui, gdb_assert, have_inferiors(), arm-linux::inf, inferior_appeared(), inferior_ptid, init_thread_list(), new_tty_postfork(), pid, pid_to_ptid(), and saved_ui.

Referenced by fork_inferior().

## ◆ prefork_hook()

void prefork_hook | ( | const char * | args | ) |

Definition at line 62 of file fork-child.c.

References current_ui, gdb_assert, get_inferior_io_terminal(), new_tty_prefork(), and saved_ui.

Referenced by fork_inferior().

## ◆ startup_inferior()

ptid_t startup_inferior | ( | pid_t | pid,
|  | int | ntraps,
|  | struct target_waitstatus * | mystatus,
|  | ptid_t * | myptid
| ) |  |

Definition at line 472 of file fork-inferior.c.

References _, error(), target_waitstatus::execd_pathname, gdb_signal_to_name(), gdb_signal_to_string(), get_exec_wrapper(), target_terminal::inferior(), target_terminal::init(), target_waitstatus::integer, target_waitstatus::kind, memset(), minus_one_ptid, target_terminal::ours(), pid, pid_to_ptid(), resume_signal, target_waitstatus::sig, startup_with_shell, switch_to_thread(), target_continue(), target_continue_no_signal(), target_mourn_inferior(), target_supports_multi_process(), target_wait(), TARGET_WAITKIND_EXECD, TARGET_WAITKIND_EXITED, TARGET_WAITKIND_FORKED, TARGET_WAITKIND_IGNORE, TARGET_WAITKIND_LOADED, TARGET_WAITKIND_SIGNALLED, TARGET_WAITKIND_SPURIOUS, TARGET_WAITKIND_STOPPED, TARGET_WAITKIND_SYSCALL_ENTRY, TARGET_WAITKIND_SYSCALL_RETURN, TARGET_WAITKIND_VFORKED, target_waitstatus::value, and xfree().

Referenced by gdb_startup_inferior().

## ◆ trace_start_error()

void trace_start_error | ( | const char * | fmt,
|  |  | ...
| ) |  |

## ◆ trace_start_error_with_name()

void void trace_start_error_with_name | ( | const char * | string | ) |

Definition at line 613 of file fork-inferior.c.

References safe_strerror(), and trace_start_error().

Referenced by darwin_ptrace_me(), fork_inferior(), gnu_ptrace_me(), and inf_ptrace_me().

## Variable Documentation

## ◆ startup_with_shell

int startup_with_shell

Definition at line 111 of file infcmd.c.

Referenced by _initialize_fork_child(), construct_inferior_arguments(), extended_remote_create_inferior(), fork_inferior(), and startup_inferior().