SF.net SVN: geany-plugins:[411] trunk/geanygdb/src/gdb-ui-main.c

eht16 at users.sourceforge.net eht16 at xxxxx
Fri Jan 30 16:51:27 UTC 2009


Revision: 411
          http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=411&view=rev
Author:   eht16
Date:     2009-01-30 16:51:27 +0000 (Fri, 30 Jan 2009)

Log Message:
-----------
When loading an executable to debug, set the working directory accordingly.

Modified Paths:
--------------
    trunk/geanygdb/src/gdb-ui-main.c

Modified: trunk/geanygdb/src/gdb-ui-main.c
===================================================================
--- trunk/geanygdb/src/gdb-ui-main.c	2009-01-30 01:08:23 UTC (rev 410)
+++ trunk/geanygdb/src/gdb-ui-main.c	2009-01-30 16:51:27 UTC (rev 411)
@@ -505,6 +505,7 @@
 							{
 								if (access(fn, X_OK) == 0)
 								{
+									gchar *base_path;
 									gchar *ldd =
 										g_strconcat("ldd ",
 											    fn,
@@ -545,6 +546,10 @@
 										pipe_click(pipe_chk,
 											   NULL);
 									}
+									/* set working dir after loading */
+									base_path = g_path_get_dirname(fn);
+									gdbio_send_cmd("-environment-cd %s\n", base_path);
+									g_free(base_path);
 								}
 								else
 								{


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