+2004-12-11 Martin Baulig <martin@ximian.com>
+
+ * get.c (get_typespec): Added `gboolean is_def' argument; removed
+ the special case for MONO_TYPE_VAR/MVAR and pass `is_def' down to
+ dis_stringify_type().
+ (get_escaped_name): Allow `!'.
+
2004-12-11 Martin Baulig <martin@ximian.com>
* get.c (get_token): Escape typedefs, typerefs and typespecs.
fprintf (output, "Typespec Table\n");
for (i = 1; i <= t->rows; i++){
- char *typespec = get_typespec (m, i, NULL);
+ char *typespec = get_typespec (m, i, TRUE, NULL);
fprintf (output, "%d: %s\n", i, typespec);
g_free (typespec);
break;
case 4:
ks = "TypeSpec";
- xx = get_typespec (m, idx, NULL);
+ xx = get_typespec (m, idx, FALSE, NULL);
x = g_strconcat (xx, ".", mono_metadata_string_heap (m, cols [MONO_MEMBERREF_NAME]), NULL);
g_free (xx);
break;
char *sig;
mono_metadata_decode_row (t, i - 1, cols, MONO_GENERICPARAM_SIZE);
- sig = get_type_or_methdef (m, cols [MONO_GENERICPARAM_OWNER]);
+ // sig = get_type_or_methdef (m, cols [MONO_GENERICPARAM_OWNER]);
+ sig = g_strdup_printf ("%x", cols [MONO_GENERICPARAM_OWNER]);
fprintf (output, "%d: %d, flags=%d, owner=%s %s\n", i,
cols [MONO_GENERICPARAM_NUMBER],
cols [MONO_GENERICPARAM_FLAGS], sig,
char *sig;
mono_metadata_decode_row (t, i - 1, cols, MONO_GENPARCONSTRAINT_SIZE);
- sig = get_typedef_or_ref (m, cols [MONO_GENPARCONSTRAINT_CONSTRAINT], NULL);
+ // sig = get_typedef_or_ref (m, cols [MONO_GENPARCONSTRAINT_CONSTRAINT], NULL);
+ sig = g_strdup_printf ("%x", cols [MONO_GENPARCONSTRAINT_CONSTRAINT]);
fprintf (output, "%d: gen-par=%d, Constraint=%s\n", i,
cols [MONO_GENPARCONSTRAINT_GENERICPAR], sig);
g_free (sig);
* Returns the stringified representation of a TypeSpec signature (22.2.17)
*/
char *
-get_typespec (MonoImage *m, guint32 idx, MonoGenericContext *context)
+get_typespec (MonoImage *m, guint32 idx, gboolean is_def, MonoGenericContext *context)
{
guint32 cols [MONO_TYPESPEC_SIZE];
const char *ptr;
g_free (s);
break;
- case MONO_TYPE_VAR:
- case MONO_TYPE_MVAR:
- ptr = get_type (m, ptr-1, &s, context);
- g_string_append (res, s);
- g_free (s);
- break;
-
default:
- s = dis_stringify_type (m, type, FALSE);
+ s = dis_stringify_type (m, type, is_def);
g_string_append (res, s);
g_free (s);
break;
break;
case 2: /* TypeSpec */
- s = get_typespec (m, idx, context);
+ s = get_typespec (m, idx, FALSE, context);
break;
default:
switch (token >> 24) {
case MONO_TABLE_TYPEDEF: return get_typedef (m, idx);
case MONO_TABLE_TYPEREF: return get_typeref (m, idx);
- case MONO_TABLE_TYPESPEC: return get_typespec (m, idx, NULL);
+ case MONO_TABLE_TYPESPEC: return get_typespec (m, idx, FALSE, NULL);
default:
break;
}
}
for (s = name; *s; s++) {
- if (isalnum (*s) || *s == '_' || *s == '$' || *s == '@' || *s == '?' || *s == '.' || *s == 0)
+ if (isalnum (*s) || *s == '_' || *s == '$' || *s == '@' ||
+ *s == '?' || *s == '.' || *s == 0 || *s == '!')
continue;
return g_strdup_printf ("'%s'", name);
return g_strdup ("TODO:MethodDef");
case 4: /* TypeSpec */
- return get_typespec (m, idx, context);
+ return get_typespec (m, idx, FALSE, context);
}
g_assert_not_reached ();
return NULL;
g_free (temp);
return result;
case MONO_TOKEN_TYPE_SPEC:
- temp = get_typespec (m, idx, context);
+ temp = get_typespec (m, idx, TRUE, context);
result = get_escaped_name (temp);
g_free (temp);
return result;
break;
case MONO_TOKEN_TYPE_SPEC:
- s = get_typespec (m, idx, context);
+ s = get_typespec (m, idx, FALSE, context);
break;
default:
char *get_constant (MonoImage *m, MonoTypeEnum t, guint32 blob_index);
char *get_token (MonoImage *m, guint32 token, MonoGenericContext *context);
char *get_token_type (MonoImage *m, guint32 token, MonoGenericContext *context);
-char *get_typespec (MonoImage *m, guint32 blob_idx, MonoGenericContext *context);
+char *get_typespec (MonoImage *m, guint32 blob_idx, gboolean is_def, MonoGenericContext *context);
char *get_methoddef (MonoImage *m, guint32 idx);
char *get_method (MonoImage *m, guint32 token, MonoGenericContext *context);
char *get_method_type_param (MonoImage *m, guint32 blob_signature, MonoGenericContext *context);