From b68c4378faf2607ab223646ab93ba79cc748af10 Mon Sep 17 00:00:00 2001 From: "munkyu.im" Date: Thu, 8 Dec 2011 10:39:26 +0900 Subject: [PATCH] [Title] change DEBUGCH path and fix emul_debug.sh [Type]Enhancement [Module] [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] --- tizen/src/debug_ch.c | 6 ++++-- tizen/src/debug_ch_vtm.c | 5 ++++- tizen/src/emul_debug.sh | 6 ++++-- tizen/src/fileio.c | 35 +++++++++++++++++++++++++++++++++-- tizen/src/fileio.h | 1 + 5 files changed, 46 insertions(+), 7 deletions(-) diff --git a/tizen/src/debug_ch.c b/tizen/src/debug_ch.c index 4055bba..6b9dd94 100644 --- a/tizen/src/debug_ch.c +++ b/tizen/src/debug_ch.c @@ -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{ diff --git a/tizen/src/debug_ch_vtm.c b/tizen/src/debug_ch_vtm.c index 7a339d0..8bbfd78 100644 --- a/tizen/src/debug_ch_vtm.c +++ b/tizen/src/debug_ch_vtm.c @@ -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{ diff --git a/tizen/src/emul_debug.sh b/tizen/src/emul_debug.sh index aff3f94..3b90cca 100755 --- a/tizen/src/emul_debug.sh +++ b/tizen/src/emul_debug.sh @@ -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 diff --git a/tizen/src/fileio.c b/tizen/src/fileio.c index 0d0086c..568276e 100644 --- a/tizen/src/fileio.c +++ b/tizen/src/fileio.c @@ -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"; diff --git a/tizen/src/fileio.h b/tizen/src/fileio.h index 2cede57..5bccbdb 100644 --- a/tizen/src/fileio.h +++ b/tizen/src/fileio.h @@ -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); -- 2.7.4