Closed Bug 713278 Opened 13 years ago Closed 13 years ago

Teach NS_StackWalk to walk the stack of other threads too on Windows

Categories

(Core :: XPCOM, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla12

People

(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)

References

Details

Attachments

(1 file, 1 obsolete file)

We need this for the profiler. Vladan needs this for his chromehang work. Seems like everybody wants a smarter NS_StackWalk!
Attached patch Patch (v1) (obsolete) — Splinter Review
I used uintptr_t, because there seems to be no good way of getting a HANDLE out of a PRThread.
Assignee: nobody → ehsan
Status: NEW → ASSIGNED
Attachment #584102 - Flags: review?(dbaron)
Attached patch Patch (v2)Splinter Review
No default arguments in C!
Attachment #584102 - Attachment is obsolete: true
Attachment #584102 - Flags: review?(dbaron)
Attachment #584125 - Flags: review?(dbaron)
Try run for a0ded2d34b1a is complete. Detailed breakdown of the results available here: https://tbpl.mozilla.org/?tree=Try&rev=a0ded2d34b1a Results (out of 14 total builds): exception: 4 failure: 10 Builds (or logs if builds failed) available at: http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/eakhgari@mozilla.com-a0ded2d34b1a
Try run for 7120721080de is complete. Detailed breakdown of the results available here: https://tbpl.mozilla.org/?tree=Try&rev=7120721080de Results (out of 207 total builds): exception: 1 success: 180 warnings: 26 Builds (or logs if builds failed) available at: http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/eakhgari@mozilla.com-7120721080de
Comment on attachment 584125 [details] [diff] [review] Patch (v2) >+ HANDLE targetThread = ::GetCurrentThread(); >+ if (aThread) { >+ targetThread = reinterpret_cast<HANDLE> (aThread); >+ } Why not do an if/else to avoid the GetCurrentThread call? I suspect you'll have to adjust this code a bit once you try to add a second platform (e.g., uintptr_t as the thread type, 0/null as the indicator for current thread), but I guess you'll hit that when you hit that, and this seems ok for now. r=dbaron
Attachment #584125 - Flags: review?(dbaron) → review+
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: