[commit: ghc] ghc-8.6: rts/MachO: Add a bit more debugging output to getNames (65ced24)

git at git.haskell.org git at git.haskell.org
Thu Nov 22 21:55:46 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-8.6
Link       : http://ghc.haskell.org/trac/ghc/changeset/65ced246a0e0b1387a998cc70f4476be06bf67c3/ghc

>---------------------------------------------------------------

commit 65ced246a0e0b1387a998cc70f4476be06bf67c3
Author: Dario Bertini <berdario at google.com>
Date:   Fri Nov 16 15:46:54 2018 +0100

    rts/MachO: Add a bit more debugging output to getNames
    
    (cherry picked from commit 9e0a23b95c285c4019fd2d36102374ee582f1dcb)


>---------------------------------------------------------------

65ced246a0e0b1387a998cc70f4476be06bf67c3
 rts/linker/MachO.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/rts/linker/MachO.c b/rts/linker/MachO.c
index 5812e89..70acb16 100644
--- a/rts/linker/MachO.c
+++ b/rts/linker/MachO.c
@@ -1612,14 +1612,17 @@ ocGetNames_MachO(ObjectCode* oc)
                                    "ocGetNames_MachO(oc->symbols)");
 
     if (oc->info->symCmd) {
+        debugBelch("ocGetNames_MachO: %d macho symbols\n", oc->info->n_macho_symbols);
         for (size_t i = 0; i < oc->info->n_macho_symbols; i++) {
+            SymbolName* nm = oc->info->macho_symbols[i].name;
             if(oc->info->nlist[i].n_type & N_STAB)
-                ;
+            {
+                IF_DEBUG(linker, debugBelch("ocGetNames_MachO: Skip STAB: %s\n", nm));
+            }
             else if((oc->info->nlist[i].n_type & N_TYPE) == N_SECT)
             {
                 if(oc->info->nlist[i].n_type & N_EXT)
                 {
-                    SymbolName* nm = oc->info->macho_symbols[i].name;
                     if (   (oc->info->nlist[i].n_desc & N_WEAK_DEF)
                         && lookupSymbol_(nm)) {
                         // weak definition, and we already have a definition
@@ -1643,12 +1646,12 @@ ocGetNames_MachO(ObjectCode* oc)
                 }
                 else
                 {
-                    IF_DEBUG(linker, debugBelch("ocGetNames_MachO: \t...not external, skipping\n"));
+                    IF_DEBUG(linker, debugBelch("ocGetNames_MachO: \t...not external, skipping %s\n", nm));
                 }
             }
             else
             {
-                IF_DEBUG(linker, debugBelch("ocGetNames_MachO: \t...not defined in this section, skipping\n"));
+                IF_DEBUG(linker, debugBelch("ocGetNames_MachO: \t...not defined in this section, skipping %s\n", nm));
             }
         }
     }



More information about the ghc-commits mailing list