Closed Bug 331436 Opened 16 years ago Closed 16 years ago

__builtin_frame_address(0) doesn't work anymore

Categories

(Core :: XPCOM, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: dbaron, Assigned: dbaron)

Details

(Keywords: fixed1.8.1, Whiteboard: [patch])

Attachments

(1 file)

So, between the compilers on Fedora Core 4 and Fedora Core 5, __builtin_frame_address(0), which we started using extensively for our debugging tools in the patches to bug 323853, stopped working.  Instead of pointing to the saved frame pointer on the stack, it points to the last of the saved registers on the stack, which varies by function.

So I can work around it by throwing bp += 3 in DumpStackToFile and ++bp in jprof's equivalent, but that doesn't seem satisfactory.

I could use inline assembler as in attachment 210815 [details] [diff] [review].

I'd also like to understand why this changed so I can know how to ifdef any fixes, if necessary.
Note that I'm compiling with -fno-omit-frame-pointer.  There may have been some changes that require that for this stuff to work (i.e., stop using a register for the frame pointer by default); perhaps they're even related.
Attached patch patchSplinter Review
I also threw in some changes to prefer void* over u_long for pointers.
Attachment #216054 - Flags: review?(brendan)
Er, sorry, uint32.  (Which actually means it *is* important for x86_64, although some of these don't yet completely work there.)
Whiteboard: [patch]
Comment on attachment 216054 [details] [diff] [review]
patch

Very quick r=me, more rs=me actually (jury duty break ending).

/be
Attachment #216054 - Flags: review?(brendan) → review+
Checked in to trunk.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Attachment #216054 - Flags: approval-branch-1.8.1?(brendan)
(And I fixed the C++ comments to be C comments after landing on the trunk; need to do that on the branch too.)
Attachment #216054 - Flags: approval-branch-1.8.1?(brendan) → approval-branch-1.8.1+
Checked in to MOZILLA_1_8_BRANCH.
Keywords: fixed1.8.1
You need to log in before you can comment on or make changes to this bug.