summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-08-02 22:41:54 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-08-02 22:41:54 +0900
commit470b48d63cfcbd08323634fa395bdbb1b93b8e2d (patch)
treec6f5173c74dfff8156dddfbb3a723f426a70da85
parent49bb102d168ed752759fd1dd7c17c874dc66ce97 (diff)
eina debug - new debug infra - comment out and make a note on bad endian
bad endian... code... see the comment in the src about why i think this is bad as obviously the buffer pointed to is a 64bit type always that is a pointer to something...
-rw-r--r--src/lib/eina/eina_debug.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/lib/eina/eina_debug.c b/src/lib/eina/eina_debug.c
index f0d101e864..b71a263670 100644
--- a/src/lib/eina/eina_debug.c
+++ b/src/lib/eina/eina_debug.c
@@ -311,7 +311,18 @@ _callbacks_register_cb(Eina_Debug_Session *session, int src_id EINA_UNUSED, void
311 311
312 uint64_t info_64; 312 uint64_t info_64;
313 memcpy(&info_64, buffer, sizeof(uint64_t)); 313 memcpy(&info_64, buffer, sizeof(uint64_t));
314 info_64 = SWAP_64(info_64); 314 // This is super dodgey. like really dodgey. it HAPPENS to work on
315 // little endian. definitely on 64bit because the SWAP is a nop and the
316 // pointer the buffer points to can be just used as-is, but if this
317 // was bigendian the swap would mess up the ptr and crash (on 64bit) as
318 // it'd swap everything around. on little endian 32bit it will happen to
319 // work as it takes the lower 32bits, but on big endian... bork bork.
320 //
321 // so obviously... don't swap, then it'll always take the LOWER 32bits
322 // on 32bit and should work... since buffer obviously is pointing to
323 // a 64bit type that contains a pointer to something... and on 64bit it'll
324 // just work as-is as sizes match.
325// info_64 = SWAP_64(info_64);
315 info = (_opcode_reply_info *)info_64; 326 info = (_opcode_reply_info *)info_64;
316 327
317 if (!info) return EINA_FALSE; 328 if (!info) return EINA_FALSE;