similar to: [LLVMdev] [PATCH] Implement dbgs()

Displaying 20 results from an estimated 1000 matches similar to: "[LLVMdev] [PATCH] Implement dbgs()"

2009 Dec 19
0
[LLVMdev] [PATCH] Implement dbgs()
On Dec 17, 2009, at 4:02 PM, David Greene wrote: > Here's the patch to provide dbgs(). By default it works just like > errs(). > When -debug-buffer-size=N (N > 0) is set, it buffers output sent to > it and > dumps it at program termination via a signal handler. > > Please review. Thanks! > > -Dave > > Index:
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", > > +
2009 Dec 21
2
[LLVMdev] [PATCH] Implement dbgs()
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. > > Why don't you just check #ifndef NDEBUG like the code that sets it up?
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()
On Monday 21 December 2009 10:14, Török Edwin wrote: > 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. >
2009 Dec 21
0
[LLVMdev] [PATCH] Implement dbgs()
On Dec 21, 2009, at 8:42 AM, David Greene wrote: > On Monday 21 December 2009 10:14, Török Edwin wrote: >> 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
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 18
4
[LLVMdev] [PATCH] Circular Buffered Debug Stream
On Friday 18 December 2009 12:28, Chris Lattner wrote: > This is looking a lot better, here are some more comments: > > + /// current_pos - Return the current position within the stream, > > + /// not counting the bytes currently in the buffer. > > + virtual uint64_t current_pos() { > > I didn't notice this earlier, but is there any reason for current_pos
2009 Dec 19
0
[LLVMdev] [PATCH] Circular Buffered Debug Stream
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 with a buffer of zero." When it is buffering, what causes it to flush? Your
2009 Dec 21
3
[LLVMdev] [PATCH] Circular Buffered Debug Stream
On Dec 21, 2009, at 8:05 AM, David Greene wrote: > On Friday 18 December 2009 20:20, David Greene wrote: > >> I wanted something to signify in the output where the debug dump starts. >> That's for that case where some stuff might still get output through >> errs(). I anticipate that while I'll change most uses of errs() to dbgs(), >> we probably don't
2009 Dec 21
0
[LLVMdev] [PATCH] Circular Buffered Debug Stream
On Friday 18 December 2009 20:20, David Greene wrote: > I wanted something to signify in the output where the debug dump starts. > That's for that case where some stuff might still get output through > errs(). I anticipate that while I'll change most uses of errs() to dbgs(), > we probably don't want to change all of them. > > I agree the naming here is poor.
2009 Dec 18
2
[LLVMdev] [PATCH] Circular Buffered Debug Stream
On Friday 18 December 2009 17:27, David Greene wrote: > > Here's the updated patch. > > Well, that didn't go through right. Here it is again. Argh! Stupid bug fixed. :) Index: include/llvm/Support/circular_raw_ostream.h =================================================================== --- include/llvm/Support/circular_raw_ostream.h (revision 0) +++
2009 Dec 17
2
[LLVMdev] [PATCH] Circular Buffered Debug Stream
On Wednesday 16 December 2009 13:35, David Greene wrote: > > Please make BufferSize an 'unsigned' and default it to 8192. Please use > > PRESERVE_STREAM instead of 'false'. Here's an updated version of the circular buffer. Ok to check in? -Dave Index: include/llvm/Support/circular_raw_ostream.h
2009 Dec 18
0
[LLVMdev] [PATCH] Circular Buffered Debug Stream
On Dec 17, 2009, at 3:41 PM, David Greene wrote: > On Wednesday 16 December 2009 13:35, David Greene wrote: > >>> Please make BufferSize an 'unsigned' and default it to 8192. Please use >>> PRESERVE_STREAM instead of 'false'. > > Here's an updated version of the circular buffer. Ok to check in? This is looking a lot better, here are some more
2009 Dec 16
2
[LLVMdev] [PATCH] Circular Buffered Debug Stream
On Dec 16, 2009, at 8:12 AM, David Greene wrote: >>> >>> What, specifically, do you want reviewed before I start checking in? >>> I'll be happy to prepare a patch that shows just that. >> >> I want a patch that does one thing (e.g. implements dbgs(), > > Ok, let's start with that. Here's the patch to add the circular raw_ostream. This
2009 Dec 21
0
[LLVMdev] [PATCH] Circular Buffered Debug Stream
On Monday 21 December 2009 13:40, Chris Lattner wrote: > >> Now that I understand the model :) I don't see why you need to fiddle > >> with the underlying buffering of TheStream. In the dbgs() use case, > >> the underlying stream will be errs() which is already unbuffered. > > > > Might circular_raw_ostream be used with other streams at some point? >
2017 Feb 23
4
llvm-lit: 2>&1 and FileCheck
Hi all, quite a few tests use the pattern "2>&1 | FileCheck %s". AFAIK how stdout and stderr are merged into a single character stream is undefined and depends e.g. on whether stdout is buffered. I think we are often saved by the fact that standard output is written only at the end of the program and stderr is unbuffered, i.e. always written before stdout. A lot of tests disable
2009 Dec 18
2
[LLVMdev] [PATCH] dbgs() Use
Here's an example patch of how dbgs() will be used. Essentially I will replace uses of errs() with dbgs(). I believe this is the correct thing to do because: - With #define NDEBUG, dbgs() == errs() - With debugging and -debug-buffer-size=0 (the default), dbgs() just passes output to errs(). - When -debug-buffer-size>0, you want to buffer ALL output so that you don't get some
2009 Dec 18
0
[LLVMdev] [PATCH] Circular Buffered Debug Stream
On Friday 18 December 2009 17:22, David Greene wrote: > On Friday 18 December 2009 13:56, David Greene wrote: > > On Friday 18 December 2009 13:53, David Greene wrote: > > > > > + void releaseStream() { > > > > > + // Delete the stream if needed. Otherwise, transfer the > > > > > buffer + // settings from this raw_ostream back to