sdb: display arch name
authormunkyu.im <munkyu.im@samsung.com>
Tue, 27 Nov 2012 06:22:41 +0000 (15:22 +0900)
committermunkyu.im <munkyu.im@samsung.com>
Tue, 27 Nov 2012 06:22:41 +0000 (15:22 +0900)
on connection explorer and sdb status,
shows arch name of running emulator instance.
Not supported on Mac OSX yet.

Signed-off-by: Munkyu Im <munkyu.im@samsung.com>
tizen/src/emulator.c
tizen/src/sdb.c

index f0d2c80588a7ed3a68a7d03836da36a1a41fb299..659cc400827ec3b968c5497c2744b4658c8a6ebd 100644 (file)
@@ -83,6 +83,11 @@ MULTI_DEBUG_CHANNEL(qemu, main);
 #define LCD_WIDTH_PREFIX "width="
 #define LCD_HEIGHT_PREFIX "height="
 #define MIDBUF  128
+#if defined(TARGET_I386)
+#define ARCH "x86"
+#else
+#define ARCH "arm"
+#endif
 
 int tizen_base_port;
 char tizen_target_path[MAXLEN];
@@ -208,7 +213,7 @@ void make_shdmem(void)
         ERR("shmat failed\n");
         return;
     }
-    sprintf(shared_memory, "%s", tizen_target_path);
+    sprintf(shared_memory, "%s:%s", tizen_target_path, ARCH);
     INFO("shared memory key: %d value: %s\n",
         tizen_base_port, (char *)shared_memory);
 #elif defined(CONFIG_WIN32)
@@ -217,7 +222,7 @@ void make_shdmem(void)
     char *port_in_use;
     char *shared_memory;
 
-    shared_memory = g_strdup_printf("%s", tizen_target_path);
+    shared_memory = g_strdup_printf("%s:%s", tizen_target_path, ARCH);
     port_in_use =  g_strdup_printf("%d", tizen_base_port);
     hMapFile = CreateFileMapping(
                  INVALID_HANDLE_VALUE, /* use paging file */
index b8cdab20f8cdedf25bb190d2b96e948ecdf6504f..f27c24305d0461da3b1cf87d365a159a67f6d5e1 100644 (file)
 #include "nbd.h"\r
 #include "tizen/src/debug_ch.h"\r
 \r
-//DEFAULT_DEBUG_CHANNEL(qemu);\r
 MULTI_DEBUG_CHANNEL(qemu, sdb);\r
 \r
+#if defined(TARGET_I386)\r
+#define ARCH "x86"\r
+#else\r
+#define ARCH "arm"\r
+#endif\r
+\r
+\r
 /* QSOCKET_CALL is used to deal with the fact that EINTR happens pretty\r
  * easily in QEMU since we use SIGALRM to implement periodic timers\r
  */\r
@@ -358,7 +364,12 @@ void notify_sdb_daemon_start(void) {
     }\r
 \r
     /* length is hex host:emulator:port: -> 0x13 = 20 */\r
+#if defined(CONFIG_DARWIN)\r
+    //TODO: not supported arch name on mac yet.\r
     sprintf(tmp, "00%2xhost:emulator:%d:%s", 20 + strlen(targetname), tizen_base_port + 1, targetname);\r
+#else\r
+    sprintf(tmp, "00%2xhost:emulator:%d:%s:%s", 23 + strlen(targetname), tizen_base_port + 1, targetname, ARCH);\r
+#endif\r
     INFO("message to send to SDB server: %s\n", tmp);\r
     if (socket_send(s, tmp, MAXPACKETLEN) < 0) {\r
         ERR( "message sending to SDB server error!\n");\r