[llvm-commits] [PATCH] Add support for OutputDebugString to raw_ostream and add support for virtualized out/err streams

Dan Gohman gohman at apple.com
Wed Mar 2 11:55:13 PST 2011


On Mar 1, 2011, at 8:05 PM, Erik Olofsson wrote:

> Adds support for OutputDebugString to raw_ostream as well as one object to access a virtualized errs and outs. This is needed for subsequent patches in clang so you can redirect errs and outs to OutputDebugString. The rationale for needing this is that debugging from Visual Studio will not allow you to capture stdout and stderr into its Output window but OutputDebugString is captured there.

Hmm. It's not even possible to view the output of a classic
"hello world"?

> This change (in clang...) will also be useful if you want to redirect compiler output you can just create your own raw_output_streams and pass to the compiler functions.
> 
>  
> 
> Together with MSVC style diagnostics this really helps in clang development where you can get from diagnostics directly to the code in question when debugging.

Would it be possible to achieve what you want by extending dbgs()?
If not, how should code decide between using dbgs() and debugouts()?

What's the purpose of the raw_output_streams class? Are you expecting
to migrate code that uses errs() and outs() to using it? If so,
that's quite invasive. If not, what's the purpose?

Dan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110302/1ffc46fc/attachment.html>


More information about the llvm-commits mailing list