Last Comment Bug 741242 - Profiler address output broken by bug 739800 on Mac 64 bit
: Profiler address output broken by bug 739800 on Mac 64 bit
: regression
Product: Core
Classification: Components
Component: Gecko Profiler (show other bugs)
: Trunk
: x86_64 Mac OS X
: -- normal (vote)
: mozilla14
Assigned To: Vladan Djeric (:vladan)
Depends on:
Blocks: 739800
  Show dependency treegraph
Reported: 2012-04-01 14:20 PDT by Markus Stange [:mstange]
Modified: 2012-04-03 02:00 PDT (History)
3 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

v1 (980 bytes, patch)
2012-04-01 14:20 PDT, Markus Stange [:mstange]
vladan.bugzilla: review-
Details | Diff | Splinter Review
Use %#llx to print pointers (1.67 KB, patch)
2012-04-02 11:10 PDT, Vladan Djeric (:vladan)
b56girard: review+
vladan.bugzilla: checkin+
Details | Diff | Splinter Review

Description Markus Stange [:mstange] 2012-04-01 14:20:30 PDT
Created attachment 611316 [details] [diff] [review]

%#x uses an int value which truncates 64 bit addresses to 32 bit. We need to use %#lx instead.
Do things still work on Windows with this change?
Comment 1 Benoit Girard (:BenWa) 2012-04-01 16:33:56 PDT
I think we need '(long unsigned int)pc'.
Comment 2 Vladan Djeric (:vladan) 2012-04-02 09:48:30 PDT
Comment on attachment 611316 [details] [diff] [review]

%lx truncates the address on 64-bit windows

Let's do this:

snprintf(tagBuff, 1024, "l-0x%p\n", pc);

^^^ explicitly specifying "0x" because "%#p" outputs "OX"

Can you guys test this on 32-bit/64-bit Unix and Mac?
Comment 3 Benoit Girard (:BenWa) 2012-04-02 09:52:20 PDT
Tested, %p appends 0x so we get it twice. Let's use some ifdefs here.
Comment 4 Vladan Djeric (:vladan) 2012-04-02 11:10:55 PDT
Created attachment 611522 [details] [diff] [review]
Use %#llx to print pointers
Comment 5 Vladan Djeric (:vladan) 2012-04-02 11:37:51 PDT
Comment on attachment 611522 [details] [diff] [review]
Use %#llx to print pointers
Comment 6 Marco Bonardo [::mak] 2012-04-03 02:00:49 PDT

Note You need to log in before you can comment on or make changes to this bug.