Closed Bug 780511 Opened 12 years ago Closed 12 years ago

Pipe additional output to the Windows debugger console

Categories

(Core :: General, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla17

People

(Reporter: jimm, Assigned: jimm)

Details

Attachments

(2 files)

Attached patch patchSplinter Review
console output, component load, and Dump in frame manager.
Attachment #649136 - Flags: review?(neil)
Comment on attachment 649136 [details] [diff] [review]
patch

>+    OutputDebugStringW(aStr.BeginReading());
BeginReading doesn't guarantee null-termination, so use PromiseFlatString(aStr).get() instead. r=me with that fixed. It's a shame that nsGlobalWindow::Dump uses OutputDebugStringA though :-(

>+            nsXPIDLString msg;
I have a slight preference for nsString here because nsXPIDLString::get can return nullptr.

>+            message->GetMessageMoz(getter_Copies(msg));
>+            OutputDebugStringW(msg.get());
>+            OutputDebugStringW(L"\n");
I'd prefer if you appended the newline to the string before outputting it, this makes the debugger output pane update more smoothly (it tries to keep the last character on screen which is hard when the line of text exceeds the window width).
Attachment #649136 - Flags: review?(neil) → review+
(In reply to neil@parkwaycc.co.uk from comment #1)
> Comment on attachment 649136 [details] [diff] [review]
> patch
> 
> >+    OutputDebugStringW(aStr.BeginReading());
> BeginReading doesn't guarantee null-termination, so use
> PromiseFlatString(aStr).get() instead. r=me with that fixed. It's a shame
> that nsGlobalWindow::Dump uses OutputDebugStringA though :-(

Has that caused problems for non-ascii output? I could probably update it if the wide char data is available there.
Attached patch updated patchSplinter Review
https://hg.mozilla.org/mozilla-central/rev/ac4ee04df5e2
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
(In reply to Jim Mathies from comment #2)
> (In reply to neil@parkwaycc.co.uk from comment #1)
> > >+    OutputDebugStringW(aStr.BeginReading());
> > BeginReading doesn't guarantee null-termination, so use
> > PromiseFlatString(aStr).get() instead. r=me with that fixed. It's a shame
> > that nsGlobalWindow::Dump uses OutputDebugStringA though :-(
> Has that caused problems for non-ascii output? I could probably update it if
> the wide char data is available there.
I don't know, I don't get to dump much non-ASCII output, but the wide char data is certainly available via PromiseFlatString(aStr).get() again ;-)
This makes running Firefox in a debugger super-slow. I'm using a Nightly with WinDBG attached to try to catch an intermittent OOM, and every time I load a page the whole browser is unresponsive because it's feeding tons of error console output to the debugger.
(In reply to Ted Mielczarek [:ted.mielczarek] from comment #7)
> This makes running Firefox in a debugger super-slow. I'm using a Nightly
> with WinDBG attached to try to catch an intermittent OOM, and every time I
> load a page the whole browser is unresponsive because it's feeding tons of
> error console output to the debugger.

We could add a build config flag that disables calls to OutputDebugString.
I think I'd be happy if we could just revert the bit that feeds the error console to the debugger. That seems to be what's causing me the most grief.
(In reply to Ted Mielczarek [:ted.mielczarek] from comment #9)
> I think I'd be happy if we could just revert the bit that feeds the error
> console to the debugger. That seems to be what's causing me the most grief.

Hmm, that output is really useful when you're remote debugging metrofx on a Win8 tablet.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: