SF.net SVN: geany-plugins:[2205] trunk/geany-plugins/debugger/src

cesspit at users.sourceforge.net cesspit at xxxxx
Mon Sep 19 21:54:03 UTC 2011


Revision: 2205
          http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=2205&view=rev
Author:   cesspit
Date:     2011-09-19 21:54:03 +0000 (Mon, 19 Sep 2011)
Log Message:
-----------
debugger: moving gdb to a personal process group in hope to predict SIGINT passing to Geany, fixing bug with async breakpoint operation, caret policy is set only for the time of moving to the line where debug stops

Modified Paths:
--------------
    trunk/geany-plugins/debugger/src/callbacks.c
    trunk/geany-plugins/debugger/src/dbm_gdb.c
    trunk/geany-plugins/debugger/src/debug.c
    trunk/geany-plugins/debugger/src/utils.c

Modified: trunk/geany-plugins/debugger/src/callbacks.c
===================================================================
--- trunk/geany-plugins/debugger/src/callbacks.c	2011-09-19 20:29:04 UTC (rev 2204)
+++ trunk/geany-plugins/debugger/src/callbacks.c	2011-09-19 21:54:03 UTC (rev 2205)
@@ -169,9 +169,6 @@
 	/* set tab size for calltips */
 	scintilla_send_message(doc->editor->sci, SCI_CALLTIPUSESTYLE, 20, (long)NULL);
 
-	/* set caret policy */
-	scintilla_send_message(doc->editor->sci, SCI_SETYCARETPOLICY, CARET_SLOP | CARET_JUMPS | CARET_EVEN , 3);
-	
 	/* set breakpoint and frame markers */
 	set_markers_for_file(file);
 

Modified: trunk/geany-plugins/debugger/src/dbm_gdb.c
===================================================================
--- trunk/geany-plugins/debugger/src/dbm_gdb.c	2011-09-19 20:29:04 UTC (rev 2204)
+++ trunk/geany-plugins/debugger/src/dbm_gdb.c	2011-09-19 21:54:03 UTC (rev 2205)
@@ -536,6 +536,9 @@
 		return FALSE;
 	}
 	
+	/* move gdb to it's own process group */
+	setpgid(gdb_pid, 0);
+	
 	/* set handler for gdb process exit event */ 
 	g_child_watch_add(gdb_pid, on_gdb_exit, NULL);
 	gdb_src = g_child_watch_source_new(gdb_pid);

Modified: trunk/geany-plugins/debugger/src/debug.c
===================================================================
--- trunk/geany-plugins/debugger/src/debug.c	2011-09-19 20:29:04 UTC (rev 2204)
+++ trunk/geany-plugins/debugger/src/debug.c	2011-09-19 21:54:03 UTC (rev 2205)
@@ -645,6 +645,9 @@
 	{
 		interrupt_cb(interrupt_data);
 		interrupt_data = NULL;
+		
+		active_module->resume();
+		
 		return;
 	}
 

Modified: trunk/geany-plugins/debugger/src/utils.c
===================================================================
--- trunk/geany-plugins/debugger/src/utils.c	2011-09-19 20:29:04 UTC (rev 2204)
+++ trunk/geany-plugins/debugger/src/utils.c	2011-09-19 21:54:03 UTC (rev 2205)
@@ -38,22 +38,29 @@
 /*
  * opens position in a editor 
  */
-void editor_open_position(char* file, int line)
+void editor_open_position(const gchar *filename, int line)
 {
 	GeanyDocument* doc = NULL;
-	gboolean already_open = (doc = document_get_current()) && !strcmp(DOC_FILENAME(doc), file);
+	gboolean already_open = (doc = document_get_current()) && !strcmp(DOC_FILENAME(doc), filename);
 
 	if (!already_open)
-		doc = document_open_file(file, FALSE, NULL, NULL);
+		doc = document_open_file(filename, FALSE, NULL, NULL);
 
 	if (doc)
 	{
+		/* temporarily set debug caret policy */
+		scintilla_send_message(doc->editor->sci, SCI_SETYCARETPOLICY, CARET_SLOP | CARET_JUMPS | CARET_EVEN, 3);
+
 		sci_goto_line(doc->editor->sci, line - 1, TRUE);
+
+		/* revert to default edit caret policy */
+		scintilla_send_message(doc->editor->sci, SCI_SETYCARETPOLICY, CARET_EVEN, 0);
+
 		scintilla_send_message(doc->editor->sci, SCI_SETFOCUS, TRUE, 0);
 	}
 	else
 	{
-		dialogs_show_msgbox(GTK_MESSAGE_ERROR, _("Can't find a source file \"%s\""), file);
+		dialogs_show_msgbox(GTK_MESSAGE_ERROR, _("Can't find a source file \"%s\""), filename);
 	}
 }
 

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Plugins-Commits mailing list