Skip to content

Commit

Permalink
[mini] Allow MONO_VERBOSE_METHOD='*:*' (#61520)
Browse files Browse the repository at this point in the history
Implement method name wildcard matching for method descriptions

Globbing doesn't work because we don't have g_pattern_match_simple in eglib.
But a plain '*' wildcard does work.
  • Loading branch information
lambdageek authored Nov 13, 2021
1 parent 0818df1 commit a4bb83a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/mono/mono/metadata/debug-helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,13 @@ mono_method_desc_match (MonoMethodDesc *desc, MonoMethod *method)
char *sig;
gboolean name_match;

if (desc->name_glob && !strcmp (desc->name, "*"))
return TRUE;
#if 0
/* FIXME: implement g_pattern_match_simple in eglib */
if (desc->name_glob && g_pattern_match_simple (desc->name, method->name))
return TRUE;
#endif
name_match = strcmp (desc->name, method->name) == 0;
if (!name_match)
return FALSE;
Expand Down
2 changes: 1 addition & 1 deletion src/mono/mono/mini/mini.c
Original file line number Diff line number Diff line change
Expand Up @@ -3403,7 +3403,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, JitFlags flags, int parts
for (i = 0; verbose_method_names [i] != NULL; i++){
const char *name = verbose_method_names [i];

if ((strchr (name, '.') > name) || strchr (name, ':')) {
if ((strchr (name, '.') > name) || strchr (name, ':') || strchr (name, '*')) {
MonoMethodDesc *desc;

desc = mono_method_desc_new (name, TRUE);
Expand Down

0 comments on commit a4bb83a

Please sign in to comment.