[Git][ghc/ghc][master] rts: Introduce printIPE

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Tue Nov 19 02:23:36 UTC 2024



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
3e5bfdd3 by Ben Gamari at 2024-11-18T21:23:12-05:00
rts: Introduce printIPE

This is a convenience utility for use in GDB.

- - - - -


2 changed files:

- rts/IPE.c
- rts/include/rts/IPE.h


Changes:

=====================================
rts/IPE.c
=====================================
@@ -277,3 +277,20 @@ void decompressIPEBufferListNodeIfCompressed(IpeBufferListNode *node) {
 
     }
 }
+
+#if defined(DEBUG)
+void printIPE(const StgInfoTable *info) {
+    InfoProvEnt ipe;
+    if (lookupIPE(info, &ipe)) {
+        debugBelch("%p:\n", info);
+        debugBelch("    name:    %s\n", ipe.prov.table_name);
+        debugBelch("    desc:    %" PRIu32 "\n", ipe.prov.closure_desc);
+        debugBelch("    type:    %s\n", ipe.prov.ty_desc);
+        debugBelch("    label:   %s\n", ipe.prov.label);
+        debugBelch("    module:  %s:%s\n", ipe.prov.unit_id, ipe.prov.module);
+        debugBelch("    src loc: %s:%s\n", ipe.prov.src_file, ipe.prov.src_span);
+    } else {
+        debugBelch("%p: no IPE entry\n", info);
+    }
+}
+#endif


=====================================
rts/include/rts/IPE.h
=====================================
@@ -97,3 +97,7 @@ void formatClosureDescIpe(const InfoProvEnt *ipe_buf, char *str_buf);
 
 // Returns true on success, initializes `out`.
 bool lookupIPE(const StgInfoTable *info, InfoProvEnt *out);
+
+#if defined(DEBUG)
+void printIPE(const StgInfoTable *info);
+#endif



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3e5bfdd363740926576fb3ee031b94d17f7d955e

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3e5bfdd363740926576fb3ee031b94d17f7d955e
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20241118/e7fa3191/attachment-0001.html>


More information about the ghc-commits mailing list