anjuta r3504 - in trunk: . plugins/debug-manager



Author: sgranjoux
Date: Sun Jan 20 11:14:25 2008
New Revision: 3504
URL: http://svn.gnome.org/viewvc/anjuta?rev=3504&view=rev

Log:
	* plugins/debug-manager/sparse_buffer.c:
	Fix a crash when scrolling in the diassembly window

	* plugins/debug-manager/sparse_view.c:
	Small limit change using the same "unit" for both number


Modified:
   trunk/ChangeLog
   trunk/plugins/debug-manager/sparse_buffer.c
   trunk/plugins/debug-manager/sparse_view.c

Modified: trunk/plugins/debug-manager/sparse_buffer.c
==============================================================================
--- trunk/plugins/debug-manager/sparse_buffer.c	(original)
+++ trunk/plugins/debug-manager/sparse_buffer.c	Sun Jan 20 11:14:25 2008
@@ -195,7 +195,7 @@
 	/* New node should have been allocated by caller with g_new */
 	DmaSparseBufferNode *prev;
 
-	DEBUG_PRINT ("insert block %x %x", node->lower, node->upper);
+	DEBUG_PRINT ("insert block %p %x %x", node, node->lower, node->upper);
 	/* Look for previous node */
 	prev = dma_sparse_buffer_find (buffer, node->lower);
 	while ((prev != NULL) && (node->lower <= prev->upper))
@@ -222,16 +222,16 @@
 		node->prev = prev;
 		node->next = prev->next;
 		prev->next = node;
-		if (node->next != NULL)
-		{
-			node->next->prev = node;
-		}
+	}
+	if (node->next != NULL)
+	{
+		node->next->prev = node;
 	}
 
 	/* Check if new node overlap next one */
 	while ((node->next != NULL) && (node->upper >= node->next->lower))
 	{
-		DEBUG_PRINT ("remove next block %x %x", node->next->lower, node->next->upper);
+		DEBUG_PRINT ("remove next block %p %x %x", node->next, node->next->lower, node->next->upper);
 		/* node overlap, remove it */
 		dma_sparse_buffer_remove (buffer, node->next);
 	}
@@ -280,7 +280,7 @@
 	{
 		buffer->cache.tail = node->cache.prev;
 	}
-	
+
 	g_free (node);
 	
 	buffer->stamp++;

Modified: trunk/plugins/debug-manager/sparse_view.c
==============================================================================
--- trunk/plugins/debug-manager/sparse_view.c	(original)
+++ trunk/plugins/debug-manager/sparse_view.c	Sun Jan 20 11:14:25 2008
@@ -546,11 +546,11 @@
 
 	if (dist != 0)
 	{
-		gint count = (gint)(dist / view->priv->vadjustment->step_increment);
-		
-		if ((count < 2.0 * (view->priv->vadjustment->page_size))
-			 && (count > -2.0 * (view->priv->vadjustment->page_size)))
+		if ((dist < 4.0 * (view->priv->vadjustment->page_size))
+			 && (dist > -4.0 * (view->priv->vadjustment->page_size)))
         {
+			gint count = (gint)(dist / view->priv->vadjustment->step_increment);
+			
         	dma_sparse_iter_forward_lines (iter, count);
         }
         else



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]