GDBserver

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 post_fork_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(), close_most_fds(), environ, errno, gdb_assert, gdb_flush_out_err(), gdb_tilde_expand(), get_exec_file(), get_inferior_cwd(), get_startup_shell(), perror_with_name(), 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 linux_create_inferior(), lynx_create_inferior(), and spu_create_inferior().

## ◆ gdb_flush_out_err()

void gdb_flush_out_err | ( |  | ) |

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

Referenced by fork_inferior(), and trace_start_error().

## ◆ postfork_child_hook()

void postfork_child_hook | ( |  | ) |

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

References _, gdb_setpgid(), and perror().

Referenced by fork_inferior().

## ◆ postfork_hook()

void postfork_hook | ( | pid_t | pid | ) |

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

Referenced by fork_inferior().

## ◆ prefork_hook()

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

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

References cont_thread, debug_flush(), debug_printf(), debug_threads, and null_ptid.

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(), gdb_signal_to_name(), gdb_signal_to_string(), get_exec_wrapper(), last_ptid, memset(), minus_one_ptid, pid_to_ptid(), startup_with_shell, switch_to_thread(), target_continue(), target_continue_no_signal(), target_mourn_inferior(), target_supports_multi_process(), target_wait(), and xfree().

Referenced by post_fork_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 errno, safe_strerror(), and trace_start_error().

Referenced by fork_inferior(), linux_ptrace_fun(), lynx_ptrace_fun(), and spu_ptrace_fun().

## Variable Documentation

## ◆ startup_with_shell

int startup_with_shell

Definition at line 67 of file server.c.

Referenced by captured_main(), fork_inferior(), handle_general_set(), and startup_inferior().