]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Switch to using a more generic loaded-module-list func
authorVMware, Inc <>
Wed, 20 Jan 2010 21:30:24 +0000 (13:30 -0800)
committerMarcelo Vanzin <mvanzin@vmware.com>
Wed, 20 Jan 2010 21:30:24 +0000 (13:30 -0800)
There is a not-very-generic loaded-module-list function
in lib/user (which is Linux-only).  For other reasons,
I've written a more generic one in lib/coreDump
(checked in with a previous review, cn970593) that works
for Linux, Windows, and Mac.

Delete the old one, and hook up the one callsite to call the
new one.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/lib/include/util.h
open-vm-tools/lib/user/util.c

index 8972bd2536f24d755bee5835dea8908617a1e9a6..de749ff026a4a05fec2f284db14d65c23238cff3 100644 (file)
@@ -144,10 +144,6 @@ void Util_BacktraceToBuffer(uintptr_t *basePtr,
 
 int Util_CompareDotted(const char *s1, const char *s2);
 
-#if defined(__linux__)
-void Util_PrintLoadedObjects(void *addr_inside_exec);
-#endif
-
 #if defined(VMX86_STATS)
 Bool Util_QueryCStResidency(uint32 *numCpus, uint32 *numCStates,
                             uint64 **transitns, uint64 **residency,
index 328703e081325db13c1efbc873f93f0cffbd2b64..d6e229a5f9e73489bf4948a73c80f1d9b9a1b712 100644 (file)
@@ -1778,72 +1778,6 @@ Util_SeparateStrings(char *source,              // IN
 
 #endif /* !defined(N_PLAT_NLM) */
 
-#if defined (__linux__) && !defined(VMX86_TOOLS)
-/*
- *-----------------------------------------------------------------------------
- *
- * UtilPrintLoadedObjectsCallback --
- *
- *       Callback from dl_iterate_phdr to add info for a single  
- *       loaded object to the log.
- *
- * Results:
- *       0: continue iterating/success 
- *       non-zero: stop iterating/error
- *
- * Side effects:
- *       None. 
- *
- *-----------------------------------------------------------------------------
- */
-
-static int
-UtilPrintLoadedObjectsCallback(struct dl_phdr_info *info,  //IN
-                                size_t size,               //IN
-                                void *data)                //IN
-{
-   /* Blank name means things like stack, which we don't care about */
-   if (strcmp(info->dlpi_name, "")) {
-      Log("Object %s loaded at %p\n", info->dlpi_name, 
-          (void *)info->dlpi_addr); 
-   }
-   return 0;
-}
-
-
-/*
- *----------------------------------------------------------------------
- *
- * Util_PrintLoadedObjects --
- *
- *      Print the list of loaded objects to the log.  Useful in
- *      parsing backtraces with ASLR.
- *
- * Results:
- *
- *      void
- *
- * Side effects:
- *      None.
- *
- *----------------------------------------------------------------------
- */
-
-void 
-Util_PrintLoadedObjects(void *addr_inside_exec) 
-{
-   Dl_info dli;
-
-   Log("Printing loaded objects\n"); 
-   if (dladdr(addr_inside_exec, &dli)) {
-      Log("Object %s loaded at %p\n", dli.dli_fname,
-          (void *)dli.dli_fbase);
-   }
-   dl_iterate_phdr(UtilPrintLoadedObjectsCallback, NULL);
-   Log("End printing loaded objects\n");
-}
-#endif
-
 #if !defined(_WIN32) && !defined(N_PLAT_NLM)
 
 /*