~ubuntu-branches/ubuntu/natty/gdb/natty

« back to all changes in this revision

Viewing changes to gdb/inf-ptrace.c

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook
  • Date: 2010-06-08 15:46:44 UTC
  • Revision ID: james.westby@ubuntu.com-20100608154644-9e0pp8247xe11l0m
Tags: 7.1-1ubuntu3
Add debian/patches/ptrace-error-verbosity.patch: try to make PTRACE
scope sysctl more discoverable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
212
212
  errno = 0;
213
213
  ptrace (PT_ATTACH, pid, (PTRACE_TYPE_ARG3)0, 0);
214
214
  if (errno != 0)
215
 
    perror_with_name (("ptrace"));
 
215
    {
 
216
      if (errno == EPERM)
 
217
        {
 
218
              fprintf_unfiltered (gdb_stderr,
 
219
            _("Could not attach to process.  If your uid matches the uid of the target\n"
 
220
              "process, check the setting of /proc/sys/kernel/ptrace_scope, or try again\n"
 
221
              "as the root user.  For more details, see /etc/sysctl.d/10-ptrace.conf\n"));
 
222
        }
 
223
      perror_with_name (("ptrace"));
 
224
    }
216
225
#else
217
226
  error (_("This system does not support attaching to a process"));
218
227
#endif