The default bug view has changed. See this FAQ.

__builtin_frame_address(0) doesn't work anymore

RESOLVED FIXED

Status

()

Core
XPCOM
RESOLVED FIXED
11 years ago
11 years ago

People

(Reporter: dbaron, Assigned: dbaron)

Tracking

({fixed1.8.1})

Trunk
x86
Linux
fixed1.8.1
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [patch])

Attachments

(1 attachment)

(Assignee)

Description

11 years ago
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.
(Assignee)

Comment 1

11 years ago
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.
(Assignee)

Comment 2

11 years ago
Created attachment 216054 [details] [diff] [review]
patch

I also threw in some changes to prefer void* over u_long for pointers.
Attachment #216054 - Flags: review?(brendan)
(Assignee)

Comment 3

11 years ago
Er, sorry, uint32.  (Which actually means it *is* important for x86_64, although some of these don't yet completely work there.)
(Assignee)

Updated

11 years ago
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+
(Assignee)

Comment 5

11 years ago
Checked in to trunk.
Status: NEW → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED
(Assignee)

Updated

11 years ago
Attachment #216054 - Flags: approval-branch-1.8.1?(brendan)
(Assignee)

Comment 6

11 years ago
(And I fixed the C++ comments to be C comments after landing on the trunk; need to do that on the branch too.)

Updated

11 years ago
Attachment #216054 - Flags: approval-branch-1.8.1?(brendan) → approval-branch-1.8.1+
(Assignee)

Comment 7

11 years ago
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.