search for: debug_user_sig_handl

Displaying 7 results from an estimated 7 matches for "debug_user_sig_handl".

Did you mean: debug_user_sig_handler
2009 Dec 19
3
[LLVMdev] [PATCH] Implement dbgs()
...ve last N characters of debug > > output " > > How about "Buffer the last N characters of debug output until program > termination". This should probably also be cl::Hidden. Ok. > > +// 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 trying to eliminate the last > RTTI use in the compiler. Do you want me to use d...
2009 Dec 18
2
[LLVMdev] [PATCH] Implement dbgs()
...static struct DebugOnlyOpt { void operator=(const std::string &Val) const { @@ -50,6 +62,16 @@ cl::Hidden, cl::value_desc("debug string"), cl::location(DebugOnlyOptLoc), cl::ValueRequired); +// 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()); + if (logout) { + logout->dumpLog(); + } +} + // isCurrentDebugType - Return true if the specified string is the debug type // specified on the command line...
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 trying to eliminate the last >> RTTI use in the compiler. &g...
2009 Dec 21
2
[LLVMdev] [PATCH] Implement dbgs()
...static struct DebugOnlyOpt { void operator=(const std::string &Val) const { @@ -50,6 +63,18 @@ cl::Hidden, cl::value_desc("debug string"), cl::location(DebugOnlyOptLoc), cl::ValueRequired); +// Signal handlers - dump debug output on termination. +static void debug_user_sig_handler(void *Cookie) +{ + // This is a bit sneaky. Since this is under #ifndef NDEBUG, we + // 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 =...
2009 Dec 19
0
[LLVMdev] [PATCH] Implement dbgs()
...llvm::cl::desc("Save last N characters of debug > output " How about "Buffer the last N characters of debug output until program termination". This should probably also be cl::Hidden. > +// 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 trying to eliminate the last RTTI use in the compiler. > +/// dbgs - Return a circular-buffered debug...
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()
...static struct DebugOnlyOpt { void operator=(const std::string &Val) const { @@ -50,6 +63,18 @@ cl::Hidden, cl::value_desc("debug string"), cl::location(DebugOnlyOptLoc), cl::ValueRequired); +// Signal handlers - dump debug output on termination. +static void debug_user_sig_handler(void *Cookie) +{ + // This is a bit sneaky. Since this is under #ifndef NDEBUG, we + // 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 =...