GDB (xrefs)

Classes | Macros | Functions | Variables
/tmp/gdb-8.1/gdb/corelow.c File Reference
`#include "defs.h"`
`#include "arch-utils.h"`
`#include <signal.h>`
`#include <fcntl.h>`
`#include <sys/file.h>`
`#include "frame.h"`
`#include "inferior.h"`
`#include "infrun.h"`
`#include "symtab.h"`
`#include "command.h"`
`#include "bfd.h"`
`#include "target.h"`
`#include "gdbcore.h"`
`#include "gdbthread.h"`
`#include "regcache.h"`
`#include "regset.h"`
`#include "symfile.h"`
`#include "exec.h"`
`#include "readline/readline.h"`
`#include "solib.h"`
`#include "filenames.h"`
`#include "progspace.h"`
`#include "objfiles.h"`
`#include "gdb_bfd.h"`
`#include "completer.h"`
`#include "filestuff.h"`

Go to the source code of this file.

## Classes
struct | spuid_list

## Macros
#define | O_LARGEFILE 0
#define | CORELOW_PID 1

## Functions
static void | core_files_info (struct target_ops *)
static struct core_fns * | sniff_core_bfd (bfd *)
static int | gdb_check_format (bfd *)
static void | core_close (struct target_ops *self)
static void | core_close_cleanup (void *ignore)
static void | add_to_thread_list (bfd *, asection *, void *)
static void | init_core_ops (void)
void | deprecated_add_core_fns (struct core_fns *cf)
int | default_core_sniffer (struct core_fns *our_fns, bfd *abfd)
int | default_check_format (bfd *abfd)
static void | core_open (const char *arg, int from_tty)
static void | core_detach (struct target_ops *ops, const char *args, int from_tty)
static void | get_core_register_section (struct regcache *regcache, const struct regset *regset, const char *name, int min_size, int which, const char *human_name, int required)
static void | get_core_registers_cb (const char *sect_name, int size, const struct regset *regset, const char *human_name, void *cb_data)
static void | get_core_registers (struct target_ops *ops, struct regcache *regcache, int regno)
static void | add_to_spuid_list (bfd *abfd, asection *asect, void *list_p)
static enum target_xfer_status | core_xfer_partial (struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len)
static int | ignore (struct target_ops *ops, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
static int | core_remove_breakpoint (struct target_ops *ops, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt, enum remove_bp_reason reason)
static int | core_thread_alive (struct target_ops *ops, ptid_t ptid)
static const struct target_desc * | core_read_description (struct target_ops *target)
static const char * | core_pid_to_str (struct target_ops *ops, ptid_t ptid)
static const char * | core_thread_name (struct target_ops *self, struct thread_info *thr)
static int | core_has_memory (struct target_ops *ops)
static int | core_has_stack (struct target_ops *ops)
static int | core_has_registers (struct target_ops *ops)
static void | core_info_proc (struct target_ops *ops, const char *args, enum info_proc_what request)
void | _initialize_corelow (void)

## Variables
static struct core_fns * | core_file_fns = NULL
static struct core_fns * | core_vec = NULL
static struct gdbarch * | core_gdbarch = NULL
static struct target_section_table * | core_data
static struct target_ops | core_ops

## Macro Definition Documentation

## ◆ CORELOW_PID

#define CORELOW_PID 1

Definition at line 94 of file corelow.c.

Referenced by add_to_thread_list(), and core_open().

## ◆ O_LARGEFILE

#define O_LARGEFILE 0

Definition at line 50 of file corelow.c.

Referenced by core_open().

## Function Documentation

## ◆ _initialize_corelow()

void _initialize_corelow | ( | void |  | ) |

Definition at line 1038 of file corelow.c.

References add_target_with_completer(), core_ops, filename_completer(), and init_core_ops().

## ◆ add_to_spuid_list()

static void add_to_spuid_list | ( | bfd * | abfd,
|  | asection * | asect,
|  | void * | list_p
| ) |  |
| static

Definition at line 640 of file corelow.c.

References spuid_list::buf, spuid_list::len, spuid_list::offset, spuid_list::pos, store_unsigned_integer(), and spuid_list::written.

Referenced by core_xfer_partial().

## ◆ add_to_thread_list()

static void add_to_thread_list | ( | bfd * | abfd,
|  | asection * | asect,
|  | void * | reg_sect_arg
| ) |  |
| static

Definition at line 226 of file corelow.c.

References add_thread(), core_bfd, CORELOW_PID, current_inferior(), inferior::fake_pid_p, arm-linux::inf, inferior_appeared(), inferior_ptid, inf::pid, pid, ptid_build(), and startswith().

Referenced by core_open().

## ◆ core_close()

static void core_close | ( | struct target_ops * | self | ) |
| static

Definition at line 188 of file corelow.c.

References clear_solib(), core_bfd, core_data, core_gdbarch, core_vec, exit_inferior_silent(), gdb_bfd_unref(), inferior_ptid, null_ptid, pid, ptid_get_pid(), target_section_table::sections, and xfree().

Referenced by core_close_cleanup(), and init_core_ops().

## ◆ core_close_cleanup()

static void core_close_cleanup | ( | void * | ignore | ) |
| static

Definition at line 217 of file corelow.c.

References core_close().

Referenced by core_open().

## ◆ core_detach()

static void core_detach | ( | struct target_ops * | ops,
|  | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 467 of file corelow.c.

References _, error(), printf_filtered(), reinit_frame_cache(), and unpush_target().

Referenced by init_core_ops().

## ◆ core_files_info()

static void core_files_info | ( | struct target_ops * | t | ) |
| static

Definition at line 625 of file corelow.c.

References core_bfd, core_data, and print_section_info().

Referenced by init_core_ops().

## ◆ core_has_memory()

static int core_has_memory | ( | struct target_ops * | ops | ) |
| static

Definition at line 971 of file corelow.c.

References core_bfd.

Referenced by init_core_ops().

## ◆ core_has_registers()

static int core_has_registers | ( | struct target_ops * | ops | ) |
| static

Definition at line 983 of file corelow.c.

References core_bfd.

Referenced by init_core_ops().

## ◆ core_has_stack()

static int core_has_stack | ( | struct target_ops * | ops | ) |
| static

Definition at line 977 of file corelow.c.

References core_bfd.

Referenced by init_core_ops().

## ◆ core_info_proc()

static void core_info_proc | ( | struct target_ops * | ops,
|  | const char * | args,
|  | enum info_proc_what | request
| ) |  |
| static

Definition at line 991 of file corelow.c.

References gdbarch_core_info_proc(), gdbarch_core_info_proc_p(), and get_current_arch().

Referenced by init_core_ops(), and set_gdbarch_core_info_proc().

## ◆ core_open()

static void core_open | ( | const char * | arg,
|  | int | from_tty
| ) |  |
| static

Definition at line 270 of file corelow.c.

References _, add_thread_silent(), add_to_thread_list(), cleanup::arg, build_section_table(), CATCH, clear_exit_convenience_vars(), core_bfd, core_close_cleanup(), core_data, core_gdbarch, core_ops, core_vec, CORELOW_PID, current_directory, current_inferior(), discard_cleanups(), END_CATCH, error(), exception_print(), exec_bfd, first_thread_of_process(), flags, gdb_bfd_fopen(), gdb_check_format(), gdb_open_cloexec(), gdb_signal_from_host(), gdb_signal_to_name(), gdb_signal_to_string(), gdb_stderr, gdbarch_from_bfd(), gdbarch_gdb_signal_from_target(), gdbarch_gdb_signal_from_target_p(), get_current_regcache(), get_selected_frame(), gnutarget, inferior_appeared(), inferior_ptid, init_thread_list(), lookup_internalvar(), make_cleanup(), null_ptid, O_BINARY, O_LARGEFILE, perror_with_name(), pid_to_ptid(), post_create_inferior(), print_stack_frame(), printf_filtered(), thread_info::ptid, ptid_equal(), push_target(), registers_changed(), reinit_frame_cache(), RETURN_MASK_ERROR, target_section_table::sections, target_section_table::sections_end, set_gdbarch_from_file(), set_internalvar_integer(), sniff_core_bfd(), SRC_AND_LOC, switch_to_thread(), target_fetch_registers(), target_preopen(), target_update_thread_list(), thread_command(), thread_count(), TRY, unpush_target(), validate_files(), write_files, and XCNEW.

Referenced by init_core_ops().

## ◆ core_pid_to_str()

static const char* core_pid_to_str | ( | struct target_ops * | ops,
|  | ptid_t | ptid
| ) |  |
| static

Definition at line 930 of file corelow.c.

References core_gdbarch, find_inferior_ptid(), gdbarch_core_pid_to_str(), gdbarch_core_pid_to_str_p(), arm-linux::inf, normal_pid_to_str(), pid, pid_to_ptid(), ptid_get_lwp(), and xsnprintf().

Referenced by init_core_ops(), and set_gdbarch_core_pid_to_str().

## ◆ core_read_description()

static const struct target_desc* core_read_description | ( | struct target_ops * | target | ) |
| static

Definition at line 914 of file corelow.c.

References target_ops::beneath, core_bfd, core_gdbarch, gdbarch_core_read_description(), gdbarch_core_read_description_p(), and target_ops::to_read_description.

Referenced by init_core_ops(), and set_gdbarch_core_read_description().

## ◆ core_remove_breakpoint()

static int core_remove_breakpoint | ( | struct target_ops * | ops,
|  | struct gdbarch * | gdbarch,
|  | struct bp_target_info * | bp_tgt,
|  | enum remove_bp_reason | reason
| ) |  |
| static

Definition at line 888 of file corelow.c.

Referenced by init_core_ops().

## ◆ core_thread_alive()

static int core_thread_alive | ( | struct target_ops * | ops,
|  | ptid_t | ptid
| ) |  |
| static

Definition at line 903 of file corelow.c.

Referenced by init_core_ops().

## ◆ core_thread_name()

static const char* core_thread_name | ( | struct target_ops * | self,
|  | struct thread_info * | thr
| ) |  |
| static

Definition at line 962 of file corelow.c.

References core_gdbarch, gdbarch_core_thread_name(), and gdbarch_core_thread_name_p().

Referenced by init_core_ops(), and set_gdbarch_core_thread_name().

## ◆ core_xfer_partial()

static enum target_xfer_status core_xfer_partial | ( | struct target_ops * | ops,
|  | enum target_object | object,
|  | const char * | annex,
|  | gdb_byte * | readbuf,
|  | const gdb_byte * | writebuf,
|  | ULONGEST | offset,
|  | ULONGEST | len,
|  | ULONGEST * | xfered_len
| ) |  |
| static

Definition at line 661 of file corelow.c.

References _, add_to_spuid_list(), target_ops::beneath, spuid_list::buf, core_bfd, core_data, core_gdbarch, gdbarch_core_xfer_shared_libraries(), gdbarch_core_xfer_shared_libraries_aix(), gdbarch_core_xfer_shared_libraries_aix_p(), gdbarch_core_xfer_shared_libraries_p(), gdbarch_core_xfer_siginfo(), gdbarch_core_xfer_siginfo_p(), spuid_list::len, offset, spuid_list::offset, spuid_list::pos, section_table_xfer_memory_partial(), target_section_table::sections, target_section_table::sections_end, size, TARGET_OBJECT_AUXV, TARGET_OBJECT_LIBRARIES, TARGET_OBJECT_LIBRARIES_AIX, TARGET_OBJECT_MEMORY, TARGET_OBJECT_SIGNAL_INFO, TARGET_OBJECT_SPU, TARGET_OBJECT_WCOOKIE, TARGET_XFER_E_IO, TARGET_XFER_EOF, TARGET_XFER_OK, target_ops::to_xfer_partial, warning(), spuid_list::written, and xsnprintf().

Referenced by init_core_ops().

## ◆ default_check_format()

int default_check_format | ( | bfd * | abfd | ) |

Definition at line 162 of file corelow.c.

## ◆ default_core_sniffer()

int default_core_sniffer | ( | struct core_fns * | our_fns,
|  | bfd * | abfd
| ) |  |

Definition at line 113 of file corelow.c.

## ◆ deprecated_add_core_fns()

void deprecated_add_core_fns | ( | struct core_fns * | cf | ) |

Definition at line 102 of file corelow.c.

References core_file_fns, and core_fns::next.

Referenced by _initialize_arm_netbsd_nat(), and _initialize_cris_tdep().

## ◆ gdb_check_format()

static int gdb_check_format | ( | bfd * | abfd | ) |
| static

Definition at line 170 of file corelow.c.

References core_fns::check_format, core_file_fns, and core_fns::next.

Referenced by core_open().

## ◆ get_core_register_section()

static void get_core_register_section | ( | struct regcache * | regcache,
|  | const struct regset * | regset,
|  | const char * | name,
|  | int | min_size,
|  | int | which,
|  | const char * | human_name,
|  | int | required
| ) |  |
| static

Definition at line 495 of file corelow.c.

References _, core_bfd, core_fns::core_read_registers, core_vec, regset::flags, gdb_assert, name, regcache::ptid(), REGSET_VARIABLE_SIZE, size, regset::supply_regset, and warning().

Referenced by get_core_registers(), and get_core_registers_cb().

## ◆ get_core_registers()

static void get_core_registers | ( | struct target_ops * | ops,
|  | struct regcache * | regcache,
|  | int | regno
| ) |  |
| static

Definition at line 591 of file corelow.c.

References regcache::arch(), core_gdbarch, core_fns::core_read_registers, core_vec, fprintf_filtered(), gdb_stderr, gdbarch_iterate_over_regset_sections(), gdbarch_iterate_over_regset_sections_p(), gdbarch_num_regs(), get_core_register_section(), get_core_registers_cb(), REG_UNKNOWN, regcache_raw_supply(), and regcache_register_status().

Referenced by init_core_ops().

## ◆ get_core_registers_cb()

static void get_core_registers_cb | ( | const char * | sect_name,
|  | int | size,
|  | const struct regset * | regset,
|  | const char * | human_name,
|  | void * | cb_data
| ) |  |
| static

Definition at line 558 of file corelow.c.

References get_core_register_section(), and size.

Referenced by get_core_registers().

## ◆ ignore()

static int ignore | ( | struct target_ops * | ops,
|  | struct gdbarch * | gdbarch,
|  | struct bp_target_info * | bp_tgt
| ) |  |
| static

Definition at line 879 of file corelow.c.

Referenced by handle_completer(), init_core_ops(), location_completer_handle_brkchars(), prompt_for_continue(), tui_reggroup_completer(), and yylex().

## ◆ init_core_ops()

static void init_core_ops | ( | void |  | ) |
| static

Definition at line 1005 of file corelow.c.

References _, core_close(), core_detach(), core_files_info(), core_has_memory(), core_has_registers(), core_has_stack(), core_info_proc(), core_open(), core_ops, core_pid_to_str(), core_read_description(), core_remove_breakpoint(), core_target, core_thread_alive(), core_thread_name(), core_xfer_partial(), get_core_registers(), ignore(), internal_error(), OPS_MAGIC, process_stratum, target_ops::to_close, target_ops::to_detach, target_ops::to_doc, target_ops::to_fetch_registers, target_ops::to_files_info, target_ops::to_has_memory, target_ops::to_has_registers, target_ops::to_has_stack, target_ops::to_info_proc, target_ops::to_insert_breakpoint, target_ops::to_longname, target_ops::to_magic, target_ops::to_open, target_ops::to_pid_to_str, target_ops::to_read_description, target_ops::to_remove_breakpoint, target_ops::to_shortname, target_ops::to_stratum, target_ops::to_thread_alive, target_ops::to_thread_name, and target_ops::to_xfer_partial.

Referenced by _initialize_corelow().

## ◆ sniff_core_bfd()

static struct core_fns * sniff_core_bfd | ( | bfd * | abfd | ) |
| static

Definition at line 126 of file corelow.c.

References _, core_file_fns, core_gdbarch, core_fns::core_sniffer, error(), gdbarch_iterate_over_regset_sections_p(), core_fns::next, and warning().

Referenced by core_open().

## Variable Documentation

## ◆ core_data

struct target_section_table* core_data
| static

Definition at line 75 of file corelow.c.

Referenced by core_close(), core_files_info(), core_open(), and core_xfer_partial().

## ◆ core_file_fns

struct core_fns* core_file_fns = NULL
| static

Definition at line 57 of file corelow.c.

Referenced by deprecated_add_core_fns(), gdb_check_format(), and sniff_core_bfd().

## ◆ core_gdbarch

struct gdbarch* core_gdbarch = NULL
| static

Definition at line 67 of file corelow.c.

Referenced by core_close(), core_open(), core_pid_to_str(), core_read_description(), core_thread_name(), core_xfer_partial(), get_core_registers(), linux_core_info_proc_mappings(), and sniff_core_bfd().

## ◆ core_ops

struct target_ops core_ops
| static

Definition at line 91 of file corelow.c.

Referenced by _initialize_corelow(), core_open(), and init_core_ops().

## ◆ core_vec

struct core_fns* core_vec = NULL
| static

Definition at line 62 of file corelow.c.

Referenced by core_close(), core_open(), get_core_register_section(), and get_core_registers().