| OLD | NEW |
| 1 /* GNU/Linux native-dependent code common to multiple platforms. | 1 /* GNU/Linux native-dependent code common to multiple platforms. |
| 2 | 2 |
| 3 Copyright (C) 2001-2012 Free Software Foundation, Inc. | 3 Copyright (C) 2001-2012 Free Software Foundation, Inc. |
| 4 | 4 |
| 5 This file is part of GDB. | 5 This file is part of GDB. |
| 6 | 6 |
| 7 This program is free software; you can redistribute it and/or modify | 7 This program is free software; you can redistribute it and/or modify |
| 8 it under the terms of the GNU General Public License as published by | 8 it under the terms of the GNU General Public License as published by |
| 9 the Free Software Foundation; either version 3 of the License, or | 9 the Free Software Foundation; either version 3 of the License, or |
| 10 (at your option) any later version. | 10 (at your option) any later version. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 #endif | 29 #endif |
| 30 #include <sys/ptrace.h> | 30 #include <sys/ptrace.h> |
| 31 #include "linux-nat.h" | 31 #include "linux-nat.h" |
| 32 #include "linux-ptrace.h" | 32 #include "linux-ptrace.h" |
| 33 #include "linux-procfs.h" | 33 #include "linux-procfs.h" |
| 34 #include "linux-fork.h" | 34 #include "linux-fork.h" |
| 35 #include "gdbthread.h" | 35 #include "gdbthread.h" |
| 36 #include "gdbcmd.h" | 36 #include "gdbcmd.h" |
| 37 #include "regcache.h" | 37 #include "regcache.h" |
| 38 #include "regset.h" | 38 #include "regset.h" |
| 39 #include "inf-child.h" |
| 39 #include "inf-ptrace.h" | 40 #include "inf-ptrace.h" |
| 40 #include "auxv.h" | 41 #include "auxv.h" |
| 41 #include <sys/param.h> /* for MAXPATHLEN */ | 42 #include <sys/param.h> /* for MAXPATHLEN */ |
| 42 #include <sys/procfs.h> /* for elf_gregset etc. */ | 43 #include <sys/procfs.h> /* for elf_gregset etc. */ |
| 43 #include "elf-bfd.h" /* for elfcore_write_* */ | 44 #include "elf-bfd.h" /* for elfcore_write_* */ |
| 44 #include "gregset.h" /* for gregset */ | 45 #include "gregset.h" /* for gregset */ |
| 45 #include "gdbcore.h" /* for get_exec_file */ | 46 #include "gdbcore.h" /* for get_exec_file */ |
| 46 #include <ctype.h> /* for isdigit */ | 47 #include <ctype.h> /* for isdigit */ |
| 47 #include "gdbthread.h" /* for struct thread_info etc. */ | 48 #include "gdbthread.h" /* for struct thread_info etc. */ |
| 48 #include "gdb_stat.h" /* for struct stat */ | 49 #include "gdb_stat.h" /* for struct stat */ |
| 49 #include <fcntl.h> /* for O_RDONLY */ | 50 #include <fcntl.h> /* for O_RDONLY */ |
| 50 #include "inf-loop.h" | 51 #include "inf-loop.h" |
| 51 #include "event-loop.h" | 52 #include "event-loop.h" |
| 52 #include "event-top.h" | 53 #include "event-top.h" |
| 53 #include <pwd.h> | 54 #include <pwd.h> |
| 54 #include <sys/types.h> | 55 #include <sys/types.h> |
| 55 #include "gdb_dirent.h" | 56 #include "gdb_dirent.h" |
| 56 #include "xml-support.h" | 57 #include "xml-support.h" |
| 57 #include "terminal.h" | 58 #include "terminal.h" |
| 58 #include <sys/vfs.h> | 59 #include <sys/vfs.h> |
| 59 #include "solib.h" | 60 #include "solib.h" |
| 60 #include "linux-osdata.h" | 61 #include "linux-osdata.h" |
| 61 #include "cli/cli-utils.h" | 62 #include "linux-tdep.h" |
| 63 #include "symfile.h" |
| 64 #include "agent.h" |
| 65 #include "tracepoint.h" |
| 66 #include "exceptions.h" |
| 67 #include "linux-ptrace.h" |
| 68 #include "buffer.h" |
| 62 | 69 |
| 63 #ifndef SPUFS_MAGIC | 70 #ifndef SPUFS_MAGIC |
| 64 #define SPUFS_MAGIC 0x23c9b64e | 71 #define SPUFS_MAGIC 0x23c9b64e |
| 65 #endif | 72 #endif |
| 66 | 73 |
| 67 #ifdef HAVE_PERSONALITY | 74 #ifdef HAVE_PERSONALITY |
| 68 # include <sys/personality.h> | 75 # include <sys/personality.h> |
| 69 # if !HAVE_DECL_ADDR_NO_RANDOMIZE | 76 # if !HAVE_DECL_ADDR_NO_RANDOMIZE |
| 70 # define ADDR_NO_RANDOMIZE 0x0040000 | 77 # define ADDR_NO_RANDOMIZE 0x0040000 |
| 71 # endif | 78 # endif |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 PTRACE_O_TRACESYSGOOD syscall events doesn't return SIGTRAP, but | 174 PTRACE_O_TRACESYSGOOD syscall events doesn't return SIGTRAP, but |
| 168 instead SIGTRAP with bit 7 set. */ | 175 instead SIGTRAP with bit 7 set. */ |
| 169 #define SYSCALL_SIGTRAP (SIGTRAP | 0x80) | 176 #define SYSCALL_SIGTRAP (SIGTRAP | 0x80) |
| 170 | 177 |
| 171 /* The single-threaded native GNU/Linux target_ops. We save a pointer for | 178 /* The single-threaded native GNU/Linux target_ops. We save a pointer for |
| 172 the use of the multi-threaded target. */ | 179 the use of the multi-threaded target. */ |
| 173 static struct target_ops *linux_ops; | 180 static struct target_ops *linux_ops; |
| 174 static struct target_ops linux_ops_saved; | 181 static struct target_ops linux_ops_saved; |
| 175 | 182 |
| 176 /* The method to call, if any, when a new thread is attached. */ | 183 /* The method to call, if any, when a new thread is attached. */ |
| 177 static void (*linux_nat_new_thread) (ptid_t); | 184 static void (*linux_nat_new_thread) (struct lwp_info *); |
| 185 |
| 186 /* Hook to call prior to resuming a thread. */ |
| 187 static void (*linux_nat_prepare_to_resume) (struct lwp_info *); |
| 178 | 188 |
| 179 /* The method to call, if any, when the siginfo object needs to be | 189 /* The method to call, if any, when the siginfo object needs to be |
| 180 converted between the layout returned by ptrace, and the layout in | 190 converted between the layout returned by ptrace, and the layout in |
| 181 the architecture of the inferior. */ | 191 the architecture of the inferior. */ |
| 182 static int (*linux_nat_siginfo_fixup) (struct siginfo *, | 192 static int (*linux_nat_siginfo_fixup) (siginfo_t *, |
| 183 gdb_byte *, | 193 gdb_byte *, |
| 184 int); | 194 int); |
| 185 | 195 |
| 186 /* The saved to_xfer_partial method, inherited from inf-ptrace.c. | 196 /* The saved to_xfer_partial method, inherited from inf-ptrace.c. |
| 187 Called by our to_xfer_partial. */ | 197 Called by our to_xfer_partial. */ |
| 188 static LONGEST (*super_xfer_partial) (struct target_ops *, | 198 static LONGEST (*super_xfer_partial) (struct target_ops *, |
| 189 enum target_object, | 199 enum target_object, |
| 190 const char *, gdb_byte *, | 200 const char *, gdb_byte *, |
| 191 const gdb_byte *, | 201 const gdb_byte *, |
| 192 ULONGEST, LONGEST); | 202 ULONGEST, LONGEST); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 (enum inferior_event_type event_type, | 285 (enum inferior_event_type event_type, |
| 276 void *context), | 286 void *context), |
| 277 void *context); | 287 void *context); |
| 278 static int kill_lwp (int lwpid, int signo); | 288 static int kill_lwp (int lwpid, int signo); |
| 279 | 289 |
| 280 static int stop_callback (struct lwp_info *lp, void *data); | 290 static int stop_callback (struct lwp_info *lp, void *data); |
| 281 | 291 |
| 282 static void block_child_signals (sigset_t *prev_mask); | 292 static void block_child_signals (sigset_t *prev_mask); |
| 283 static void restore_child_signals_mask (sigset_t *prev_mask); | 293 static void restore_child_signals_mask (sigset_t *prev_mask); |
| 284 | 294 |
error: old chunk mismatch |
None
| OLD | NEW |