Skip to content
Snippets Groups Projects
Commit 3e5bfdd3 authored by Ben Gamari's avatar Ben Gamari Committed by Marge Bot
Browse files

rts: Introduce printIPE

This is a convenience utility for use in GDB.
parent 831aab22
No related branches found
No related tags found
No related merge requests found
...@@ -277,3 +277,20 @@ void decompressIPEBufferListNodeIfCompressed(IpeBufferListNode *node) { ...@@ -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
...@@ -97,3 +97,7 @@ void formatClosureDescIpe(const InfoProvEnt *ipe_buf, char *str_buf); ...@@ -97,3 +97,7 @@ void formatClosureDescIpe(const InfoProvEnt *ipe_buf, char *str_buf);
// Returns true on success, initializes `out`. // Returns true on success, initializes `out`.
bool lookupIPE(const StgInfoTable *info, InfoProvEnt *out); bool lookupIPE(const StgInfoTable *info, InfoProvEnt *out);
#if defined(DEBUG)
void printIPE(const StgInfoTable *info);
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment