29 #include "elf/common.h"
174 return gdbarch_data (gdbarch, linux_gdbarch_data_handle);
250 struct type *int_type, *uint_type, *long_type, *void_ptr_type;
251 struct type *uid_type, *pid_type;
252 struct type *sigval_type, *clock_type;
253 struct type *siginfo_type, *sifields_type;
270 TYPE_NAME (sigval_type) = xstrdup (
"sigval_t");
296 const int si_max_size = 128;
302 si_pad_size = (si_max_size / size_of_int) - 4;
304 si_pad_size = (si_max_size / size_of_int) - 3;
351 TYPE_NAME (siginfo_type) = xstrdup (
"siginfo");
356 "_sifields", sifields_type,
391 snprintf (buf,
sizeof (buf),
"LWP %ld",
ptid_get_lwp (ptid));
403 const char **permissions,
size_t *permissions_len,
405 const char **device,
size_t *device_len,
407 const char **filename)
409 const char *p =
line;
418 while (*p && !isspace (*p))
420 *permissions_len = p - *permissions;
426 while (*p && !isspace (*p))
428 *device_len = p - *device;
448 char *saveptr = NULL;
455 for (s = strtok_r (p,
" ", &saveptr);
457 s = strtok_r (NULL,
" ", &saveptr))
459 if (strcmp (s,
"io") == 0)
461 else if (strcmp (s,
"ht") == 0)
463 else if (strcmp (s,
"dd") == 0)
465 else if (strcmp (s,
"sh") == 0)
483 static regex_t dev_zero_regex, shmem_file_regex, file_deleted_regex;
484 static int init_regex_p = 0;
500 _(
"Could not compile regex to match /dev/zero "
507 "^/\\?SYSV[0-9a-fA-F]\\{8\\}\\( (deleted)\\)\\?$",
508 _(
"Could not compile regex to match shmem "
524 _(
"Could not compile regex to match "
525 "'<file> (deleted)'"));
534 if (init_regex_p == -1)
536 const char deleted[] =
" (deleted)";
537 size_t del_len =
sizeof (deleted) - 1;
538 size_t filename_len = strlen (filename);
545 return (filename_len >= del_len
546 && strcmp (filename + filename_len - del_len, deleted) == 0);
549 if (*filename ==
'\0'
550 || regexec (&dev_zero_regex, filename, 0, NULL, 0) == 0
551 || regexec (&shmem_file_regex, filename, 0, NULL, 0) == 0
552 || regexec (&file_deleted_regex, filename, 0, NULL, 0) == 0)
602 int maybe_private_p,
int mapping_anon_p,
int mapping_file_p,
603 const char *filename)
612 int private_p = maybe_private_p;
617 if (strcmp (
"[vdso]", filename) == 0
618 || strcmp (
"[vsyscall]", filename) == 0)
648 if (mapping_anon_p && mapping_file_p)
656 else if (mapping_anon_p)
663 if (mapping_anon_p && mapping_file_p)
671 else if (mapping_anon_p)
697 if (args && isdigit (args[0]))
701 pid = strtoul (args, &tem, 10);
707 error (
_(
"No current process: you must name one."));
709 error (
_(
"Can't determine the current process's PID: you must name one."));
716 error (
_(
"Too many parameters: %s"), args);
721 xsnprintf (filename,
sizeof filename,
"/proc/%ld/cmdline", pid);
730 warning (
_(
"unable to open /proc file '%s'"), filename);
734 xsnprintf (filename,
sizeof filename,
"/proc/%ld/cwd", pid);
743 warning (
_(
"unable to read link '%s'"), filename);
747 xsnprintf (filename,
sizeof filename,
"/proc/%ld/exe", pid);
756 warning (
_(
"unable to read link '%s'"), filename);
760 xsnprintf (filename,
sizeof filename,
"/proc/%ld/maps", pid);
773 " Size",
" Offset",
"objfile");
780 " Size",
" Offset",
"objfile");
783 for (line = strtok (data,
"\n");
line; line = strtok (NULL,
"\n"))
786 const char *permissions, *device, *filename;
787 size_t permissions_len, device_len;
790 &permissions, &permissions_len,
791 &offset, &device, &device_len,
801 *filename? filename :
"");
810 *filename? filename :
"");
817 warning (
_(
"unable to open /proc file '%s'"), filename);
821 xsnprintf (filename,
sizeof filename,
"/proc/%ld/status", pid);
830 warning (
_(
"unable to open /proc file '%s'"), filename);
834 xsnprintf (filename,
sizeof filename,
"/proc/%ld/stat", pid);
839 const char *p = data;
849 const char *ep = strrchr (p,
')');
853 (
int) (ep - p - 1), p + 1);
920 "system boot): %s\n"),
967 warning (
_(
"unable to open /proc file '%s'"), filename);
978 unsigned char *descdata, *filenames, *descend, *contents;
980 unsigned int addr_size_bits, addr_size;
986 section = bfd_get_section_by_name (
core_bfd,
".note.linuxcore.file");
989 warning (
_(
"unable to find mappings in core file"));
994 addr_size = addr_size_bits / 8;
995 note_size = bfd_get_section_size (section);
997 if (note_size < 2 * addr_size)
998 error (
_(
"malformed core note - too short for header"));
1000 contents =
xmalloc (note_size);
1002 if (!bfd_get_section_contents (
core_bfd, section, contents, 0, note_size))
1003 error (
_(
"could not get core note contents"));
1005 descdata = contents;
1006 descend = descdata + note_size;
1008 if (descdata[note_size - 1] !=
'\0')
1009 error (
_(
"malformed note - does not end with \\0"));
1011 count = bfd_get (addr_size_bits,
core_bfd, descdata);
1012 descdata += addr_size;
1014 page_size = bfd_get (addr_size_bits,
core_bfd, descdata);
1015 descdata += addr_size;
1017 if (note_size < 2 * addr_size + count * 3 * addr_size)
1018 error (
_(
"malformed note - too short for supplied file count"));
1026 " Size",
" Offset",
"objfile");
1033 " Size",
" Offset",
"objfile");
1036 filenames = descdata + count * 3 * addr_size;
1041 if (filenames == descend)
1042 error (
_(
"malformed note - filenames end too early"));
1044 start = bfd_get (addr_size_bits,
core_bfd, descdata);
1045 descdata += addr_size;
1046 end = bfd_get (addr_size_bits,
core_bfd, descdata);
1047 descdata += addr_size;
1048 file_ofs = bfd_get (addr_size_bits,
core_bfd, descdata);
1049 descdata += addr_size;
1051 file_ofs *= page_size;
1068 filenames += 1 + strlen ((
char *) filenames);
1087 exe = bfd_core_file_failing_command (
core_bfd);
1091 warning (
_(
"unable to find command name in core file"));
1097 if (!exe_f && !mappings_f)
1098 error (
_(
"unable to handle request"));
1103 int read,
int write,
1104 int exec,
int modified,
1105 const char *filename,
1115 char mapsfilename[100];
1116 char coredumpfilter_name[100];
1117 char *
data, *coredumpfilterdata;
1135 xsnprintf (coredumpfilter_name,
sizeof (coredumpfilter_name),
1136 "/proc/%d/coredump_filter", pid);
1138 coredumpfilter_name);
1139 if (coredumpfilterdata != NULL)
1141 sscanf (coredumpfilterdata,
"%x", &filterflags);
1142 xfree (coredumpfilterdata);
1146 xsnprintf (mapsfilename,
sizeof mapsfilename,
"/proc/%d/smaps", pid);
1151 xsnprintf (mapsfilename,
sizeof mapsfilename,
"/proc/%d/maps", pid);
1160 line = strtok_r (data,
"\n", &t);
1161 while (line != NULL)
1164 const char *permissions, *device, *filename;
1166 size_t permissions_len, device_len;
1167 int read, write, exec, priv;
1168 int has_anonymous = 0;
1169 int should_dump_p = 0;
1173 memset (&v, 0,
sizeof (v));
1174 read_mapping (line, &addr, &endaddr, &permissions, &permissions_len,
1175 &offset, &device, &device_len, &inode, &filename);
1186 mapping_file_p = !mapping_anon_p;
1189 read = (memchr (permissions,
'r', permissions_len) != 0);
1190 write = (memchr (permissions,
'w', permissions_len) != 0);
1191 exec = (memchr (permissions,
'x', permissions_len) != 0);
1201 priv = memchr (permissions,
'p', permissions_len) != 0;
1205 for (line = strtok_r (NULL,
"\n", &t);
1206 line != NULL && line[0] >=
'A' && line[0] <=
'Z';
1207 line = strtok_r (NULL,
"\n", &t))
1211 if (sscanf (line,
"%64s", keyword) != 1)
1213 warning (
_(
"Error parsing {s,}maps file '%s'"), mapsfilename);
1217 if (strcmp (keyword,
"Anonymous:") == 0)
1223 else if (strcmp (keyword,
"VmFlags:") == 0)
1226 if (strcmp (keyword,
"AnonHugePages:") == 0
1227 || strcmp (keyword,
"Anonymous:") == 0)
1229 unsigned long number;
1231 if (sscanf (line,
"%*s%lu", &number) != 1)
1233 warning (
_(
"Error parsing {s,}maps file '%s' number"),
1262 mapping_anon_p, mapping_file_p,
1273 func (addr, endaddr - addr, offset, inode,
1274 read, write, exec, 1,
1306 int read,
int write,
int exec,
int modified,
1307 const char *filename,
void *arg)
1311 return data->
func (vaddr, size, read, write, exec, modified, data->
obfd);
1343 static enum gdb_signal
1352 return GDB_SIGNAL_0;
1360 static const char *spu_files[] =
1391 for (i = 0; i <
size; i += 4)
1395 for (j = 0; j <
sizeof (spu_files) /
sizeof (spu_files[0]); j++)
1397 char annex[32], note_name[32];
1401 xsnprintf (annex,
sizeof annex,
"%d/%s", fd, spu_files[j]);
1406 xsnprintf (note_name,
sizeof note_name,
"SPU/%s", annex);
1407 note_data = elfcore_write_note (obfd, note_data, note_size,
1454 int read,
int write,
int exec,
int modified,
1455 const char *filename,
void *data)
1460 if (*filename ==
'\0' || inode == 0)
1484 char *note_data,
int *note_size)
1487 struct obstack data_obstack, filename_obstack;
1489 struct type *long_type
1493 obstack_init (&data_obstack);
1495 obstack_init (&filename_obstack);
1504 obstack_blank (&data_obstack,
TYPE_LENGTH (long_type));
1508 obstack_grow (&data_obstack, buf,
TYPE_LENGTH (long_type));
1520 obstack_grow (&data_obstack, obstack_base (&filename_obstack),
1521 obstack_object_size (&filename_obstack));
1523 note_data = elfcore_write_note (obfd, note_data, note_size,
1525 obstack_base (&data_obstack),
1526 obstack_object_size (&data_obstack));
1555 const char *human_name,
void *cb_data)
1569 if (strcmp (sect_name,
".reg") == 0)
1570 data->
note_data = (
char *) elfcore_write_prstatus
1574 data->
note_data = (
char *) elfcore_write_register_note
1576 sect_name, buf, size);
1623 struct type *siginfo_type;
1699 if (siginfo_data != NULL)
1704 siginfo_data, siginfo_size);
1728 const char *basename;
1733 char *proc_stat, *proc_status;
1737 const char valid_states[] =
"RSDTZW";
1739 const char *prog_state;
1745 unsigned int pr_flag;
1758 xsnprintf (filename,
sizeof (filename),
"/proc/%d/cmdline", (
int) pid);
1761 if (fname == NULL || *fname ==
'\0')
1770 memset (p, 0,
sizeof (*p));
1776 basename = lbasename (fname);
1777 strncpy (p->pr_fname, basename, sizeof (p->pr_fname));
1778 p->pr_fname[
sizeof (p->pr_fname) - 1] =
'\0';
1782 psargs = xstrdup (fname);
1783 if (infargs != NULL)
1784 psargs = reconcat (psargs, psargs,
" ", infargs, NULL);
1788 strncpy (p->pr_psargs, psargs, sizeof (p->pr_psargs));
1789 p->pr_psargs[
sizeof (p->pr_psargs) - 1] =
'\0';
1791 xsnprintf (filename,
sizeof (filename),
"/proc/%d/stat", (
int) pid);
1795 if (proc_stat == NULL || *proc_stat ==
'\0')
1814 while (isdigit (*proc_stat))
1820 proc_stat = strrchr (proc_stat,
')');
1821 if (proc_stat == NULL)
1830 n_fields = sscanf (proc_stat,
1842 &p->pr_ppid, &p->pr_pgrp, &p->pr_sid,
1856 prog_state = strchr (valid_states, pr_sname);
1857 if (prog_state != NULL)
1858 p->pr_state = prog_state - valid_states;
1865 p->pr_sname = p->pr_state > 5 ?
'.' : pr_sname;
1866 p->pr_zomb = p->pr_sname ==
'Z';
1867 p->pr_nice = pr_nice;
1868 p->pr_flag = pr_flag;
1872 xsnprintf (filename,
sizeof (filename),
"/proc/%d/status", (
int) pid);
1876 if (proc_status == NULL || *proc_status ==
'\0')
1884 tmpstr = strstr (proc_status,
"Uid:");
1888 tmpstr +=
sizeof (
"Uid:");
1889 while (*tmpstr !=
'\0' && !isdigit (*tmpstr))
1892 if (isdigit (*tmpstr))
1893 p->pr_uid = strtol (tmpstr, &tmpstr, 10);
1897 tmpstr = strstr (proc_status,
"Gid:");
1901 tmpstr +=
sizeof (
"Gid:");
1902 while (*tmpstr !=
'\0' && !isdigit (*tmpstr))
1905 if (isdigit (*tmpstr))
1906 p->pr_gid = strtol (tmpstr, &tmpstr, 10);
1921 struct elf_internal_linux_prpsinfo prpsinfo;
1922 char *note_data = NULL;
1934 note_data, note_size,
1940 note_data = elfcore_write_linux_prpsinfo64 (obfd,
1941 note_data, note_size,
1944 note_data = elfcore_write_linux_prpsinfo32 (obfd,
1945 note_data, note_size,
1961 thread_args.
gdbarch = gdbarch;
1963 thread_args.
obfd = obfd;
1977 note_data = elfcore_write_note (obfd, note_data, note_size,
1978 "CORE", NT_AUXV, auxv, auxv_len);
1992 note_data, note_size);
2007 return GDB_SIGNAL_0;
2010 return GDB_SIGNAL_HUP;
2013 return GDB_SIGNAL_INT;
2016 return GDB_SIGNAL_QUIT;
2019 return GDB_SIGNAL_ILL;
2022 return GDB_SIGNAL_TRAP;
2025 return GDB_SIGNAL_ABRT;
2028 return GDB_SIGNAL_BUS;
2031 return GDB_SIGNAL_FPE;
2034 return GDB_SIGNAL_KILL;
2037 return GDB_SIGNAL_USR1;
2040 return GDB_SIGNAL_SEGV;
2043 return GDB_SIGNAL_USR2;
2046 return GDB_SIGNAL_PIPE;
2049 return GDB_SIGNAL_ALRM;
2052 return GDB_SIGNAL_TERM;
2055 return GDB_SIGNAL_CHLD;
2058 return GDB_SIGNAL_CONT;
2061 return GDB_SIGNAL_STOP;
2064 return GDB_SIGNAL_TSTP;
2067 return GDB_SIGNAL_TTIN;
2070 return GDB_SIGNAL_TTOU;
2073 return GDB_SIGNAL_URG;
2076 return GDB_SIGNAL_XCPU;
2079 return GDB_SIGNAL_XFSZ;
2082 return GDB_SIGNAL_VTALRM;
2085 return GDB_SIGNAL_PROF;
2088 return GDB_SIGNAL_WINCH;
2093 return GDB_SIGNAL_IO;
2096 return GDB_SIGNAL_PWR;
2099 return GDB_SIGNAL_SYS;
2104 return GDB_SIGNAL_REALTIME_32;
2107 return GDB_SIGNAL_REALTIME_64;
2114 return (
enum gdb_signal) ((
int) GDB_SIGNAL_REALTIME_33 + offset);
2117 return GDB_SIGNAL_UNKNOWN;
2126 enum gdb_signal signal)
2133 case GDB_SIGNAL_HUP:
2136 case GDB_SIGNAL_INT:
2139 case GDB_SIGNAL_QUIT:
2142 case GDB_SIGNAL_ILL:
2145 case GDB_SIGNAL_TRAP:
2148 case GDB_SIGNAL_ABRT:
2151 case GDB_SIGNAL_FPE:
2154 case GDB_SIGNAL_KILL:
2157 case GDB_SIGNAL_BUS:
2160 case GDB_SIGNAL_SEGV:
2163 case GDB_SIGNAL_SYS:
2166 case GDB_SIGNAL_PIPE:
2169 case GDB_SIGNAL_ALRM:
2172 case GDB_SIGNAL_TERM:
2175 case GDB_SIGNAL_URG:
2178 case GDB_SIGNAL_STOP:
2181 case GDB_SIGNAL_TSTP:
2184 case GDB_SIGNAL_CONT:
2187 case GDB_SIGNAL_CHLD:
2190 case GDB_SIGNAL_TTIN:
2193 case GDB_SIGNAL_TTOU:
2199 case GDB_SIGNAL_XCPU:
2202 case GDB_SIGNAL_XFSZ:
2205 case GDB_SIGNAL_VTALRM:
2208 case GDB_SIGNAL_PROF:
2211 case GDB_SIGNAL_WINCH:
2214 case GDB_SIGNAL_USR1:
2217 case GDB_SIGNAL_USR2:
2220 case GDB_SIGNAL_PWR:
2223 case GDB_SIGNAL_POLL:
2228 case GDB_SIGNAL_REALTIME_32:
2232 case GDB_SIGNAL_REALTIME_64:
2237 if (signal >= GDB_SIGNAL_REALTIME_33
2238 && signal <= GDB_SIGNAL_REALTIME_63)
2240 int offset = signal - GDB_SIGNAL_REALTIME_33;
2252 int read,
int write,
int exec,
int modified,
2257 if (vaddr == range->
start)
2308 #define GDB_MMAP_MAP_PRIVATE 0x02
2309 #define GDB_MMAP_MAP_ANONYMOUS 0x20
2320 struct value *addr_val;
2325 ARG_ADDR, ARG_LENGTH, ARG_PROT, ARG_FLAGS, ARG_FD, ARG_OFFSET, ARG_LAST
2327 struct value *arg[ARG_LAST];
2347 error (
_(
"Failed inferior mmap call for %s bytes, errno is changed."),
2359 struct value *retval_val;
2364 ARG_ADDR, ARG_LENGTH, ARG_LAST
2366 struct value *arg[ARG_LAST];
2376 warning (
_(
"Failed inferior munmap call at %s for %s bytes, "
2377 "errno is changed."),
2396 error (
_(
"Cannot find AT_ENTRY auxiliary vector entry."));
2420 " corefiles is %s.\n"), value);
2452 linux_gdbarch_data_handle =
2464 Set whether gcore should consider /proc/PID/coredump_filter."),
2466 Show whether gcore should consider /proc/PID/coredump_filter."),
2468 Use this command to set whether gcore should consider the contents\n\
2469 of /proc/PID/coredump_filter when generating the corefile. For more information\n\
2470 about this file, refer to the manpage of core(5)."),
struct gdbarch * target_gdbarch(void)
ssize_t read(int fd, void *buf, size_t count)
ULONGEST extract_unsigned_integer(const gdb_byte *, int, enum bfd_endian)
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)
struct value * call_function_by_hand(struct value *function, int nargs, struct value **args)
unsigned int exclude_coredump
static void * init_linux_gdbarch_data(struct gdbarch *gdbarch)
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)
static linux_find_memory_region_ftype linux_make_mappings_callback
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)
struct gdbarch * get_regcache_arch(const struct regcache *regcache)
LONGEST value_as_long(struct value *val)
int gdbarch_int_bit(struct gdbarch *gdbarch)
void warning(const char *fmt,...)
#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)
void * gdbarch_data(struct gdbarch *gdbarch, struct gdbarch_data *data)
static int linux_vsyscall_range(struct gdbarch *gdbarch, struct mem_range *range)
#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)
static int find_mapping_size(CORE_ADDR vaddr, unsigned long size, int read, int write, int exec, int modified, void *data)
int gdbarch_long_bit(struct gdbarch *gdbarch)
struct type * arch_composite_type(struct gdbarch *gdbarch, char *name, enum type_code code)
struct observer * observer_attach_inferior_exit(observer_inferior_exit_ftype *f)
void append_composite_type_field_aligned(struct type *t, char *name, struct type *field, int alignment)
void target_fetch_registers(struct regcache *regcache, int regno)
char * skip_spaces(char *chp)
struct obstack * filename_obstack
enum gdb_signal stop_signal
unsigned int uses_huge_tlb
static char * linux_core_pid_to_str(struct gdbarch *gdbarch, ptid_t ptid)
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)
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 gdb_byte * linux_get_siginfo_data(struct gdbarch *gdbarch, LONGEST *size)
static void invalidate_linux_cache_inf(struct inferior *inf)
void null_cleanup(void *arg)
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 *)
initialize_file_ftype _initialize_linux_tdep
#define GDB_MMAP_MAP_ANONYMOUS
struct cmd_list_element * setlist
static int mapping_is_anonymous_p(const char *filename)
struct cleanup * save_inferior_ptid(void)
unsigned int initialized_p
int gdbarch_find_memory_regions(struct gdbarch *gdbarch, find_memory_region_ftype func, void *data)
int gdbarch_iterate_over_regset_sections_p(struct gdbarch *gdbarch)
#define CATCH(EXCEPTION, MASK)
struct target_ops current_target
enum gdb_signal linux_gdb_signal_from_target(struct gdbarch *gdbarch, int signal)
void initialize_file_ftype(void)
static CORE_ADDR linux_infcall_mmap(CORE_ADDR size, unsigned prot)
int gdbarch_find_memory_regions_p(struct gdbarch *gdbarch)
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
const char * skip_spaces_const(const char *chp)
struct cleanup * compile_rx_or_error(regex_t *pattern, const char *rx, const char *message)
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 gdbarch_elfcore_write_linux_prpsinfo_p(struct gdbarch *gdbarch)
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
static void decode_vmflags(char *p, struct smaps_vmflags *v)
static int dump_mapping_p(enum filterflags filterflags, const struct smaps_vmflags *v, int maybe_private_p, int mapping_anon_p, int mapping_file_p, const char *filename)
static int linux_find_memory_regions(struct gdbarch *gdbarch, find_memory_region_ftype func, void *obfd)
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
static enum gdb_signal find_stop_signal(void)
struct type * arch_integer_type(struct gdbarch *gdbarch, int bit, int unsigned_p, char *name)
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)
char * target_fileio_read_stralloc(struct inferior *inf, const char *filename)
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)
CORE_ADDR linux_displaced_step_location(struct gdbarch *gdbarch)
char * normal_pid_to_str(ptid_t ptid)
static int find_signalled_thread(struct thread_info *info, void *data)
int ptid_get_pid(ptid_t ptid)
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)
const char const char int
struct gdbarch * gdbarch_from_bfd(bfd *abfd)
void append_composite_type_field(struct type *t, char *name, struct type *field)
struct value * value_from_pointer(struct type *type, CORE_ADDR addr)
void discard_cleanups(struct cleanup *old_chain)
long ptid_get_tid(ptid_t ptid)
#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)
char * gdbarch_elfcore_write_linux_prpsinfo(struct gdbarch *gdbarch, bfd *obfd, char *note_data, int *note_size, const struct elf_internal_linux_prpsinfo *info)
void update_thread_list(void)
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
struct ui_file * gdb_stderr
const struct regcache * regcache
struct thread_suspend_state suspend
struct inferior * current_inferior(void)
unsigned long long ULONGEST
static int linux_find_memory_regions_full(struct gdbarch *gdbarch, linux_find_memory_region_ftype *func, void *obfd)
long ptid_get_lwp(ptid_t ptid)
#define obstack_grow_str0(OBSTACK, STRING)
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 int linux_corefile_thread_callback(struct thread_info *info, void *data)
static struct linux_info * get_linux_inferior_data(void)
static int use_coredump_filter
#define TYPE_LENGTH(thistype)
struct type * arch_type(struct gdbarch *gdbarch, enum type_code code, int length, char *name)
struct cleanup * make_cleanup_obstack_free(struct obstack *obstack)
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)
struct type * gdbarch_get_siginfo_type(struct gdbarch *gdbarch)
void error(const char *fmt,...)
unsigned int shared_mapping
struct gdbarch_data * gdbarch_data_register_post_init(gdbarch_data_post_init_ftype *post_init)
#define skip_to_space(INP)
mach_port_t mach_port_t name mach_port_t mach_port_t name error_t int int rusage_t pid_t pid
struct type * lookup_pointer_type(struct type *type)
void do_cleanups(struct cleanup *old_chain)
void set_gdbarch_vsyscall_range(struct gdbarch *gdbarch, gdbarch_vsyscall_range_ftype vsyscall_range)
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_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
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)
collect_regset_ftype * collect_regset