OSDN Git Service

Doc: debugger cannot attach to running process on Linux
authorLeena Miettinen <riitta-leena.miettinen@nokia.com>
Thu, 7 Apr 2011 12:19:30 +0000 (14:19 +0200)
committerLeena Miettinen <riitta-leena.miettinen@nokia.com>
Thu, 7 Apr 2011 12:58:35 +0000 (14:58 +0200)
Reviewed-by: hjk
doc/qtcreator.qdoc

index 1cbdf4a..d5e9349 100644 (file)
            paths may fail. For example, remounting parts of a file system
            using the --bind mount option.
 
-        \o You must use a workaround to use the DYLD_IMAGE_SUFFIX option in the
-           \gui Projects tab on Mac OS X  Snow Leopard. For more information on
-           the issue, see
-           \l{http://wimleers.com/blog/dyld-image-suffix-causing-havoc-on-mac-os-x-snow-leopard}{DYLD_IMAGE_SUFFIX causing havoc on Mac OS X Snow Leopard}.
-
-           To use the option, enter the following commands in the Terminal
-           application:
-           \code
-           sudo mv /usr/lib/libSystem.B_debug.dylib /usr/lib/libSystem.B_debug.dylib.backup
-           sudo cp /usr/lib/libSystem.B.dylib /usr/lib/libSystem.B_debug.dylib.backup
-           \endcode
-
     \endlist
 
     \section1 Qt Quick Designer Issues
 
     \endlist
 
-    \section1 Directly Displaying Pointer Variable Members
+    \section1 Pointer Variable Members Are Not Displayed Directly
 
     When you use the \gui {Locals and Watchers} view to inspect a pointer
     variable and expand the variable tree item, another tree item level
     helpers operate on wrong data and come to wrong conclusions. Most likely,
     they find garbage and declare the variable to be <not in scope>.
 
+    \section1 Application Crashes when Debugging on Mac OS X Snow Leopard
+
+    You must use a workaround to use the DYLD_IMAGE_SUFFIX option in the
+    \gui Projects tab on Mac OS X  Snow Leopard. For more information on the
+    issue, see
+    \l{http://wimleers.com/blog/dyld-image-suffix-causing-havoc-on-mac-os-x-snow-leopard}{DYLD_IMAGE_SUFFIX causing havoc on Mac OS X Snow Leopard}.
+
+    To use the option, enter the following commands in the Terminal
+    application:
+           \code
+           sudo mv /usr/lib/libSystem.B_debug.dylib /usr/lib/libSystem.B_debug.dylib.backup
+           sudo cp /usr/lib/libSystem.B.dylib /usr/lib/libSystem.B_debug.dylib.backup
+           \endcode
+
+     \section1 Debugger Cannot Attach to Running Process on Linux
+
+    GDB uses \c ptrace to attach to running processes. Some Linux distributions
+    do not allow this, which stops all attempts to either directly attach to an
+    existing process or use the \gui {Run in terminal} option in Qt Creator.
+
+    The reasons for this are described in
+    \l{https://wiki.ubuntu.com/SecurityTeam/Roadmap/KernelHardening#ptrace%20Protection}{KernelHardening}.
+
+    However, the usefulness of this security measure seems dubious,
+    because this feature can be easily disabled. With root permissions, you can
+    disable the feature immediately by writing \c{0} into
+    \c{/proc/sys/kernel/yama/ptrace_scope}. Even if you do not have elevated
+    permissions, you can disable the feature later by adding a library that
+    calls \c{prctl(0x59616d61, getppid(), 0, 0, 0);}, such as the one in
+    \c{$QTCREATORDIR/lib/libptracepreload.so} to the LD_PRELOAD environment.
+
     */
 
 
     \contentspage index.html
     \previouspage creator-debugging-qml.html
     \page creator-analyzer.html
-    \nextpage creator-maemo-emulator.html
+    \nextpage creator-troubleshooting-debugging.html
 
     \title Detecting Memory Leaks