aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorliping ke <liping.ke@intel.com>2010-10-14 00:45:23 +0800
committerJoshua Lock <josh@linux.intel.com>2010-10-13 14:38:41 +0100
commitada50cc6597a228bd4cb444bd9fb42792151d7a2 (patch)
tree857ec55a678fe34d1f401a595ea63c0db546397c
parentd8ee836307d6ef412675591120f855ba4cbe32b7 (diff)
downloadanjuta-poky-ada50cc6597a228bd4cb444bd9fb42792151d7a2.tar.gz
anjuta-poky-ada50cc6597a228bd4cb444bd9fb42792151d7a2.tar.bz2
anjuta-poky-ada50cc6597a228bd4cb444bd9fb42792151d7a2.zip
Get GDB cmd from env script and Set sysroot for GDBHEADmaster
Since gdb cmd and poky_target_sysroot is now given by by env script, we need to use them and set gdb sysroot accordingly. And also, unfs now switch back to use "poky-qemu" bash cmd instead of "runqemu-unfs". Signed-off-by: Liping Ke<liping.ke@intel.com>
-rw-r--r--src/beaver-target-qemu.c2
-rw-r--r--src/plugin.c23
2 files changed, 14 insertions, 11 deletions
diff --git a/src/beaver-target-qemu.c b/src/beaver-target-qemu.c
index 2a706e2..7a7fbe7 100644
--- a/src/beaver-target-qemu.c
+++ b/src/beaver-target-qemu.c
@@ -24,7 +24,7 @@ G_DEFINE_TYPE (BeaverTargetQEMU, beaver_target_qemu, BEAVER_TYPE_TARGET)
(G_TYPE_INSTANCE_GET_PRIVATE ((o), BEAVER_TYPE_TARGET_QEMU, BeaverTargetQEMUPrivate))
#define QEMU_IP_ADDRESS "192.168.7.2"
-#define QEMU_SCRIPT "runqemu-nfs"
+#define QEMU_SCRIPT "poky-qemu"
#define ICON_FILE "anjuta-plugin-sdk.png"
#define SSH_OPTIONS "-o", "CheckHostIP no", "-o", \
"StrictHostKeyChecking no", "-o", "UserKnownHostsFile /dev/null"
diff --git a/src/plugin.c b/src/plugin.c
index c7fa6ec..71d2cd3 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -53,9 +53,9 @@
"-o \"UserKnownHostsFile /dev/null\"' " \
"-avv %s/usr/ root@%s:/usr"
-#define LOCAL_GDB_COMMAND "%s-gdb -x %s %s"
+#define LOCAL_GDB_COMMAND "%s -x %s %s"
-#define GDB_SCRIPT "set solib-search-path %s\n" \
+#define GDB_SCRIPT "set sysroot %s\n" \
"target remote %s:2345\n"
#define OPROFILEUI_COMMAND "oprofile-viewer -h %s -s %s"
@@ -712,7 +712,8 @@ do_local_gdb (AnjutaPluginSdk *sp)
gchar *cmd = NULL;
GError *error = NULL;
gchar *cur_dir = NULL;
- gchar *gdb_path = NULL;
+ gchar *solib_path = NULL;
+ gchar *gdb_cmd = NULL;
const gchar* env_value;
/*
@@ -730,14 +731,13 @@ do_local_gdb (AnjutaPluginSdk *sp)
//we use search path here according to latest SDK structure changes.
//path is extracted from environment settings PATH! And, ':' should be replaced
//with ';'
- env_value = g_getenv ("PATH");
- gdb_path = g_strdup(env_value);
- gdb_path = g_strdelimit(gdb_path, ":", ';');
+ env_value = g_getenv ("POKY_TARGET_SYSROOT");
+ solib_path = g_strdup(env_value);
- script_contents = g_strdup_printf (GDB_SCRIPT, gdb_path,
+ script_contents = g_strdup_printf (GDB_SCRIPT, solib_path,
beaver_target_get_ip_address (sp->target));
- g_debug("gdb search path %s\n", script_contents);
+ g_debug("gdb shared library path %s\n", script_contents);
channel = g_io_channel_unix_new (fd);
@@ -759,7 +759,7 @@ do_local_gdb (AnjutaPluginSdk *sp)
g_io_channel_unref (channel);
g_free (script_contents);
- g_free (gdb_path);
+ g_free (solib_path);
terminal = anjuta_shell_get_interface (ANJUTA_PLUGIN (sp)->shell,
IAnjutaTerminal, &error);
@@ -772,7 +772,9 @@ do_local_gdb (AnjutaPluginSdk *sp)
return;
}
- cmd = g_strdup_printf (LOCAL_GDB_COMMAND, sp->target_triplet,
+ env_value = g_getenv ("GDB");
+ gdb_cmd = g_strdup(env_value);
+ cmd = g_strdup_printf (LOCAL_GDB_COMMAND, gdb_cmd,
script_name, sp->gdb_local_path);
cur_dir = g_get_current_dir ();
child_pid = ianjuta_terminal_execute_command (terminal, cur_dir, cmd,
@@ -791,6 +793,7 @@ do_local_gdb (AnjutaPluginSdk *sp)
}
g_free (script_name);
+ g_free(gdb_cmd);
g_free (cmd);
g_free (cur_dir);
}