GDBserver

Classes | Macros | Functions | Variables
fork-inferior.c File Reference
`#include "common-defs.h"`
`#include "fork-inferior.h"`
`#include "target/waitstatus.h"`
`#include "filestuff.h"`
`#include "target/target.h"`
`#include "common-inferior.h"`
`#include "common-gdbthread.h"`
`#include "signals-state-save-restore.h"`
`#include "gdb_tilde_expand.h"`
`#include <vector>`

Go to the source code of this file.

## Classes
class | execv_argv

## Macros
#define | SHELL_FILE "/bin/sh"

## Functions
static bool | escape_bang_in_quoted_argument (const char *shell_file)
static const char * | get_startup_shell ()
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 *last_waitstatus, ptid_t *last_ptid)
void | trace_start_error (const char *fmt,...)
void | trace_start_error_with_name (const char *string)

## Variables
char ** | environ

## Macro Definition Documentation

## ◆ SHELL_FILE

#define SHELL_FILE "/bin/sh"

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

Referenced by get_startup_shell().

## Function Documentation

## ◆ escape_bang_in_quoted_argument()

static bool escape_bang_in_quoted_argument | ( | const char * | shell_file | ) |
| static

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

Referenced by execv_argv::init_for_shell().

## ◆ 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().

## ◆ get_startup_shell()

static const char* get_startup_shell | ( |  | ) |
| static

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

References SHELL_FILE.

Referenced by fork_inferior().

## ◆ startup_inferior()

ptid_t startup_inferior | ( | pid_t | pid,
|  | int | ntraps,
|  | struct target_waitstatus * | last_waitstatus,
|  | ptid_t * | last_ptid
| ) |  |

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

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

References gdb_flush_out_err(), vwarning(), and warning().

Referenced by trace_start_error_with_name().

## ◆ trace_start_error_with_name()

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

## ◆ environ

char** environ

Referenced by fork_inferior(), and gdb_environ::from_host_environ().