GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions | Variables
fbsd-nat.c File Reference
#include "defs.h"
#include "gdbsupport/block-signals.h"
#include "gdbsupport/byte-vector.h"
#include "gdbsupport/event-loop.h"
#include "gdbcore.h"
#include "inferior.h"
#include "regcache.h"
#include "regset.h"
#include "gdbarch.h"
#include "gdbcmd.h"
#include "gdbthread.h"
#include "gdbsupport/buildargv.h"
#include "gdbsupport/gdb_wait.h"
#include "inf-loop.h"
#include "inf-ptrace.h"
#include <sys/types.h>
#include <sys/procfs.h>
#include <sys/ptrace.h>
#include <sys/signal.h>
#include <sys/sysctl.h>
#include <sys/user.h>
#include <libutil.h>
#include "elf-bfd.h"
#include "fbsd-nat.h"
#include "fbsd-tdep.h"

Go to the source code of this file.

Classes

struct  fbsd_inferior
 

Macros

#define PT_GETREGSET   42 /* Get a target register set */
 
#define PT_SETREGSET   43 /* Set a target register set */
 
#define fbsd_lwp_debug_printf(fmt, ...)    debug_prefixed_printf_cond (debug_fbsd_lwp, "fbsd-lwp", fmt, ##__VA_ARGS__)
 
#define fbsd_nat_debug_printf(fmt, ...)    debug_prefixed_printf_cond (debug_fbsd_nat, "fbsd-nat", fmt, ##__VA_ARGS__)
 
#define fbsd_nat_debug_start_end(fmt, ...)    scoped_debug_start_end (debug_fbsd_nat, "fbsd-nat", fmt, ##__VA_ARGS__)
 

Typedefs

typedef bool ptrace_event_ftype(const struct ptrace_lwpinfo &pl)
 

Functions

static fbsd_inferiorget_fbsd_inferior (inferior *inf)
 
static gdb::unique_xmalloc_ptr< char > fbsd_fetch_cmdline (pid_t pid)
 
static bool fbsd_fetch_kinfo_proc (pid_t pid, struct kinfo_proc *kp)
 
static size_t fbsd_siginfo_size ()
 
static void fbsd_convert_siginfo (siginfo_t *si)
 
