Skip to content

Commit

Permalink
Revert "[sdb] Add an API to make the contents of the 'State Machine H…
Browse files Browse the repository at this point in the history
…oisted Local Scopes' table in ppdb files available in sdb. (mono/mono#4961)" (mono/mono#4970)

This reverts commit mono/mono@010fce6.

Commit migrated from mono/mono@7d1644d
  • Loading branch information
vargaz committed Jun 2, 2017
1 parent 2d71819 commit 5a6d97e
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 80 deletions.
6 changes: 0 additions & 6 deletions src/mono/mono/metadata/debug-internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ typedef struct {
MonoDebugCodeBlock *block;
} MonoDebugLocalVar;

typedef struct {
int start_offset, end_offset;
} MonoHoistedLocalScope;

/*
* Information about local variables retrieved from a symbol file.
*/
Expand All @@ -40,8 +36,6 @@ struct _MonoDebugLocalsInfo {
MonoDebugLocalVar *locals;
int num_blocks;
MonoDebugCodeBlock *code_blocks;
int num_hoisted;
MonoHoistedLocalScope *hoisted;
};

/*
Expand Down
24 changes: 0 additions & 24 deletions src/mono/mono/metadata/debug-mono-ppdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ typedef struct {
guint64 referenced_tables;
} PdbStreamHeader;

static const char*
lookup_custom_debug_information (MonoImage* image, guint32 token, uint8_t parent_type, guint8* guid);

static gboolean
get_pe_debug_guid (MonoImage *image, guint8 *out_guid, gint32 *out_age, gint32 *out_timestamp)
{
Expand Down Expand Up @@ -609,27 +606,6 @@ mono_ppdb_lookup_locals (MonoDebugMethodInfo *minfo)
}
}

/*
* Read scope information for hoisted variables, if it exists.
* Its stored in the CustomDebugInformation table.
*/
guint8 hoisted_scopes_guid [16] = { 0x1E, 0xA6, 0xA9, 0x6D, 0xC7, 0xF8, 0x74, 0x48, 0xBE, 0x62, 0x68, 0xBC, 0x56, 0x30, 0xDF, 0x71 };
char const *blob = lookup_custom_debug_information (image, method->token, MONO_HASCUSTOMDEBUGINFO_METHODDEF, hoisted_scopes_guid);
if (blob) {
const char *ptr = blob;
int size = mono_metadata_decode_blob_size (ptr, &ptr);
g_assert (size % 4 == 0);
size /= 4;
res->num_hoisted = size;
res->hoisted = g_new0 (MonoHoistedLocalScope, res->num_hoisted);
for (int hindex = 0; hindex < size; ++hindex) {
res->hoisted [hindex].start_offset = read16 (ptr);
ptr += 4;
res->hoisted [hindex].end_offset = res->hoisted [hindex].start_offset + read16 (ptr);
ptr += 4;
}
}

return res;
}

Expand Down
3 changes: 0 additions & 3 deletions src/mono/mono/metadata/metadata-internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -950,8 +950,5 @@ mono_loader_set_strict_strong_names (gboolean enabled);
gboolean
mono_loader_get_strict_strong_names (void);

guint32
mono_metadata_customdebuginfo_from_index (MonoImage *meta, guint32 index);

#endif /* __MONO_METADATA_INTERNALS_H__ */

32 changes: 0 additions & 32 deletions src/mono/mono/metadata/metadata.c
Original file line number Diff line number Diff line change
Expand Up @@ -4743,38 +4743,6 @@ mono_metadata_localscope_from_methoddef (MonoImage *meta, guint32 index)
return loc.result + 1;
}

/*
* mono_metadata_customdebuginfo_from_index:
* @meta: metadata context
* @index: hascustomdebuginfo coded index
*
* Returns: the 1-based index into the CustomDebugInformation table of the first
* scope which belongs to the metadata object described by @index.
* Returns 0 if no such row is found.
*/
guint32
mono_metadata_customdebuginfo_from_index (MonoImage *meta, guint32 index)
{
MonoTableInfo *tdef = &meta->tables [MONO_TABLE_CUSTOMDEBUGINFORMATION];
locator_t loc;

if (!tdef->base)
return 0;

loc.idx = index;
loc.col_idx = MONO_CUSTOMDEBUGINFORMATION_PARENT;
loc.t = tdef;

if (!mono_binary_search (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
return 0;

/* Find the first entry by searching backwards */
while ((loc.result > 0) && (mono_metadata_decode_row_col (tdef, loc.result - 1, MONO_CUSTOMDEBUGINFORMATION_PARENT) == index))
loc.result --;

return loc.result + 1;
}

#ifdef DEBUG
static void
mono_backtrace (int limit)
Expand Down
6 changes: 0 additions & 6 deletions src/mono/mono/metadata/row-indexes.h
Original file line number Diff line number Diff line change
Expand Up @@ -486,12 +486,6 @@ enum {
MONO_TYPEORMETHOD_MASK = 1
};

enum {
MONO_HASCUSTOMDEBUGINFO_METHODDEF = 0,
MONO_HASCUSTOMDEBUGINFO_BITS = 5,
MONO_HASCUSTOMDEBUGINFO_MASK = 0x1f
};

#endif /* __MONO_METADATA_ROW_INDEXES_H__ */


10 changes: 1 addition & 9 deletions src/mono/mono/mini/debugger-agent.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ typedef struct {
#define HEADER_LENGTH 11

#define MAJOR_VERSION 2
#define MINOR_VERSION 46
#define MINOR_VERSION 45

typedef enum {
CMD_SET_VM = 1,
Expand Down Expand Up @@ -9057,14 +9057,6 @@ method_commands_internal (int command, MonoMethod *method, MonoDomain *domain, g
buffer_add_int (buf, locals->code_blocks [i].end_offset - locals->code_blocks [i].start_offset);
last_start = locals->code_blocks [i].start_offset;
}
if (CHECK_PROTOCOL_VERSION (2, 46)) {
/* Scopes for hoisted locals */
buffer_add_int (buf, locals->num_hoisted);
for (i = 0; i < locals->num_hoisted; ++i) {
buffer_add_int (buf, locals->code_blocks [i].start_offset);
buffer_add_int (buf, locals->code_blocks [i].end_offset);
}
}
}

num_locals = locals->num_locals;
Expand Down

0 comments on commit 5a6d97e

Please sign in to comment.