diff options
author | Zoltan Varga <vargaz@gmail.com> | 2013-03-25 05:44:55 +0400 |
---|---|---|
committer | Zoltan Varga <vargaz@gmail.com> | 2013-03-25 05:54:39 +0400 |
commit | b354c6268d8694d741542a7a89d8860b31afd22f (patch) | |
tree | 16b2466ef17b2ab7fcffe0640dbb278658ab40d9 | |
parent | 77e58567c1c6120c04be2b26fa6e099105b78fab (diff) |
Add a mono_print_ji () helper function to print a MonoJumpInfo structure.
-rw-r--r-- | mono/mini/mini-codegen.c | 22 | ||||
-rw-r--r-- | mono/mini/mini.h | 1 |
2 files changed, 18 insertions, 5 deletions
diff --git a/mono/mini/mini-codegen.c b/mono/mini/mini-codegen.c index facd18c2494..8ef772a1b14 100644 --- a/mono/mini/mini-codegen.c +++ b/mono/mini/mini-codegen.c @@ -411,15 +411,21 @@ typedef struct { #ifndef DISABLE_LOGGING -static void -print_ji (MonoJumpInfo *ji) +static const char* const patch_info_str[] = { +#define PATCH_INFO(a,b) "" #a, +#include "patch-info.h" +#undef PATCH_INFO +}; + +void +mono_print_ji (const MonoJumpInfo *ji) { switch (ji->type) { case MONO_PATCH_INFO_RGCTX_FETCH: { MonoJumpInfoRgctxEntry *entry = ji->data.rgctx_entry; printf ("[RGCTX_FETCH "); - print_ji (entry->data); + mono_print_ji (entry->data); printf (" - %s]", mono_rgctx_info_type_to_str (entry->info_type)); break; } @@ -430,7 +436,7 @@ print_ji (MonoJumpInfo *ji) break; } default: - printf ("[%d]", ji->type); + printf ("[%s]", patch_info_str [ji->type]); break; } } @@ -611,7 +617,7 @@ mono_print_ins_index (int i, MonoInst *ins) MonoJumpInfo *ji = (MonoJumpInfo*)call->fptr; printf (" "); - print_ji (ji); + mono_print_ji (ji); } else if (call->fptr) { MonoJitICallInfo *info = mono_find_jit_icall_by_addr (call->fptr); if (info) @@ -699,6 +705,12 @@ print_regtrack (RegTrack *t, int num) } } #else + +void +mono_print_ji (const MonoJumpInfo *ji) +{ +} + void mono_print_ins_index (int i, MonoInst *ins) { diff --git a/mono/mini/mini.h b/mono/mini/mini.h index c5c60c133c0..1b6f5b550ec 100644 --- a/mono/mini/mini.h +++ b/mono/mini/mini.h @@ -1863,6 +1863,7 @@ void mono_merge_basic_blocks (MonoCompile *cfg, MonoBasicBlock *b void mono_optimize_branches (MonoCompile *cfg) MONO_INTERNAL; void mono_blockset_print (MonoCompile *cfg, MonoBitSet *set, const char *name, guint idom) MONO_INTERNAL; +void mono_print_ji (const MonoJumpInfo *ji) MONO_INTERNAL; void mono_print_ins_index (int i, MonoInst *ins) MONO_INTERNAL; void mono_print_ins (MonoInst *ins) MONO_INTERNAL; void mono_print_bb (MonoBasicBlock *bb, const char *msg) MONO_INTERNAL; |