[Title] change DEBUGCH path and fix emul_debug.sh
authormunkyu.im <munkyu.im@samsung.com>
Thu, 8 Dec 2011 01:39:26 +0000 (10:39 +0900)
committermunkyu.im <munkyu.im@samsung.com>
Thu, 8 Dec 2011 01:39:26 +0000 (10:39 +0900)
[Type]Enhancement
[Module]
[Priority]
[CQ#]
[Redmine#]
[Problem]
[Cause]
[Solution]
[TestCase]

tizen/src/debug_ch.c
tizen/src/debug_ch_vtm.c
tizen/src/emul_debug.sh
tizen/src/fileio.c
tizen/src/fileio.h

index 4055bba..6b9dd94 100644 (file)
@@ -18,7 +18,7 @@
 
 extern STARTUP_OPTION startup_option;
 static char logfile[256] = { 0, };
-
+static char debugchfile[256] = {0, };
 static inline int interlocked_xchg_add( int *dest, int incr )
 {
        int ret;
@@ -237,8 +237,10 @@ static void debug_init(void)
                return;  /* already initialized */
 
        nb_debug_options = 0;
+       strcpy(debugchfile, get_etc_path());
+       strcat(debugchfile, "/DEBUGCH");
 
-       fp= fopen("./DEBUGCH", "r");
+       fp= fopen(debugchfile, "r");
        if( fp == NULL){
                debug = getenv("DEBUGCH");
        }else{
index 7a339d0..8bbfd78 100644 (file)
@@ -18,6 +18,7 @@
 
 extern STARTUP_OPTION startup_option;
 static char logfile[256] = { 0, };
+static char debugchfile[256] = {0, };
 static inline int interlocked_xchg_add( int *dest, int incr )
 {
        int ret;
@@ -236,8 +237,10 @@ static void debug_init(void)
                return;  /* already initialized */
 
        nb_debug_options = 0;
+       strcpy(debugchfile, get_etc_path());
+       strcat(debugchfile, "/DEBUGCH");
 
-       fp= fopen("./DEBUGCH", "r");
+       fp= fopen(debugchfile, "r");
        if( fp == NULL){
                debug = getenv("DEBUGCH");
        }else{
index aff3f94..3b90cca 100755 (executable)
@@ -1,3 +1,5 @@
 #!/bin/sh
-gdb --args  ./emulator-x86 --vtm default --disk x86/VMs/default/emulimg-default.x86 \
- -- -net nic,model=virtio -soundhw all -usb -usbdevice wacom-tablet -vga tizen -bios bios.bin -L x86/data/pc-bios -kernel x86/data/kernel-img/bzImage -usbdevice keyboard -rtc base=utc -net user --enable-kvm -redir tcp:1202:10.0.2.16:22
+CURDIR=`pwd`
+
+gdb --args $CURDIR/emulator-x86 --vtm default --disk $CURDIR/../x86/VMs/default/emulimg-default.x86 \
+ -- -net nic,model=virtio -soundhw all -usb -usbdevice wacom-tablet -vga tizen -bios bios.bin -L $CURDIR/../x86/data/pc-bios -kernel $CURDIR/../x86/data/kernel-img/bzImage -usbdevice keyboard -rtc base=utc -net user --enable-kvm -redir tcp:1202:10.0.2.16:22
index 0d0086c..568276e 100644 (file)
@@ -271,6 +271,35 @@ const gchar *get_arch_abs_path(void)
        return path;
 }
 
+/* get_etc_path = "~/tizen_sdk/simulator/etc" */
+const gchar *get_etc_path(void)
+{
+       const char etcsubdir[] = "/etc";
+       const char *path;
+       static char *etc_path;
+
+       if (etc_path)
+               return etc_path;
+
+       path = get_root_path();
+       etc_path = malloc(strlen(path) + sizeof etcsubdir);
+       if (!etc_path) {
+               ERR( "%s - %d: memory allocation failed!\n", __FILE__, __LINE__);
+               exit(1);
+       }
+
+       strcpy(etc_path, path);
+       strcat(etc_path, etcsubdir);
+
+       if (g_file_test(etc_path, G_FILE_TEST_IS_DIR) == FALSE) {
+               ERR( "no etc directory at %s\n", etc_path);
+       }
+
+       return etc_path;
+}
+
+
+
 /* get_skin_path = "~/tizen_sdk/simulator/skins" */
 const gchar *get_skin_path(void)
 {
@@ -307,7 +336,8 @@ const gchar *get_skin_path(void)
 }
 
 
-/* get_data_path = "~/tizen_sdk/Emulator/data" */
+/* get_data_path = "x86/data" 
+*                               = "arm/data" */
 const gchar *get_data_path(void)
 {
        static const char suffix[] = "/data";
@@ -326,7 +356,8 @@ const gchar *get_data_path(void)
        return data_path;
 }
 
-/* get_data_path = "~/tizen_sdk/Emulator/data" */
+/* get_data_path = "~/tizen_sdk/Emulator/x86/data" 
+ *                              = "~/tizen_sdk/Emulator/x86/data" */
 const gchar *get_data_abs_path(void)
 {
        static const char suffix[] = "/data";
index 2cede57..5bccbdb 100644 (file)
@@ -67,6 +67,7 @@ const gchar *get_vms_path(void);
 const gchar *get_vms_abs_path(void);
 const gchar *get_conf_abs_path(void);
 const gchar *get_baseimg_abs_path(void);
+const gchar *get_etc_path(void);
 gchar *get_targetlist_abs_filepath(void);
 gchar *get_virtual_target_path(gchar *virtual_target_name);
 gchar *get_virtual_target_abs_path(gchar *virtual_target_name);