Skip to content

Commit

Permalink
2002-10-01 Martin Baulig <martin@gnome.org>
Browse files Browse the repository at this point in the history
	* debug-mono-symfile.c: Added support for properties.

svn path=/trunk/mono/; revision=7903
  • Loading branch information
Martin Baulig committed Oct 1, 2002
1 parent 3dfe241 commit 391cd66
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
3 changes: 3 additions & 0 deletions mono/metadata/ChangeLog
@@ -1,3 +1,6 @@
2002-10-01 Martin Baulig <martin@gnome.org>

* debug-mono-symfile.c: Added support for properties.

Fri Sep 27 18:55:01 CEST 2002 Paolo Molaro <lupus@ximian.com>

Expand Down
29 changes: 25 additions & 4 deletions mono/metadata/debug-mono-symfile.c
Expand Up @@ -134,7 +134,8 @@ load_symfile (MonoSymbolFile *symfile)
mep->index = i;

mep->method_name_offset = priv->string_table_size;
mep->name = g_strdup_printf ("%s.%s.%s", method->klass->name_space,
mep->name = g_strdup_printf ("%s%s%s.%s", method->klass->name_space,
method->klass->name_space [0] ? "." : "",
method->klass->name, method->name);
priv->string_table_size += strlen (mep->name) + 5;

Expand Down Expand Up @@ -938,7 +939,7 @@ static gpointer
write_type (MonoType *type)
{
guint8 buffer [BUFSIZ], *ptr = buffer, *retval;
int num_fields = 0;
int num_fields = 0, num_properties = 0;
guint32 size;

if (!type_table)
Expand Down Expand Up @@ -976,7 +977,12 @@ write_type (MonoType *type)
if (!(klass->fields [i].type->attrs & FIELD_ATTRIBUTE_STATIC))
++num_fields;

size = 14 + sizeof (int) + num_fields * (4 + sizeof (gpointer));
for (i = 0; i < klass->property.count; i++)
if (!(klass->properties [i].attrs & FIELD_ATTRIBUTE_STATIC))
++num_properties;

size = 22 + sizeof (int) + num_fields * (4 + sizeof (gpointer)) +
num_properties * 3 * sizeof (gpointer);

if (type->type == MONO_TYPE_CLASS)
size += sizeof (gpointer);
Expand Down Expand Up @@ -1050,12 +1056,15 @@ write_type (MonoType *type)
break;
}

*((int *) ptr)++ = -14 - num_fields * (4 + sizeof (gpointer));
*((int *) ptr)++ = -22 - num_fields * (4 + sizeof (gpointer)) -
num_properties * 2 * sizeof (gpointer);
*((guint32 *) ptr)++ = klass->instance_size + base_offset;
*ptr++ = type->type == MONO_TYPE_CLASS ? 6 : 5;
*ptr++ = type->type == MONO_TYPE_CLASS;
*((guint32 *) ptr)++ = num_fields;
*((guint32 *) ptr)++ = num_fields * (4 + sizeof (gpointer));
*((guint32 *) ptr)++ = num_properties;
*((guint32 *) ptr)++ = num_properties * 3 * sizeof (gpointer);
for (i = 0; i < klass->field.count; i++) {
if (klass->fields [i].type->attrs & FIELD_ATTRIBUTE_STATIC)
continue;
Expand All @@ -1064,6 +1073,18 @@ write_type (MonoType *type)
*((gpointer *) ptr)++ = write_type (klass->fields [i].type);
}

for (i = 0; i < klass->property.count; i++) {
if (klass->properties [i].attrs & FIELD_ATTRIBUTE_STATIC)
continue;

if (klass->properties [i].get)
*((gpointer *) ptr)++ = write_type (klass->properties [i].get->signature->ret);
else
*((gpointer *) ptr)++ = NULL;
*((gpointer *) ptr)++ = klass->properties [i].get;
*((gpointer *) ptr)++ = klass->properties [i].set;
}

if (type->type == MONO_TYPE_CLASS) {
if (klass->parent)
*((gpointer *) ptr)++ = write_type (&klass->parent->this_arg);
Expand Down
2 changes: 1 addition & 1 deletion mono/metadata/debug-mono-symfile.h
Expand Up @@ -177,7 +177,7 @@ struct MonoSymbolFile {
#define MONO_SYMBOL_FILE_VERSION 26
#define MONO_SYMBOL_FILE_MAGIC 0x45e82623fd7fa614

#define MONO_SYMBOL_FILE_DYNAMIC_VERSION 11
#define MONO_SYMBOL_FILE_DYNAMIC_VERSION 12
#define MONO_SYMBOL_FILE_DYNAMIC_MAGIC 0x7aff65af4253d427

MonoSymbolFile *
Expand Down

0 comments on commit 391cd66

Please sign in to comment.