29 #include "elf/common.h" 256 linux_siginfo_extra_fields extra_fields)
259 struct type *int_type, *uint_type, *long_type, *void_ptr_type, *short_type;
260 struct type *uid_type, *pid_type;
261 struct type *sigval_type, *clock_type;
262 struct type *siginfo_type, *sifields_type;
281 TYPE_NAME (sigval_type) = xstrdup (
"sigval_t");
308 const int si_max_size = 128;
314 si_pad_size = (si_max_size / size_of_int) - 4;
316 si_pad_size = (si_max_size / size_of_int) - 3;
357 struct type *sigfault_bnd_fields;
375 TYPE_NAME (siginfo_type) = xstrdup (
"siginfo");
380 "_sifields", sifields_type,
424 snprintf (buf,
sizeof (buf),
"LWP %ld",
ptid_get_lwp (ptid));
436 const char **permissions,
size_t *permissions_len,
438 const char **device,
size_t *device_len,
440 const char **filename)
442 const char *p = line;
451 while (*p && !isspace (*p))
453 *permissions_len = p - *permissions;
459 while (*p && !isspace (*p))
461 *device_len = p - *device;
481 char *saveptr = NULL;
488 for (s = strtok_r (p,
" ", &saveptr);
490 s = strtok_r (NULL,
" ", &saveptr))
492 if (strcmp (s,
"io") == 0)
494 else if (strcmp (s,
"ht") == 0)
496 else if (strcmp (s,
"dd") == 0)
498 else if (strcmp (s,
"sh") == 0)
513 {
"^/dev/zero\\( (deleted)\\)\\?$", REG_NOSUB,
514 _(
"Could not compile regex to match /dev/zero filename")};
521 {
"^/\\?SYSV[0-9a-fA-F]\\{8\\}\\( (deleted)\\)\\?$", REG_NOSUB,
522 _(
"Could not compile regex to match shmem filenames")};
537 {
" (deleted)$", REG_NOSUB,
538 _(
"Could not compile regex to match '<file> (deleted)'")};
555 static int init_regex_p = 0;
569 if (init_regex_p == -1)
571 const char deleted[] =
" (deleted)";
572 size_t del_len =
sizeof (deleted) - 1;
573 size_t filename_len = strlen (filename);
580 return (filename_len >= del_len
581 && strcmp (filename + filename_len - del_len, deleted) == 0);
584 if (*filename ==
'\0' 637 int maybe_private_p,
int mapping_anon_p,
int mapping_file_p,
638 const char *filename)
647 int private_p = maybe_private_p;
652 if (strcmp (
"[vdso]", filename) == 0
653 || strcmp (
"[vsyscall]", filename) == 0)
683 if (mapping_anon_p && mapping_file_p)
691 else if (mapping_anon_p)
698 if (mapping_anon_p && mapping_file_p)
706 else if (mapping_anon_p)
732 if (args && isdigit (args[0]))
736 pid = strtoul (args, &tem, 10);
742 error (
_(
"No current process: you must name one."));
744 error (
_(
"Can't determine the current process's PID: you must name one."));
751 error (
_(
"Too many parameters: %s"), args);
756 xsnprintf (filename,
sizeof filename,
"/proc/%ld/cmdline",
pid);
762 warning (
_(
"unable to open /proc file '%s'"), filename);
766 xsnprintf (filename,
sizeof filename,
"/proc/%ld/cwd",
pid);
775 warning (
_(
"unable to read link '%s'"), filename);
779 xsnprintf (filename,
sizeof filename,
"/proc/%ld/exe",
pid);
788 warning (
_(
"unable to read link '%s'"), filename);
792 xsnprintf (filename,
sizeof filename,
"/proc/%ld/maps",
pid);
805 " Size",
" Offset",
"objfile");
812 " Size",
" Offset",
"objfile");
815 for (line = strtok (map.get (),
"\n");
817 line = strtok (NULL,
"\n"))
820 const char *permissions, *device, *filename;
821 size_t permissions_len, device_len;
824 &permissions, &permissions_len,
825 &
offset, &device, &device_len,
835 *filename? filename :
"");
844 *filename? filename :
"");
849 warning (
_(
"unable to open /proc file '%s'"), filename);
853 xsnprintf (filename,
sizeof filename,
"/proc/%ld/status",
pid);
859 warning (
_(
"unable to open /proc file '%s'"), filename);
863 xsnprintf (filename,
sizeof filename,
"/proc/%ld/stat",
pid);
868 const char *p = statstr.get ();
878 const char *ep = strrchr (p,
')');
882 (
int) (ep - p - 1), p + 1);
949 "system boot): %s\n"),
995 warning (
_(
"unable to open /proc file '%s'"), filename);
1006 unsigned char *descdata, *filenames, *descend;
1008 unsigned int addr_size_bits, addr_size;
1013 section = bfd_get_section_by_name (
core_bfd,
".note.linuxcore.file");
1014 if (section == NULL)
1016 warning (
_(
"unable to find mappings in core file"));
1021 addr_size = addr_size_bits / 8;
1022 note_size = bfd_get_section_size (section);
1024 if (note_size < 2 * addr_size)
1025 error (
_(
"malformed core note - too short for header"));
1028 if (!bfd_get_section_contents (
core_bfd, section, contents.data (),
1030 error (
_(
"could not get core note contents"));
1032 descdata = contents.data ();
1033 descend = descdata + note_size;
1035 if (descdata[note_size - 1] !=
'\0')
1036 error (
_(
"malformed note - does not end with \\0"));
1038 count = bfd_get (addr_size_bits,
core_bfd, descdata);
1039 descdata += addr_size;
1041 page_size = bfd_get (addr_size_bits,
core_bfd, descdata);
1042 descdata += addr_size;
1044 if (note_size < 2 * addr_size + count * 3 * addr_size)
1045 error (
_(
"malformed note - too short for supplied file count"));
1053 " Size",
" Offset",
"objfile");
1060 " Size",
" Offset",
"objfile");
1063 filenames = descdata + count * 3 * addr_size;
1068 if (filenames == descend)
1069 error (
_(
"malformed note - filenames end too early"));
1071 start = bfd_get (addr_size_bits,
core_bfd, descdata);
1072 descdata += addr_size;
1073 end = bfd_get (addr_size_bits,
core_bfd, descdata);
1074 descdata += addr_size;
1075 file_ofs = bfd_get (addr_size_bits,
core_bfd, descdata);
1076 descdata += addr_size;
1078 file_ofs *= page_size;
1095 filenames += 1 + strlen ((
char *) filenames);
1112 exe = bfd_core_file_failing_command (
core_bfd);
1116 warning (
_(
"unable to find command name in core file"));
1122 if (!exe_f && !mappings_f)
1123 error (
_(
"unable to handle request"));
1136 asection *section = bfd_get_section_by_name (
core_bfd, section_name.
c_str ());
1137 if (section == NULL)
1140 if (!bfd_get_section_contents (
core_bfd, section, readbuf,
offset, len))
1148 int read,
int write,
1149 int exec,
int modified,
1150 const char *filename,
1160 char mapsfilename[100];
1161 char coredumpfilter_name[100];
1179 xsnprintf (coredumpfilter_name,
sizeof (coredumpfilter_name),
1180 "/proc/%d/coredump_filter",
pid);
1183 if (coredumpfilterdata != NULL)
1187 sscanf (coredumpfilterdata.get (),
"%x", &
flags);
1192 xsnprintf (mapsfilename,
sizeof mapsfilename,
"/proc/%d/smaps",
pid);
1198 xsnprintf (mapsfilename,
sizeof mapsfilename,
"/proc/%d/maps",
pid);
1206 line = strtok_r (
data.get (),
"\n", &t);
1207 while (line != NULL)
1210 const char *permissions, *device, *filename;
1212 size_t permissions_len, device_len;
1213 int read, write, exec, priv;
1214 int has_anonymous = 0;
1215 int should_dump_p = 0;
1219 memset (&v, 0,
sizeof (v));
1220 read_mapping (line, &addr, &endaddr, &permissions, &permissions_len,
1221 &
offset, &device, &device_len, &inode, &filename);
1232 mapping_file_p = !mapping_anon_p;
1235 read = (memchr (permissions,
'r', permissions_len) != 0);
1236 write = (memchr (permissions,
'w', permissions_len) != 0);
1237 exec = (memchr (permissions,
'x', permissions_len) != 0);
1247 priv = memchr (permissions,
'p', permissions_len) != 0;
1251 for (line = strtok_r (NULL,
"\n", &t);
1252 line != NULL && line[0] >=
'A' && line[0] <=
'Z';
1253 line = strtok_r (NULL,
"\n", &t))
1257 if (sscanf (line,
"%64s",
keyword) != 1)
1259 warning (
_(
"Error parsing {s,}maps file '%s'"), mapsfilename);
1263 if (strcmp (
keyword,
"Anonymous:") == 0)
1269 else if (strcmp (
keyword,
"VmFlags:") == 0)
1272 if (strcmp (
keyword,
"AnonHugePages:") == 0
1273 || strcmp (
keyword,
"Anonymous:") == 0)
1275 unsigned long number;
1277 if (sscanf (line,
"%*s%lu", &number) != 1)
1279 warning (
_(
"Error parsing {s,}maps file '%s' number"),
1308 mapping_anon_p, mapping_file_p,
1320 read, write, exec, 1,
1351 int read,
int write,
int exec,
int modified,
1352 const char *filename,
void *arg)
1394 static const char *spu_files[] =
1425 for (i = 0; i <
size; i += 4)
1429 for (j = 0; j <
sizeof (spu_files) /
sizeof (spu_files[0]); j++)
1431 char annex[32], note_name[32];
1435 xsnprintf (annex,
sizeof annex,
"%d/%s", fd, spu_files[j]);
1440 xsnprintf (note_name,
sizeof note_name,
"SPU/%s", annex);
1441 note_data = elfcore_write_note (
obfd, note_data, note_size,
1488 int read,
int write,
int exec,
int modified,
1489 const char *filename,
void *data)
1495 if (*filename ==
'\0' || inode == 0)
1519 char *note_data,
int *note_size)
1522 struct type *long_type
1534 obstack_blank (&data_obstack,
TYPE_LENGTH (long_type));
1538 obstack_grow (&data_obstack, buf,
TYPE_LENGTH (long_type));
1550 obstack_grow (&data_obstack, obstack_base (&filename_obstack),
1551 obstack_object_size (&filename_obstack));
1553 note_data = elfcore_write_note (obfd, note_data, note_size,
1555 obstack_base (&data_obstack),
1556 obstack_object_size (&data_obstack));
1584 const char *human_name,
void *cb_data)
1599 if (strcmp (sect_name,
".reg") == 0)
1600 data->
note_data = (
char *) elfcore_write_prstatus
1604 data->
note_data = (
char *) elfcore_write_register_note
1606 sect_name, buf,
size);
1651 struct type *siginfo_type;
1702 if (!siginfo_data.empty ())
1707 siginfo_data.data (),
1708 siginfo_data.size ());
1725 const char *basename;
1730 const char valid_states[] =
"RSDTZW";
1732 const char *prog_state;
1738 unsigned int pr_flag;
1748 xsnprintf (filename,
sizeof (filename),
"/proc/%d/cmdline", (
int)
pid);
1753 if (fname == NULL || fname.get ()[0] ==
'\0')
1760 memset (p, 0,
sizeof (*p));
1766 basename = lbasename (fname.get ());
1767 strncpy (p->pr_fname, basename, sizeof (p->pr_fname));
1768 p->pr_fname[
sizeof (p->pr_fname) - 1] =
'\0';
1774 if (infargs != NULL)
1775 psargs = psargs +
" " + infargs;
1777 strncpy (p->pr_psargs, psargs.c_str (),
sizeof (p->pr_psargs));
1778 p->pr_psargs[
sizeof (p->pr_psargs) - 1] =
'\0';
1780 xsnprintf (filename,
sizeof (filename),
"/proc/%d/stat", (
int)
pid);
1784 char *proc_stat = proc_stat_contents.get ();
1786 if (proc_stat == NULL || *proc_stat ==
'\0')
1804 while (isdigit (*proc_stat))
1810 proc_stat = strrchr (proc_stat,
')');
1811 if (proc_stat == NULL)
1817 n_fields = sscanf (proc_stat,
1829 &p->pr_ppid, &p->pr_pgrp, &p->pr_sid,
1842 prog_state = strchr (valid_states, pr_sname);
1843 if (prog_state != NULL)
1844 p->pr_state = prog_state - valid_states;
1851 p->pr_sname = p->pr_state > 5 ?
'.' : pr_sname;
1852 p->pr_zomb = p->pr_sname ==
'Z';
1853 p->pr_nice = pr_nice;
1854 p->pr_flag = pr_flag;
1858 xsnprintf (filename,
sizeof (filename),
"/proc/%d/status", (
int)
pid);
1862 char *proc_status = proc_status_contents.get ();
1864 if (proc_status == NULL || *proc_status ==
'\0')
1871 tmpstr = strstr (proc_status,
"Uid:");
1875 tmpstr +=
sizeof (
"Uid:");
1876 while (*tmpstr !=
'\0' && !isdigit (*tmpstr))
1879 if (isdigit (*tmpstr))
1880 p->pr_uid = strtol (tmpstr, &tmpstr, 10);
1884 tmpstr = strstr (proc_status,
"Gid:");
1888 tmpstr +=
sizeof (
"Gid:");
1889 while (*tmpstr !=
'\0' && !isdigit (*tmpstr))
1892 if (isdigit (*tmpstr))
1893 p->pr_gid = strtol (tmpstr, &tmpstr, 10);
1906 struct elf_internal_linux_prpsinfo prpsinfo;
1907 char *note_data = NULL;
1910 struct thread_info *curr_thr, *signalled_thr, *thr;
1918 note_data = elfcore_write_linux_prpsinfo64 (obfd,
1919 note_data, note_size,
1922 note_data = elfcore_write_linux_prpsinfo32 (obfd,
1923 note_data, note_size,
1943 if (curr_thr->suspend.stop_signal != GDB_SIGNAL_0)
1944 signalled_thr = curr_thr;
1948 if (signalled_thr == NULL)
1949 signalled_thr = curr_thr;
1953 thread_args.
obfd = obfd;
1961 if (thr == signalled_thr)
1978 note_data = elfcore_write_note (obfd, note_data, note_size,
1979 "CORE", NT_AUXV, auxv, auxv_len);
1993 note_data, note_size);
2008 return GDB_SIGNAL_0;
2011 return GDB_SIGNAL_HUP;
2014 return GDB_SIGNAL_INT;
2017 return GDB_SIGNAL_QUIT;
2020 return GDB_SIGNAL_ILL;
2023 return GDB_SIGNAL_TRAP;
2026 return GDB_SIGNAL_ABRT;
2029 return GDB_SIGNAL_BUS;
2032 return GDB_SIGNAL_FPE;
2035 return GDB_SIGNAL_KILL;
2038 return GDB_SIGNAL_USR1;
2041 return GDB_SIGNAL_SEGV;
2044 return GDB_SIGNAL_USR2;
2047 return GDB_SIGNAL_PIPE;
2050 return GDB_SIGNAL_ALRM;
2053 return GDB_SIGNAL_TERM;
2056 return GDB_SIGNAL_CHLD;
2059 return GDB_SIGNAL_CONT;
2062 return GDB_SIGNAL_STOP;
2065 return GDB_SIGNAL_TSTP;
2068 return GDB_SIGNAL_TTIN;
2071 return GDB_SIGNAL_TTOU;
2074 return GDB_SIGNAL_URG;
2077 return GDB_SIGNAL_XCPU;
2080 return GDB_SIGNAL_XFSZ;
2083 return GDB_SIGNAL_VTALRM;
2086 return GDB_SIGNAL_PROF;
2089 return GDB_SIGNAL_WINCH;
2094 return GDB_SIGNAL_IO;
2097 return GDB_SIGNAL_PWR;
2100 return GDB_SIGNAL_SYS;
2105 return GDB_SIGNAL_REALTIME_32;
2108 return GDB_SIGNAL_REALTIME_64;
2115 return (
enum gdb_signal) ((int) GDB_SIGNAL_REALTIME_33 +
offset);
2118 return GDB_SIGNAL_UNKNOWN;
2127 enum gdb_signal signal)
2134 case GDB_SIGNAL_HUP:
2137 case GDB_SIGNAL_INT:
2140 case GDB_SIGNAL_QUIT:
2143 case GDB_SIGNAL_ILL:
2146 case GDB_SIGNAL_TRAP:
2149 case GDB_SIGNAL_ABRT:
2152 case GDB_SIGNAL_FPE:
2155 case GDB_SIGNAL_KILL:
2158 case GDB_SIGNAL_BUS:
2161 case GDB_SIGNAL_SEGV:
2164 case GDB_SIGNAL_SYS:
2167 case GDB_SIGNAL_PIPE:
2170 case GDB_SIGNAL_ALRM:
2173 case GDB_SIGNAL_TERM:
2176 case GDB_SIGNAL_URG:
2179 case GDB_SIGNAL_STOP:
2182 case GDB_SIGNAL_TSTP:
2185 case GDB_SIGNAL_CONT:
2188 case GDB_SIGNAL_CHLD:
2191 case GDB_SIGNAL_TTIN:
2194 case GDB_SIGNAL_TTOU:
2200 case GDB_SIGNAL_XCPU:
2203 case GDB_SIGNAL_XFSZ:
2206 case GDB_SIGNAL_VTALRM:
2209 case GDB_SIGNAL_PROF:
2212 case GDB_SIGNAL_WINCH:
2215 case GDB_SIGNAL_USR1:
2218 case GDB_SIGNAL_USR2:
2221 case GDB_SIGNAL_PWR:
2224 case GDB_SIGNAL_POLL:
2229 case GDB_SIGNAL_REALTIME_32:
2233 case GDB_SIGNAL_REALTIME_64:
2238 if (signal >= GDB_SIGNAL_REALTIME_33
2239 && signal <= GDB_SIGNAL_REALTIME_63)
2241 int offset = signal - GDB_SIGNAL_REALTIME_33;
2266 Elf_Internal_Phdr *phdrs;
2270 phdrs_size = bfd_get_elf_phdr_upper_bound (
core_bfd);
2271 if (phdrs_size == -1)
2274 phdrs = (Elf_Internal_Phdr *) alloca (phdrs_size);
2275 num_phdrs = bfd_get_elf_phdrs (
core_bfd, phdrs);
2276 if (num_phdrs == -1)
2279 for (i = 0; i < num_phdrs; i++)
2280 if (phdrs[i].p_type == PT_LOAD
2281 && phdrs[i].p_vaddr ==
range->start)
2304 xsnprintf (filename,
sizeof filename,
"/proc/%ld/task/%ld/maps",
pid,
pid);
2310 char *saveptr = NULL;
2312 for (line = strtok_r (data.get (),
"\n", &saveptr);
2314 line = strtok_r (NULL,
"\n", &saveptr))
2317 const char *p = line;
2320 if (addr ==
range->start)
2331 warning (
_(
"unable to open /proc file '%s'"), filename);
2361 #define GDB_MMAP_MAP_PRIVATE 0x02 2362 #define GDB_MMAP_MAP_ANONYMOUS 0x20 2373 struct value *addr_val;
2378 ARG_ADDR, ARG_LENGTH, ARG_PROT, ARG_FLAGS, ARG_FD, ARG_OFFSET, ARG_LAST
2380 struct value *arg[ARG_LAST];
2400 error (
_(
"Failed inferior mmap call for %s bytes, errno is changed."),
2412 struct value *retval_val;
2417 ARG_ADDR, ARG_LENGTH, ARG_LAST
2419 struct value *arg[ARG_LAST];
2429 warning (
_(
"Failed inferior munmap call at %s for %s bytes, " 2430 "errno is changed."),
2450 _(
"Cannot find AT_ENTRY auxiliary vector entry."));
2474 " corefiles is %s.\n"),
value);
2485 " flag is %s.\n"),
value);
2527 Set whether gcore should consider /proc/PID/coredump_filter."),
2529 Show whether gcore should consider /proc/PID/coredump_filter."),
2531 Use this command to set whether gcore should consider the contents\n\ 2532 of /proc/PID/coredump_filter when generating the corefile. For more information\n\ 2533 about this file, refer to the manpage of core(5)."),
2539 Set whether gcore should dump mappings marked with the VM_DONTDUMP flag."),
2541 Show whether gcore should dump mappings marked with the VM_DONTDUMP flag."),
2543 Use this command to set whether gcore should dump mappings marked with the\n\ 2544 VM_DONTDUMP flag (\"dd\" in /proc/PID/smaps) when generating the corefile. For\n\ 2545 more information about this file, refer to the manpage of proc(5) and core(5)."),
struct gdbarch * target_gdbarch(void)
ssize_t read(int fd, void *buf, size_t count)
char * hex_string(LONGEST num)
static void show_use_coredump_filter(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
unsigned int exclude_coredump
static void * init_linux_gdbarch_data(struct gdbarch *gdbarch)
struct type * arch_type(struct gdbarch *gdbarch, enum type_code code, int bit, const char *name)
int linux_is_uclinux(void)
void set_gdbarch_core_pid_to_str(struct gdbarch *gdbarch, gdbarch_core_pid_to_str_ftype core_pid_to_str)
enum gdb_signal stop_signal
void set_gdbarch_gdb_signal_to_target(struct gdbarch *gdbarch, gdbarch_gdb_signal_to_target_ftype gdb_signal_to_target)
static int linux_vsyscall_range_raw(struct gdbarch *gdbarch, struct mem_range *range)
int ptid_get_pid(const ptid_t &ptid)
static linux_find_memory_region_ftype linux_make_mappings_callback
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int int rusage_t pid_t pid
char * get_inferior_args(void)
void set_gdbarch_infcall_mmap(struct gdbarch *gdbarch, gdbarch_infcall_mmap_ftype infcall_mmap)
char * target_fileio_readlink(struct inferior *inf, const char *filename, int *target_errno)
LONGEST value_as_long(struct value *val)
struct type * linux_get_siginfo_type_with_fields(struct gdbarch *gdbarch, linux_siginfo_extra_fields extra_fields)
int gdbarch_int_bit(struct gdbarch *gdbarch)
void warning(const char *fmt,...)
regcache(gdbarch *gdbarch)
#define TYPE_NAME(thistype)
void set_gdbarch_get_siginfo_type(struct gdbarch *gdbarch, gdbarch_get_siginfo_type_ftype get_siginfo_type)
int gdbarch_ptr_bit(struct gdbarch *gdbarch)
static void linux_core_info_proc_mappings(struct gdbarch *gdbarch, const char *args)
LONGEST target_read_alloc(struct target_ops *ops, enum target_object object, const char *annex, gdb_byte **buf_p)
static int linux_vsyscall_range(struct gdbarch *gdbarch, struct mem_range *range)
std::vector< T, gdb::default_init_allocator< T > > def_vector
void * memset(T *s, int c, size_t n)=delete
struct thread_info * inferior_thread(void)
#define GDB_MMAP_MAP_PRIVATE
void set_gdbarch_gdb_signal_from_target(struct gdbarch *gdbarch, gdbarch_gdb_signal_from_target_ftype gdb_signal_from_target)
void linux_init_abi(struct gdbarch_info info, struct gdbarch *gdbarch)
static void linux_core_info_proc(struct gdbarch *gdbarch, const char *args, enum info_proc_what what)
void set_gdbarch_find_memory_regions(struct gdbarch *gdbarch, gdbarch_find_memory_regions_ftype find_memory_regions)
int gdbarch_long_bit(struct gdbarch *gdbarch)
struct observer * observer_attach_inferior_exit(observer_inferior_exit_ftype *f)
void target_fetch_registers(struct regcache *regcache, int regno)
char * skip_spaces(char *chp)
struct obstack * filename_obstack
enum gdb_signal stop_signal
void set_gdbarch_core_xfer_siginfo(struct gdbarch *gdbarch, gdbarch_core_xfer_siginfo_ftype core_xfer_siginfo)
unsigned int uses_huge_tlb
static void linux_infcall_munmap(CORE_ADDR addr, CORE_ADDR size)
void printf_filtered(const char *format,...)
#define GDBARCH_OBSTACK_ZALLOC(GDBARCH, TYPE)
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
struct type * arch_integer_type(struct gdbarch *gdbarch, int bit, int unsigned_p, const char *name)
static char * linux_make_mappings_corefile_notes(struct gdbarch *gdbarch, bfd *obfd, char *note_data, int *note_size)
find_memory_region_ftype func
static int linux_has_shared_address_space(struct gdbarch *gdbarch)
static void invalidate_linux_cache_inf(struct inferior *inf)
scoped_restore_tmpl< T > make_scoped_restore(T *var)
mach_port_t kern_return_t mach_port_t msgports mach_port_t kern_return_t pid_t pid mach_port_t kern_return_t mach_port_t task mach_port_t kern_return_t int flags
const char * normal_pid_to_str(ptid_t ptid)
static struct linux_gdbarch_data * get_linux_gdbarch_data(struct gdbarch *gdbarch)
static char * linux_make_corefile_notes(struct gdbarch *gdbarch, bfd *obfd, int *note_size)
struct thread_info * iterate_over_threads(thread_callback_func, void *)
#define GDB_MMAP_MAP_ANONYMOUS
struct cmd_list_element * setlist
static int mapping_is_anonymous_p(const char *filename)
unsigned int initialized_p
void append_composite_type_field(struct type *t, const char *name, struct type *field)
int gdbarch_iterate_over_regset_sections_p(struct gdbarch *gdbarch)
#define CATCH(EXCEPTION, MASK)
thread_suspend_state suspend
std::unique_ptr< T, xfree_deleter< T > > unique_xmalloc_ptr
struct target_ops current_target
enum gdb_signal linux_gdb_signal_from_target(struct gdbarch *gdbarch, int signal)
static CORE_ADDR linux_infcall_mmap(CORE_ADDR size, unsigned prot)
void fprintf_filtered(struct ui_file *stream, const char *format,...)
struct value * find_function_in_inferior(const char *name, struct objfile **objf_p)
static const struct inferior_data * linux_inferior_data
static ULONGEST extract_unsigned_integer(const gdb_byte *addr, int len, enum bfd_endian byte_order)
long ptid_get_tid(const ptid_t &ptid)
CORE_ADDR gdbarch_convert_from_func_ptr_addr(struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ)
void set_gdbarch_infcall_munmap(struct gdbarch *gdbarch, gdbarch_infcall_munmap_ftype infcall_munmap)
int target_auxv_search(struct target_ops *ops, CORE_ADDR match, CORE_ADDR *valp)
struct cmd_list_element * showlist
void exception_print(struct ui_file *file, struct gdb_exception e)
void puts_filtered(const char *string)
static struct type * linux_get_siginfo_type(struct gdbarch *gdbarch)
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
struct cleanup * make_cleanup(make_cleanup_ftype *function, void *arg)
struct gdbarch * get_objfile_arch(const struct objfile *objfile)
char * pulongest(ULONGEST u)
static void linux_inferior_data_cleanup(struct inferior *inf, void *arg)
int gdb_signal_to_host(enum gdb_signal)
struct type * init_vector_type(struct type *elt_type, int n)
#define TYPE_TARGET_STUB(t)
#define GDB_MMAP_PROT_READ
#define GDB_MMAP_PROT_WRITE
static void linux_info_proc(struct gdbarch *gdbarch, const char *args, enum info_proc_what what)
struct value * value_from_longest(struct type *type, LONGEST num)
struct mem_range vsyscall_range
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int status
static void decode_vmflags(char *p, struct smaps_vmflags *v)
static int linux_find_memory_regions(struct gdbarch *gdbarch, find_memory_region_ftype func, void *obfd)
const char * skip_to_space(const char *chp)
int gdbarch_addr_bit(struct gdbarch *gdbarch)
void set_gdbarch_make_corefile_notes(struct gdbarch *gdbarch, gdbarch_make_corefile_notes_ftype make_corefile_notes)
struct obstack * data_obstack
#define target_has_execution
static void linux_collect_regset_section_cb(const char *sect_name, int size, const struct regset *regset, const char *human_name, void *cb_data)
ULONGEST strtoulst(const char *num, const char **trailer, int base)
#define GDB_MMAP_PROT_EXEC
const char * c_str() const
void set_gdbarch_has_shared_address_space(struct gdbarch *gdbarch, gdbarch_has_shared_address_space_ftype has_shared_address_space)
static int linux_fill_prpsinfo(struct elf_internal_linux_prpsinfo *p)
static char * linux_collect_thread_registers(const struct regcache *regcache, ptid_t ptid, bfd *obfd, char *note_data, int *note_size, enum gdb_signal stop_signal)
struct observer * observer_attach_inferior_appeared(observer_inferior_appeared_ftype *f)
int linux_find_memory_region_ftype(ULONGEST vaddr, ULONGEST size, ULONGEST offset, ULONGEST inode, int read, int write, int exec, int modified, const char *filename, void *data)
DEF_ENUM_FLAGS_TYPE(enum filter_flag, filter_flags)
long ptid_get_lwp(const ptid_t &ptid)
CORE_ADDR linux_displaced_step_location(struct gdbarch *gdbarch)
void _initialize_linux_tdep(void)
void append_composite_type_field_aligned(struct type *t, const char *name, struct type *field, int alignment)
static int find_signalled_thread(struct thread_info *info, void *data)
static char * linux_spu_make_corefile_notes(bfd *obfd, char *note_data, int *note_size)
static void read_mapping(const char *line, ULONGEST *addr, ULONGEST *endaddr, const char **permissions, size_t *permissions_len, ULONGEST *offset, const char **device, size_t *device_len, ULONGEST *inode, const char **filename)
void set_gdbarch_core_info_proc(struct gdbarch *gdbarch, gdbarch_core_info_proc_ftype core_info_proc)
#define gdb_static_assert(expr)
struct gdbarch * gdbarch_from_bfd(bfd *abfd)
struct value * value_from_pointer(struct type *type, CORE_ADDR addr)
compiled_regex file_deleted
T & emplace(Args &&... args)
#define TYPE_TARGET_TYPE(thistype)
static int linux_find_memory_regions_thunk(ULONGEST vaddr, ULONGEST size, ULONGEST offset, ULONGEST inode, int read, int write, int exec, int modified, const char *filename, void *arg)
int linux_gdb_signal_to_target(struct gdbarch *gdbarch, enum gdb_signal signal)
#define ALL_NON_EXITED_THREADS(T)
void update_thread_list(void)
gdb::unique_xmalloc_ptr< char > target_fileio_read_stralloc(struct inferior *inf, const char *filename)
int xsnprintf(char *str, size_t size, const char *format,...)
struct type * siginfo_type
void set_gdbarch_info_proc(struct gdbarch *gdbarch, gdbarch_info_proc_ftype info_proc)
const gdb_byte * gdbarch_breakpoint_from_pc(struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
int gdbarch_get_siginfo_type_p(struct gdbarch *gdbarch)
enum gdb_signal stop_signal
static int dump_excluded_mappings
const struct regcache * regcache
void add_setshow_boolean_cmd(const char *name, enum command_class theclass, int *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_const_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
static gdb::byte_vector linux_get_siginfo_data(thread_info *thread, struct gdbarch *gdbarch)
gdb::def_vector< gdb_byte > byte_vector
struct inferior * current_inferior(void)
unsigned long long ULONGEST
struct value * call_function_by_hand(struct value *function, type *default_return_type, int nargs, struct value **args)
static int linux_find_memory_regions_full(struct gdbarch *gdbarch, linux_find_memory_region_ftype *func, void *obfd)
#define obstack_grow_str0(OBSTACK, STRING)
static int dump_mapping_p(filter_flags filterflags, const struct smaps_vmflags *v, int maybe_private_p, int mapping_anon_p, int mapping_file_p, const char *filename)
LONGEST target_read(struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *buf, ULONGEST offset, LONGEST len)
struct value * value_from_ulongest(struct type *type, ULONGEST num)
CORE_ADDR value_as_address(struct value *val)
static struct linux_info * get_linux_inferior_data(void)
static int use_coredump_filter
static void linux_corefile_thread(struct thread_info *info, struct linux_corefile_thread_data *args)
compiled_regex shmem_file
#define TYPE_LENGTH(thistype)
static const char * linux_core_pid_to_str(struct gdbarch *gdbarch, ptid_t ptid)
int(* find_memory_region_ftype)(CORE_ADDR addr, unsigned long size, int read, int write, int exec, int modified, void *data)
void pack_long(gdb_byte *buf, struct type *type, LONGEST num)
static void show_dump_excluded_mappings(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
struct type * gdbarch_get_siginfo_type(struct gdbarch *gdbarch)
static LONGEST linux_core_xfer_siginfo(struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, ULONGEST len)
void error(const char *fmt,...)
unsigned int shared_mapping
struct gdbarch_data * gdbarch_data_register_post_init(gdbarch_data_post_init_ftype *post_init)
struct type * lookup_pointer_type(struct type *type)
void throw_error(enum errors error, const char *fmt,...)
struct type * arch_composite_type(struct gdbarch *gdbarch, const char *name, enum type_code code)
void do_cleanups(struct cleanup *old_chain)
void set_gdbarch_vsyscall_range(struct gdbarch *gdbarch, gdbarch_vsyscall_range_ftype vsyscall_range)
struct regcache * get_thread_arch_regcache(ptid_t ptid, struct gdbarch *gdbarch)
static struct gdbarch_data * linux_gdbarch_data_handle
static struct gdbarch * core_gdbarch
void gdbarch_iterate_over_regset_sections(struct gdbarch *gdbarch, iterate_over_regset_sections_cb *cb, void *cb_data, const struct regcache *regcache)
int exec(const char *string, size_t nmatch, regmatch_t pmatch[], int eflags) const
collect_regset_ftype * collect_regset