Ver código fonte

2006-06-08 Martin Baulig <[email protected]>

	* debug-mono-symfile.c: Put this back and fix it.


svn path=/trunk/mono/; revision=61554
Martin Baulig 19 anos atrás
pai
commit
d260965ca2
2 arquivos alterados com 9 adições e 4 exclusões
  1. 4 0
      mono/metadata/ChangeLog
  2. 5 4
      mono/metadata/debug-mono-symfile.c

+ 4 - 0
mono/metadata/ChangeLog

@@ -1,3 +1,7 @@
+2006-06-08  Martin Baulig  <[email protected]>
+
+	* debug-mono-symfile.c: Put this back and fix it.
+
 2006-06-07  Zoltan Varga  <[email protected]>
 
 	* class-internals.h: Add a new kind of loader error LOADER_ERROR_ASSEMBLY plus

+ 5 - 4
mono/metadata/debug-mono-symfile.c

@@ -199,7 +199,7 @@ mono_debug_symfile_lookup_location (MonoDebugMethodInfo *minfo, guint32 offset)
 	MonoSymbolFile *symfile;
 	gchar *source_file = NULL;
 	const char *ptr;
-	int i;
+	int count, i;
 
 	if ((symfile = minfo->handle->symfile) == NULL)
 		return NULL;
@@ -216,12 +216,13 @@ mono_debug_symfile_lookup_location (MonoDebugMethodInfo *minfo, guint32 offset)
 
 	ptr = symfile->raw_contents + read32(&(minfo->entry->_line_number_table_offset));
 
-	lne = (MonoSymbolFileLineNumberEntry *) ptr;
+	count = read32(&(minfo->entry->_num_line_numbers));
+	lne = ((MonoSymbolFileLineNumberEntry *) ptr) + count;
 
-	for (i = 0; i < read32(&(minfo->entry->_num_line_numbers)); i++, lne++) {
+	for (i = count - 1; i >= 0; i--, lne--) {
 		MonoDebugSourceLocation *location;
 
-		if (read32(&(lne->_offset)) < offset)
+		if (read32(&(lne->_offset)) > offset)
 			continue;
 
 		location = g_new0 (MonoDebugSourceLocation, 1);