]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add comments in getoff.c to clarify its intended usage.
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Sun, 17 Aug 2014 13:33:57 +0000 (13:33 +0000)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Sun, 17 Aug 2014 13:33:57 +0000 (13:33 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14299

auxprogs/getoff.c

index aed5f29d43c83d4ac6d19aa625145dbde2d00ef2..b209a1f097354f33971d1db271d90794bda8481e 100644 (file)
    The GNU General Public License is contained in the file COPYING.
 */
 
+/* This file is used to generate target executable(s) getoff-<platform>
+   In a bi-arch setup, this is used to build 2 executables
+   (for the primary and secondary platforms).
+
+   This program uses user space libraries to retrieve some platform
+   dependent offsets needed for Valgrind core, but that cannot (easily)
+   be retrieved by Valgrind core.
+
+   This is currently used only for handling the gdbsrv QGetTlsAddr query :
+   it only computes and outputs lm_modid_offset in struct link_map
+   of the dynamic linker. In theory, we should also compute the offset needed
+   to get the dtv from the thread register/pointer/...
+   Currently, the various valgrind-low-xxxxxx.c files are hardcoding this
+   offset as it is deemed (?) stable, and there is no clear way how to
+   compute this dtv offset.
+
+   The getoff-<platform> executable will be launched automatically by
+   Valgrind gdbserver when the first QGetTlsAddr query is retrieved. 
+
+   On plaforms that do not support __thread and/or that do not provide
+   dlinfo RTLD_DI_TLS_MODID, this executable produces no output. */
+   
 #ifndef _GNU_SOURCE
 #define _GNU_SOURCE
 #endif
@@ -63,13 +85,7 @@ void usage (char* progname)
 progname);
 
 }
-/* Currently, only computes and output lm_modid_offset in struct link_map
-   of the dynamic linker. In theory, we should also compute the offset needed
-   to get the dtv from the thread register/pointer/...
-   Currently, the various valgrind-low-xxxxxx.c files are hardcoding this
-   offset as it is deemed (?) stable, and there is no clear way how to
-   compute this dtv offset.
-*/
+
 int main (int argc, char** argv)
 {
    int i;