static void show_fbsd_lwp_debug (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
 
static void show_fbsd_nat_debug (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
 
static void fbsd_enable_proc_events (pid_t pid)
 
static void fbsd_add_threads (fbsd_nat_target *target, pid_t pid)
 
static void sigchld_handler (int signo)
 
static void handle_target_event (int error, gdb_client_data client_data)
 
static bool iterate_other_ptrace_events (pid_t pid, gdb::function_view< ptrace_event_ftype > callback)
 
static bool pending_ptrace_events (inferior *inf)
 
bool fbsd_nat_get_siginfo (ptid_t ptid, siginfo_t *siginfo)
 
void _initialize_fbsd_nat ()
 

Variables

static bool debug_fbsd_lwp
 
static bool debug_fbsd_nat
 

Macro Definition Documentation

◆ fbsd_lwp_debug_printf

#define fbsd_lwp_debug_printf ( fmt,
... )    debug_prefixed_printf_cond (debug_fbsd_lwp, "fbsd-lwp", fmt, ##__VA_ARGS__)

Definition at line 799 of file fbsd-nat.c.

Referenced by fbsd_add_threads(), and fbsd_nat_target::wait_1().

◆ fbsd_nat_debug_printf

#define fbsd_nat_debug_printf ( fmt,
... )    debug_prefixed_printf_cond (debug_fbsd_nat, "fbsd-nat", fmt, ##__VA_ARGS__)

◆ fbsd_nat_debug_start_end

#define fbsd_nat_debug_start_end ( fmt,
... )    scoped_debug_start_end (debug_fbsd_nat, "fbsd-nat", fmt, ##__VA_ARGS__)

Definition at line 805 of file fbsd-nat.c.

Referenced by fbsd_nat_target::detach(), and fbsd_nat_target::resume().

◆ PT_GETREGSET

#define PT_GETREGSET   42 /* Get a target register set */

◆ PT_SETREGSET

#define PT_SETREGSET   43 /* Set a target register set */

Definition at line 52 of file fbsd-nat.c.

Referenced by fbsd_nat_target::store_regset().

Typedef Documentation

◆ ptrace_event_ftype

typedef bool ptrace_event_ftype(const struct ptrace_lwpinfo &pl)

Definition at line 1930 of file fbsd-nat.c.

Function Documentation

◆ _initialize_fbsd_nat()

void _initialize_fbsd_nat ( )

◆ fbsd_add_threads()

static void fbsd_add_threads ( fbsd_nat_target * target,
pid_t pid )
static

◆ fbsd_convert_siginfo()

static void fbsd_convert_siginfo ( siginfo_t * si)
static

Definition at line 573 of file fbsd-nat.c.

References gdbarch_long_bit(), get_current_frame(), and get_frame_arch().

Referenced by fbsd_nat_target::xfer_partial().

◆ fbsd_enable_proc_events()

static void fbsd_enable_proc_events ( pid_t pid)
static

◆ fbsd_fetch_cmdline()

static gdb::unique_xmalloc_ptr< char > fbsd_fetch_cmdline ( pid_t pid)
static

Definition at line 199 of file fbsd-nat.c.

References pid, and xmalloc().

Referenced by fbsd_nat_target::info_proc().

◆ fbsd_fetch_kinfo_proc()

static bool fbsd_fetch_kinfo_proc ( pid_t pid,
struct kinfo_proc * kp )
static

Definition at line 233 of file fbsd-nat.c.

References pid.

Referenced by fbsd_nat_target::info_proc(), and fbsd_nat_target::wait_1().

◆ fbsd_nat_get_siginfo()

bool fbsd_nat_get_siginfo ( ptid_t ptid,
siginfo_t * siginfo )

Definition at line 2460 of file fbsd-nat.c.

References get_ptrace_pid(), pid, PL_FLAG_SI, and ptrace.

◆ fbsd_siginfo_size()

static size_t fbsd_siginfo_size ( )
static

Definition at line 556 of file fbsd-nat.c.

References gdbarch_long_bit(), get_current_frame(), and get_frame_arch().

Referenced by fbsd_nat_target::xfer_partial().

◆ get_fbsd_inferior()

static fbsd_inferior * get_fbsd_inferior ( inferior * inf)
inlinestatic

◆ handle_target_event()

static void handle_target_event ( int error,
gdb_client_data client_data )
static

Definition at line 1046 of file fbsd-nat.c.

References INF_REG_EVENT, and inferior_event_handler().

◆ iterate_other_ptrace_events()

static bool iterate_other_ptrace_events ( pid_t pid,
gdb::function_view< ptrace_event_ftype > callback )
static

Definition at line 1933 of file fbsd-nat.c.

References pid, and ptrace.

Referenced by fbsd_nat_target::kill(), and pending_ptrace_events().

◆ pending_ptrace_events()

static bool pending_ptrace_events ( inferior * inf)
static

Definition at line 1972 of file fbsd-nat.c.

References iterate_other_ptrace_events(), inf::pid, and PL_FLAG_SI.

Referenced by fbsd_nat_target::detach().

◆ show_fbsd_lwp_debug()

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

Definition at line 785 of file fbsd-nat.c.

References gdb_printf().

Referenced by _initialize_fbsd_nat().

◆ show_fbsd_nat_debug()

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

Definition at line 792 of file fbsd-nat.c.

References gdb_printf().

Referenced by _initialize_fbsd_nat().

◆ sigchld_handler()

static void sigchld_handler ( int signo)
static

Definition at line 1034 of file fbsd-nat.c.

References inf_ptrace_target::async_file_mark_if_open().

Referenced by _initialize_fbsd_nat().

Variable Documentation

◆ debug_fbsd_lwp

bool debug_fbsd_lwp
static

Definition at line 781 of file fbsd-nat.c.

Referenced by _initialize_fbsd_nat().

◆ debug_fbsd_nat

bool debug_fbsd_nat
static

Definition at line 782 of file fbsd-nat.c.

Referenced by _initialize_fbsd_nat(), and fbsd_nat_target::wait_1().