… | |
… | |
63 | static GHashTable *debug_hash; |
63 | static GHashTable *debug_hash; |
64 | static gchar *gdb_program; |
64 | static gchar *gdb_program; |
65 | |
65 | |
66 | static FILE *debug_fp; |
66 | static FILE *debug_fp; |
67 | |
67 | |
|
|
68 | // func def ------ this is bad!! |
|
|
69 | void android_send_generic_text(int id, char *text); |
|
|
70 | // func def ------ this is bad!! |
|
|
71 | |
68 | #if defined(_WIN32) || defined(__CEGCC__) |
72 | #if defined(_WIN32) || defined(__CEGCC__) |
69 | |
73 | |
70 | static void sigsegv(int sig) |
74 | static void sigsegv(int sig) |
71 | { |
75 | { |
72 | } |
76 | } |
… | |
… | |
363 | #endif |
367 | #endif |
364 | } |
368 | } |
365 | } |
369 | } |
366 | |
370 | |
367 | |
371 | |
|
|
372 | void debug_for_tests_vprintf(int level, const char *fmt, va_list ap) |
|
|
373 | { |
|
|
374 | #ifdef _CIDEBUG_BUILD_ |
|
|
375 | #ifdef HAVE_API_ANDROID |
|
|
376 | char *xbuffer = g_malloc(40960); |
|
|
377 | xbuffer[0] = '\0'; |
|
|
378 | vsprintf(xbuffer, fmt, ap); |
|
|
379 | android_send_generic_text(32, xbuffer); |
|
|
380 | g_free(xbuffer); |
|
|
381 | #endif |
|
|
382 | #endif |
|
|
383 | } |
|
|
384 | |
|
|
385 | |
|
|
386 | void debug_for_tests_printf(int level, const char *fmt, ...) |
|
|
387 | { |
|
|
388 | #ifdef _CIDEBUG_BUILD_ |
|
|
389 | #ifdef HAVE_API_ANDROID |
|
|
390 | va_list ap; |
|
|
391 | va_start(ap, fmt); |
|
|
392 | debug_for_tests_vprintf(level, fmt, ap); |
|
|
393 | va_end(ap); |
|
|
394 | #endif |
|
|
395 | #endif |
|
|
396 | } |
368 | |
397 | |
369 | void debug_printf(int level, const char *module, const int mlen, const char *function, const int flen, int prefix, const char *fmt, ...) |
398 | void debug_printf(int level, const char *module, const int mlen, const char *function, const int flen, int prefix, const char *fmt, ...) |
370 | { |
399 | { |
371 | #ifdef _DEBUG_BUILD_ |
400 | #ifdef _DEBUG_BUILD_ |
372 | va_list ap; |
401 | va_list ap; |
… | |
… | |
603 | g_free(gdb_program); |
632 | g_free(gdb_program); |
604 | g_hash_table_destroy(debug_hash); |
633 | g_hash_table_destroy(debug_hash); |
605 | debug_destroy(); |
634 | debug_destroy(); |
606 | } |
635 | } |
607 | |
636 | |
|
|
637 | |