Closed
Bug 1100335
Opened 11 years ago
Closed 11 years ago
JS debug helper functions should use OutputDebugString on Windows
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
mozilla38
People
(Reporter: ted, Assigned: ted)
References
Details
Attachments
(1 file, 1 obsolete file)
1.44 KB,
patch
|
jorendorff
:
review+
|
Details | Diff | Splinter Review |
The JS engine has some handy debug helpers like js_DumpAtom and js_DumpBacktrace. Unfortunately these seem to always dump to stdout or stderr, which can be hard or impossible to find when debugging a Windows opt build (like a nightly or release).
We should make these functions call OutputDebugString on Windows, since they're intended for use under a debugger anyway.
Assignee | ||
Comment 1•11 years ago
|
||
This fixes js_DumpBacktrace because that was easy and it's the thing I usually want when I'm poking at my Nightly in a debugger and the C++ stack shows we're executing JS. The other debugging methods could be similarly fixed, but right now they contain a bunch of fprintfs and I didn't feel like rewriting them all. They could use the Sprinter class that js_DumpBacktrace does, or some other abstraction.
Attachment #8540719 -
Flags: review?(jorendorff)
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → ted
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•11 years ago
|
||
Posted the outdated broken version of my patch (like a boss). Here's the working one.
Attachment #8540721 -
Flags: review?(jorendorff)
Assignee | ||
Updated•11 years ago
|
Attachment #8540719 -
Attachment is obsolete: true
Attachment #8540719 -
Flags: review?(jorendorff)
Comment 3•11 years ago
|
||
Comment on attachment 8540721 [details] [diff] [review]
Use OutputDebugString on Windows in js_DumpBacktrace
Review of attachment 8540721 [details] [diff] [review]:
-----------------------------------------------------------------
OK.
Attachment #8540721 -
Flags: review?(jorendorff) → review+
Assignee | ||
Comment 4•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
Comment 6•11 years ago
|
||
Comment on attachment 8540721 [details] [diff] [review]
Use OutputDebugString on Windows in js_DumpBacktrace
Review of attachment 8540721 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/src/jsobj.cpp
@@ +4033,5 @@
> +#ifdef XP_WIN32
> + if (IsDebuggerPresent()) {
> + OutputDebugStringA(sprinter.string());
> + }
> +#endif
Missing:
#ifdef XP_WIN
#include <windows.h>
#endif
Fwiw, filed bug 1399777 as a followup.
You need to log in
before you can comment on or make changes to this bug.
Description
•