search for: flushbufferwithbann

Displaying 9 results from an estimated 9 matches for "flushbufferwithbann".

Did you mean: flushbufferwithbanner
2009 Dec 21
0
[LLVMdev] [PATCH] Circular Buffered Debug Stream
...setStream(Stream, Owns); + } + explicit circular_raw_ostream() + : raw_ostream(/*unbuffered*/true), + TheStream(0), + OwnsStream(REFERENCE_ONLY), + BufferArray(0) { + Cur = BufferArray; + } + + ~circular_raw_ostream() { + flush(); + flushBufferWithBanner(); + releaseStream(); + delete[] BufferArray; + } + + /// setStream - Tell the circular_raw_ostream to output a + /// different stream. "Owns" tells circular_raw_ostream whether + /// it should take responsibility for managing the underlying + /// stream. +...
2009 Dec 19
2
[LLVMdev] [PATCH] Circular Buffered Debug Stream
On Friday 18 December 2009 19:47, Chris Lattner wrote: > On Dec 18, 2009, at 3:46 PM, David Greene wrote: > > + /// circular_raw_ostream - A raw_ostream that saves its output in a > > + /// circular buffer. > > A better description would be "which *can* save its data to a circular > buffer, or can pass it through directly to an underlying stream if > specified
2009 Dec 21
3
[LLVMdev] [PATCH] Circular Buffered Debug Stream
...erSize - Cur); > + // Write the newer portion of the buffer. > + TheStream->write(BufferArray, Cur - BufferArray); > + Cur = BufferArray; > + } Is this correct in the case when the circular buffer hasn't completely filled yet? > +void circular_raw_ostream::flushBufferWithBanner(void) { > + if (BufferSize != 0) { > + // Write out the buffer > + const char *msg = "*** Log Output ***\n"; This is not generic. If you really want something like this, the string to print should be provided to the ctor. -Chris
2009 Dec 21
2
[LLVMdev] [PATCH] Implement dbgs()
...+ // know that debug mode is enabled and dbgs() really is a + // circular_raw_ostream. If NDEBUG is defined, then dbgs() == + // errs() but this will never be invoked. + llvm::circular_raw_ostream *dbgout = + static_cast<llvm::circular_raw_ostream *>(&llvm::dbgs()); + dbgout->flushBufferWithBanner(); +} + // isCurrentDebugType - Return true if the specified string is the debug type // specified on the command line, or if none was specified on the command line // with the -debug-only=X option. @@ -66,9 +91,29 @@ CurrentDebugType = Type; } +/// dbgs - Return a circular-buffered deb...
2009 Dec 21
0
[LLVMdev] [PATCH] Circular Buffered Debug Stream
...h of garbage output but I don't think it should fault or anything. I don't think there's a way of knowing whether the buffer got filled all the way to the end unless we add another member variable. In practice, it will almost always be filled. > > +void circular_raw_ostream::flushBufferWithBanner(void) { > > + if (BufferSize != 0) { > > + // Write out the buffer > > + const char *msg = "*** Log Output ***\n"; > > This is not generic. If you really want something like this, the string to > print should be provided to the ctor. Ok. Attached an...
2009 Dec 19
0
[LLVMdev] [PATCH] Implement dbgs()
On Dec 18, 2009, at 6:36 PM, David Greene wrote: >>> +// Signal handlers - dump debug output on termination. >>> +static void debug_user_sig_handler(void *Cookie) >>> +{ >>> + llvm::circular_raw_ostream *logout = >>> + dynamic_cast<llvm::circular_raw_ostream *>(&llvm::dbgs()); >> >> Please do not use dynamic_cast, we're
2009 Dec 21
0
[LLVMdev] [PATCH] Implement dbgs()
On 2009-12-21 18:06, David Greene wrote: > On Saturday 19 December 2009 00:16, Chris Lattner wrote: > > >>> Or I think I can just assume (Yikes!) that if the signal handler is >>> invoked it will really be a circular_raw_ostream since the handler >>> should (!) only be set up in debug mode. >>> >>> That scares me a bit, though. >>>
2009 Dec 21
2
[LLVMdev] [PATCH] Implement dbgs()
...+ // know that debug mode is enabled and dbgs() really is a + // circular_raw_ostream. If NDEBUG is defined, then dbgs() == + // errs() but this will never be invoked. + llvm::circular_raw_ostream *dbgout = + static_cast<llvm::circular_raw_ostream *>(&llvm::dbgs()); + dbgout->flushBufferWithBanner(); +} + // isCurrentDebugType - Return true if the specified string is the debug type // specified on the command line, or if none was specified on the command line // with the -debug-only=X option. @@ -66,9 +91,38 @@ CurrentDebugType = Type; } +/// DisableDebugBuffering - Turn off sign...
2009 Dec 19
3
[LLVMdev] [PATCH] Implement dbgs()
On Friday 18 December 2009 19:56, Chris Lattner wrote: > > +// -debug-buffer-size - This is a command line op0tion to set the > > size > > +// of the debug stream circular buffer. The value is the number of > > +// characters to save. > > +static cl::opt<unsigned> > > +DebugBufferSize("debug-buffer-size", > > +