Stdout and stderr now work for NaCl in Windows Chrome with --enable-logging

1,523 views
Skip to first unread message

Mark Seaborn

unread,
Jan 31, 2013, 1:24:51 PM1/31/13
to Native Client Discuss
It's now possible to see the output from printf() calls in NaCl untrusted code on the Windows console if you pass "--enable-logging" to Chrome on the command line.  This should make debugging on Windows somewhat easier.  This has always worked on Linux and Mac, but not Windows until now.

This feature is in Chrome Canary as of version 26.0.1399.0.

Note that this only works on the Windows console and not on Buildbot or in Cygwin's current default terminal (mintty).  Making NaCl's stdout and stderr work in those cases is a work in progress (see http://code.google.com/p/chromium/issues/detail?id=171836 for the details).

Mark

AlainC

unread,
Feb 1, 2013, 6:31:26 AM2/1/13
to native-cli...@googlegroups.com, msea...@chromium.org
Good news...

One question however: what do you mean by "Windows console" ?
Do we need to use "start /wait" from the command line, or something else ?

Mark Seaborn

unread,
Feb 1, 2013, 11:35:13 AM2/1/13
to AlainC, native-cli...@googlegroups.com
On 1 February 2013 03:31, AlainC <acor...@tftlabs.com> wrote:
Good news...

One question however: what do you mean by "Windows console" ?

I mean the window used by the Windows Command Prompt.
 
Do we need to use "start /wait" from the command line, or something else ?

You can use that, but you don't have to.

For example, the following works from the Command Prompt on my system:

C:\Users\mseaborn>start "" /wait "\Users\mseaborn\AppData\Local\Google\Chrome SxS\Application\chrome.exe" --enable-logging --enable-nacl http://plash.beasts.org/nacl/hello.html
[4404,6968:16:30:12.392000] Native Client module will be loaded at base address 0x0000075500000000
[4404,6604:16:30:12.468000] NaClAbiStatHostDescStatXlateCtor: Unusual NaCl descriptor type (not constructible). The NaCl app has a file with st_mode = 020000. (This is normal for std{in,out,err}, or other inherited/injected files.)
Hello, world!
Hello, world! (stderr)
[4404,6040:16:30:12.470000] NaCl untrusted code called _exit(0x0)

If you omit the 'start "" /wait' part, the output will still work, but cmd.exe will print a command prompt immediately after starting Chrome, and Chrome's output will be interleaved with cmd.exe's output, which can be a little confusing.

Mark

AlainC

unread,
Feb 1, 2013, 12:04:40 PM2/1/13
to native-cli...@googlegroups.com, AlainC, msea...@chromium.org
Yes, it works. Many thanks !
Reply all
Reply to author
Forward
0 new messages