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)

All
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla38

People

(Reporter: ted, Assigned: ted)

References

Details

Attachments

(1 file, 1 obsolete file)

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.
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: nobody → ted
Status: NEW → ASSIGNED
Posted the outdated broken version of my patch (like a boss). Here's the working one.
Attachment #8540721 - Flags: review?(jorendorff)
Attachment #8540719 - Attachment is obsolete: true
Attachment #8540719 - Flags: review?(jorendorff)
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+
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
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
Depends on: 1125588
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: