Commit 61b95313 authored by Sebastien Granjoux's avatar Sebastien Granjoux

fix #511589 for debug-manager plugin

	* plugins/debug-manager/start.c,
	plugins/debug-manager/plugin.c,
	plugins/debug-manager/threads.c,
	plugins/debug-manager/stack_trace.c,
	plugins/debug-manager/breakpoints.c: 
	fix #511589 for debug-manager plugin

svn path=/trunk/; revision=4637
parent 6c917001
2009-01-25 Jens Georg <jens@einstein>
Reviewed by Sébastien Granjoux <seb.sfo@free.fr>
* plugins/debug-manager/start.c,
plugins/debug-manager/plugin.c,
plugins/debug-manager/threads.c,
plugins/debug-manager/stack_trace.c,
plugins/debug-manager/breakpoints.c:
fix #511589 for debug-manager plugin
2009-01-25 Sébastien Granjoux <seb.sfo@free.fr>
* plugins/scintilla/text_editor.h,
......@@ -14,6 +14,7 @@ anjuta_plugin_DATA = $(plugin_in_files:.plugin.in=.plugin)
AM_CPPFLAGS= \
$(WARN_CFLAGS) \
$(DEPRECATED_FLAGS) \
$(GIO_CFLAGS) \
$(LIBANJUTA_CFLAGS)
plugindir = $(anjuta_plugin_dir)
......@@ -22,8 +23,8 @@ plugin_LTLIBRARIES = libanjuta-debug-manager.la
libanjuta_debug_manager_la_LDFLAGS = $(ANJUTA_PLUGIN_LDFLAGS)
libanjuta_debug_manager_la_LIBADD = \
$(GNOME_UI_LIBS) \
$(GLADE_LIBS) \
$(GIO_LIBS) \
$(LIBANJUTA_LIBS)
# Marshallers
......
......@@ -49,8 +49,7 @@
#include <string.h>
#include <ctype.h>
#include <gnome.h>
#include <libgnomevfs/gnome-vfs-utils.h>
#include <gio/gio.h>
#include <libanjuta/resources.h>
#include <libanjuta/anjuta-debug.h>
......@@ -155,7 +154,11 @@ breakpoint_item_update_from_debugger (BreakpointItem *bi, const IAnjutaDebuggerB
bi->bp.file = g_strdup (bp->file);
bi->bp.line = bp->line;
if ((bi->uri == NULL) && (g_path_is_absolute (bp->file)))
bi->uri = gnome_vfs_get_uri_from_local_path (bp->file);
{
GFile *file = g_file_new_for_path (bp->file);
bi->uri = g_file_get_uri (file);
g_object_unref (file);
}
}
if (bp->type & IANJUTA_DEBUGGER_BREAKPOINT_ON_FUNCTION)
{
......@@ -259,7 +262,7 @@ breakpoint_item_new_from_uri (BreakpointsDBase *bd, const gchar* uri, guint line
if (uri != NULL)
{
bi->uri = g_strdup (uri);
bi->bp.file = gnome_vfs_get_local_path_from_uri (uri);
bi->bp.file = anjuta_util_get_local_path_from_uri (uri);
bi->bp.line = line;
}
bi->bp.enable = enable;
......@@ -290,7 +293,7 @@ breakpoint_item_new_from_string (BreakpointsDBase *bd, const gchar* string, cons
else if ((uri != NULL) && isdigit (*string))
{
bi->uri = g_strdup (uri);
bi->bp.file = gnome_vfs_get_local_path_from_uri (uri);
bi->bp.file = anjuta_util_get_local_path_from_uri (uri);
bi->bp.line = strtoul (string, NULL, 10);
bi->bp.type = IANJUTA_DEBUGGER_BREAKPOINT_ON_LINE;
}
......@@ -321,7 +324,9 @@ breakpoint_item_new_from_string (BreakpointsDBase *bd, const gchar* string, cons
bi->bp.file = g_strndup (string, ptr - string);
if (g_path_is_absolute (bi->bp.file))
{
bi->uri = gnome_vfs_get_uri_from_local_path (bi->bp.file);
GFile *file = g_file_new_for_path (bi->bp.file);
bi->uri = g_file_get_uri (file);
g_object_unref (file);
}
}
}
......
......@@ -50,7 +50,7 @@
#include <libanjuta/interfaces/ianjuta-document-manager.h>
#include <libanjuta/interfaces/ianjuta-message-manager.h>
#include <libgnomevfs/gnome-vfs.h>
#include <gio/gio.h>
/* Contants defintion
*---------------------------------------------------------------------------*/
......
......@@ -27,14 +27,14 @@
#include <unistd.h>
#include <string.h>
#include <ctype.h>
#include <gnome.h>
#include <gio/gio.h>
/*#define DEBUG*/
#include <libanjuta/resources.h>
#include <libanjuta/anjuta-debug.h>
#include <libanjuta/interfaces/ianjuta-editor.h>
#include <libanjuta/interfaces/ianjuta-document-manager.h>
#include <libgnomevfs/gnome-vfs-utils.h>
#include "utilities.h"
#include "info.h"
......@@ -292,8 +292,10 @@ on_stack_trace_updated (const GList *stack, gpointer user_data, GError *error)
{
if (g_path_is_absolute (frame->file))
{
uri = gnome_vfs_get_uri_from_local_path(frame->file);
GFile *gio_file = g_file_new_for_path (frame->file);
uri = g_file_get_uri (gio_file);
file = strrchr(frame->file, G_DIR_SEPARATOR) + 1;
g_object_unref (gio_file);
}
else
{
......
......@@ -42,10 +42,8 @@
#include <libanjuta/interfaces/ianjuta-file-savable.h>
#include <libanjuta/anjuta-utils.h>
#include <libgnomevfs/gnome-vfs-mime-utils.h>
#include <libgnomevfs/gnome-vfs-utils.h>
#include <glade/glade-xml.h>
#include <gio/gio.h>
#include <errno.h>
#include <sys/stat.h>
......@@ -181,10 +179,13 @@ get_source_directories (AnjutaPlugin *plugin)
GList *slibs_dirs = NULL;
GList *libs_dirs = NULL;
GValue value = {0,};
GFile *file;
return NULL;
cwd = g_get_current_dir();
search_dirs = g_list_prepend (search_dirs, gnome_vfs_get_uri_from_local_path(cwd));
file = g_file_new_for_path (cwd);
search_dirs = g_list_prepend (search_dirs, g_file_get_uri (file));
g_object_unref (file);
g_free (cwd);
/* Check if a project is already open */
......@@ -854,7 +855,7 @@ start_remote_target (DmaStart *this, const gchar *target)
if (dir_uri != NULL)
{
dir = gnome_vfs_get_local_path_from_uri (dir_uri);
dir = anjuta_util_get_local_path_from_uri (dir_uri);
g_free (dir_uri);
}
else
......@@ -893,20 +894,45 @@ load_target (DmaStart *this, const gchar *target)
{
gchar *mime_type;
gchar *filename;
GFile *file;
GFileInfo *file_info;
GError *error = NULL;
mime_type = gnome_vfs_get_mime_type ((const gchar *)target);
DEBUG_PRINT ("Using target %s", target);
file = g_file_new_for_uri (target);
file_info = g_file_query_info (file,
G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
G_FILE_QUERY_INFO_NONE,
NULL, &error);
if (file_info == NULL)
{
DEBUG_PRINT ("Error getting file info: %s", error->message);
g_error_free (error);
anjuta_util_dialog_error(GTK_WINDOW (this->plugin->shell),
_("Unable to open %s. (file_info) Debugger cannot start."), target);
g_object_unref (file);
return FALSE;
}
mime_type = g_file_info_get_attribute_as_string (file_info,
G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE);
if (mime_type == NULL)
{
anjuta_util_dialog_error(GTK_WINDOW (this->plugin->shell),
_("Unable to open %s. Debugger cannot start."), target);
_("Unable to open %s. (mime_type) Debugger cannot start."), target);
g_object_unref (file_info);
g_object_unref (file);
return FALSE;
}
filename = gnome_vfs_get_local_path_from_uri (target);
filename = g_file_get_path (file);
dma_queue_load (this->debugger, filename, mime_type, this->source_dirs);
g_free (filename);
g_free (mime_type);
g_object_unref (file_info);
g_object_unref (file);
return TRUE;
}
......@@ -988,14 +1014,16 @@ check_target (DmaStart *this, const gchar *target)
static gboolean
dma_start_load_and_start_uri (DmaStart *this, const gchar *target)
{
GnomeVFSURI *vfs_uri;
gchar *local_path = NULL;
if (!dma_quit_debugger (this)) return FALSE;
vfs_uri = gnome_vfs_uri_new (target);
g_return_val_if_fail (vfs_uri != NULL, TRUE);
if (!gnome_vfs_uri_is_local (vfs_uri)) return FALSE;
gnome_vfs_uri_unref (vfs_uri);
local_path = anjuta_util_get_local_path_from_uri (target);
if (!local_path)
{
return FALSE;
}
g_free (local_path);
return check_target (this, target);
}
......@@ -1113,7 +1141,7 @@ on_add_uri_in_model (gpointer data, gpointer user_data)
GtkTreeIter iter;
gchar *local;
local = gnome_vfs_get_local_path_from_uri ((const char *)data);
local = anjuta_util_get_local_path_from_uri ((const char *)data);
gtk_list_store_append (model, &iter);
gtk_list_store_set (model, &iter, 0, local, -1);
g_free (local);
......@@ -1125,10 +1153,13 @@ on_add_source_in_list (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter
GList** list = (GList **)user_data;
gchar* dir;
gchar* uri;
GFile *file;
gtk_tree_model_get (model, iter, 0, &dir, -1);
uri = gnome_vfs_get_uri_from_local_path (dir);
file = g_file_new_for_path (dir);
uri = g_file_get_uri (file);
*list = g_list_prepend (*list, uri);
g_object_unref (file);
g_free (dir);
return FALSE;
......
......@@ -29,8 +29,7 @@
#include <unistd.h>
#include <string.h>
#include <ctype.h>
#include <gnome.h>
#include <libgnomevfs/gnome-vfs.h>
#include <gio/gio.h>
/*#define DEBUG*/
#include <libanjuta/resources.h>
......@@ -223,8 +222,10 @@ on_info_thread (const IAnjutaDebuggerFrame* frame, gpointer user_data)
{
if (g_path_is_absolute (frame->file))
{
uri = gnome_vfs_get_uri_from_local_path(frame->file);
GFile *gio_file = g_file_new_for_path (frame->file);
uri = g_file_get_uri (gio_file);
file = strrchr(frame->file, G_DIR_SEPARATOR) + 1;
g_object_unref (gio_file);
}
else
{
......@@ -325,8 +326,10 @@ on_list_thread (const GList *threads, gpointer user_data)
{
if (g_path_is_absolute (frame->file))
{
uri = gnome_vfs_get_uri_from_local_path(frame->file);
GFile *gio_file = g_file_new_for_path (frame->file);
uri = g_file_get_uri (gio_file);
file = strrchr(frame->file, G_DIR_SEPARATOR) + 1;
g_object_unref (gio_file);
}
else
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment