diff options
author | Tristan Gingold <gingold@adacore.com> | 2009-10-06 07:23:05 +0000 |
---|---|---|
committer | Tristan Gingold <gingold@adacore.com> | 2009-10-06 07:23:05 +0000 |
commit | 15c19d39c2995d6cf2fdf4c46f23b853604b4b29 (patch) | |
tree | 7b9154c91927ae8330dc522cbac112da47a0efbf | |
parent | 3e6b03994fa6454c213d4bf1f534fe67671ece81 (diff) | |
download | gdb-15c19d39c2995d6cf2fdf4c46f23b853604b4b29.zip gdb-15c19d39c2995d6cf2fdf4c46f23b853604b4b29.tar.gz gdb-15c19d39c2995d6cf2fdf4c46f23b853604b4b29.tar.bz2 |
2009-10-06 Tristan Gingold <gingold@adacore.com>
* darwin-nat.c: Add __TEXT __info_plist content.
(darwin_attach_pid): Update error message.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/darwin-nat.c | 30 |
2 files changed, 34 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 4ea2117..8e7bf5f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2009-10-06 Tristan Gingold <gingold@adacore.com> + + * darwin-nat.c: Add __TEXT __info_plist content. + (darwin_attach_pid): Update error message. + 2009-10-06 Joel Brobecker <brobecker@adacore.com> * MAINTAINERS: Add Tristan Gingold as Maintainer of the Darwin port. diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c index 237c465..daa9df9 100644 --- a/gdb/darwin-nat.c +++ b/gdb/darwin-nat.c @@ -147,6 +147,34 @@ static struct inferior *darwin_inf_fake_stop; /* This controls output of inferior debugging. */ static int darwin_debug_flag = 0; +/* Create a __TEXT __info_plist section in the executable so that gdb could + be signed. This is required to get an authorization for task_for_pid. + + Once gdb is built, you can either: + * make it setgid procmod + * or codesign it with any system-trusted signing authority. + See taskgated(8) for details. */ +static const unsigned char info_plist[] +__attribute__ ((section ("__TEXT,__info_plist"),used)) = + "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\"" + " \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n" + "<plist version=\"1.0\">\n" + "<dict>\n" + " <key>CFBundleIdentifier</key>\n" + " <string>org.gnu.gdb</string>\n" + " <key>CFBundleName</key>\n" + " <string>gdb</string>\n" + " <key>CFBundleVersion</key>\n" + " <string>1.0</string>\n" + " <key>SecTaskAccess</key>\n" + " <array>\n" + " <string>allowed</string>\n" + " <string>debug</string>\n" + " </array>\n" + "</dict>\n" + "</plist>\n"; + static void inferior_debug (int level, const char *fmt, ...) { @@ -1323,7 +1351,7 @@ darwin_attach_pid (struct inferior *inf) } error (_("Unable to find Mach task port for process-id %d: %s (0x%lx).\n" - " (please check gdb is setgid procmod)"), + " (please check gdb is codesigned - see taskgated(8))"), inf->pid, mach_error_string (kret), (unsigned long) kret); } |