From eafc7331be620eec85569e31906d23da52ef3f45 Mon Sep 17 00:00:00 2001 From: "munkyu.im" Date: Tue, 27 Nov 2012 15:22:41 +0900 Subject: [PATCH] sdb: display arch name on connection explorer and sdb status, shows arch name of running emulator instance. Not supported on Mac OSX yet. Signed-off-by: Munkyu Im --- tizen/src/emulator.c | 9 +++++++-- tizen/src/sdb.c | 13 ++++++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/tizen/src/emulator.c b/tizen/src/emulator.c index f0d2c80588..659cc40082 100644 --- a/tizen/src/emulator.c +++ b/tizen/src/emulator.c @@ -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 */ diff --git a/tizen/src/sdb.c b/tizen/src/sdb.c index b8cdab20f8..f27c24305d 100644 --- a/tizen/src/sdb.c +++ b/tizen/src/sdb.c @@ -30,9 +30,15 @@ #include "nbd.h" #include "tizen/src/debug_ch.h" -//DEFAULT_DEBUG_CHANNEL(qemu); MULTI_DEBUG_CHANNEL(qemu, sdb); +#if defined(TARGET_I386) +#define ARCH "x86" +#else +#define ARCH "arm" +#endif + + /* QSOCKET_CALL is used to deal with the fact that EINTR happens pretty * easily in QEMU since we use SIGALRM to implement periodic timers */ @@ -358,7 +364,12 @@ void notify_sdb_daemon_start(void) { } /* length is hex host:emulator:port: -> 0x13 = 20 */ +#if defined(CONFIG_DARWIN) + //TODO: not supported arch name on mac yet. sprintf(tmp, "00%2xhost:emulator:%d:%s", 20 + strlen(targetname), tizen_base_port + 1, targetname); +#else + sprintf(tmp, "00%2xhost:emulator:%d:%s:%s", 23 + strlen(targetname), tizen_base_port + 1, targetname, ARCH); +#endif INFO("message to send to SDB server: %s\n", tmp); if (socket_send(s, tmp, MAXPACKETLEN) < 0) { ERR( "message sending to SDB server error!\n"); -- 2.34.1