Last Comment Bug 489938 - allow redirecting dump() to a file
: allow redirecting dump() to a file
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM (show other bugs)
: unspecified
: All All
: -- normal (vote)
: ---
Assigned To: Vladimir Vukicevic [:vlad] [:vladv]
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-04-23 20:03 PDT by Vladimir Vukicevic [:vlad] [:vladv]
Modified: 2009-05-19 18:20 PDT (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
dump to file (1.30 KB, patch)
2009-04-23 20:03 PDT, Vladimir Vukicevic [:vlad] [:vladv]
jst: review+
jst: superreview+
Details | Diff | Review
updated patch (1.41 KB, patch)
2009-04-24 15:55 PDT, Vladimir Vukicevic [:vlad] [:vladv]
jst: review+
jst: superreview+
Details | Diff | Review

Description Vladimir Vukicevic [:vlad] [:vladv] 2009-04-23 20:03:33 PDT
Created attachment 374405 [details] [diff] [review]
dump to file

A lot of our tools rely on dump() for output, which makes it hard to get at the data on devices where we don't really have a stdout.  Here's a simple patch that adds a pref to optionally redirect dump() output to a file.

With this, and the ability to execute commands remotely with a command line (e.g. for winmo/wince, using rapi tools prun/pput/pget), we can run many of our tests on mobile devices.
Comment 1 Johnny Stenback (:jst, jst@mozilla.com) 2009-04-24 13:17:55 PDT
Comment on attachment 374405 [details] [diff] [review]
dump to file

+    const nsAdoptingCString& fname = 
+      nsContentUtils::GetCharPref("browser.dom.window.dump.file");
+    if (fname) {

That should be if (!fname.IsEmpty()) rather than just checking if (fname), right?

r+sr=jst
Comment 2 Vladimir Vukicevic [:vlad] [:vladv] 2009-04-24 15:55:08 PDT
Created attachment 374540 [details] [diff] [review]
updated patch

Updated patch -- this correctly closes the file only in ::ShutDown instead of in ::Cleanup, giving us a new file per run correctly.  Also uses fputs() and adds a fflush() in dump() to ensure that the output always ends up in the file.
Comment 3 Vladimir Vukicevic [:vlad] [:vladv] 2009-04-24 16:25:08 PDT
http://hg.mozilla.org/mozilla-central/rev/49f4101fb09b

thanks!

Note You need to log in before you can comment on or make changes to this bug.