summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Log.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix Clang-tidy modernize-use-nullptr warnings in some files in source/Core; ↵Eugene Zelenko2016-03-101-33/+16
| | | | | | other minor fixes. llvm-svn: 263174
* Fixup log enable --stack so it works on Linux.Todd Fiala2015-10-101-0/+1
| | | | | | | | The underlying raw_string_stream buffer was not being flushed after asking llvm to collect the backtrace. This worked fine on OS X but was failing to print anything on Linux. llvm-svn: 249930
* [LLGS] Avoid misrepresenting log lines as inferior outputPavel Labath2015-08-181-1/+1
| | | | | | | | | | | | | | | | Summary: in case we are logging to stdout, any log lines from the forked child can be misconstrued to be inferior output. To avoid this, we disable all logging immediately after forking. I also fix the implementatoion of DisableAllLogChannels, which was a no-op before this commit. Reviewers: clayborg, ovyalov Subscribers: dean, lldb-commits Differential Revision: http://reviews.llvm.org/D12083 llvm-svn: 245272
* Make sure we print timestamps correctly to 9 places since we are printing ↵Greg Clayton2015-05-271-1/+1
| | | | | | | | nanoseconds. <rdar://problem/21090231> llvm-svn: 238334
* Make log options uniform betwwen lldb-platform and lldb-gdbserverTamas Berghammer2015-05-271-0/+34
| | | | | | | | | | This change also get rid of an unused Debugger instance in GDBRemoteCommunicationServerLLGS and the command interpreter from lldb-platform what was used only for enabling logging. Differential revision: http://reviews.llvm.org/D9876 llvm-svn: 238319
* Enable thread-safe logging.Zachary Turner2015-05-081-8/+16
| | | | | | | | | | | | | Thread-safe logging had been disabled because of a deadlock, possibly due to a lock acquired during a signal handler. This patch turns thread safe logging back on and also greatly reduces the scope of the lock, confining it only to the code that affects the underlying output stream, instead of all the code that builds up the formatted log message. this should resolve the issue surrounding the deadlock. llvm-svn: 236892
* Add logging to ProcessWindows.Zachary Turner2015-05-071-2/+10
| | | | llvm-svn: 236776
* Fix typo in Core/LogPavel Labath2015-04-301-1/+1
| | | | llvm-svn: 236222
* Fix build broken by r236174.Zachary Turner2015-04-291-4/+4
| | | | | | Apparently va_list is literally a char* on Windows. llvm-svn: 236177
* Introduce a NullLog class, which ignores all messages.Zachary Turner2015-04-291-115/+93
| | | | | | | | | | | | | | | | The purpose of this class is so that GetLogIfAllCategoriesSet can always return an instance of some class, whether it be a real logging class or a "null" class, which ignores messages. Code that is littered with if statements that only log if the pointer is non-null can get very unwieldy very quickly, so this should help code readability in such circumstances. Since I'm in this code anyway, I'm also deleting the PrintfWithFlags methods, as well as all the flags, since they appear to be dead code that have been superceded by newer mechanisms and all the flags are simply ignored. llvm-svn: 236174
* Move some functions from source/lldb.cpp to Utility.Zachary Turner2015-03-181-0/+1
| | | | | | | | | | Specifically, there were some functions for converting enums to strings and a function for matching a string using a specific matching algorithm. This moves those functions to more appropriate headers in lldb/Utility and updates references to include the new headers. llvm-svn: 232673
* Remove Host::Backtrace in favor of llvm::sys::PrintStackTrace()Zachary Turner2015-03-061-2/+9
| | | | | | | | | | | | This removes Host::Backtrace from the codebase, and changes all call sites to use llvm::sys::PrintStackTrace(). This makes the functionality available for all platforms, and even for platforms which currently had a supported implementation of Host::Backtrace, this patch should enable richer information in stack traces, such as file and line number information, as well as giving it the ability to unwind through inlined functions. llvm-svn: 231511
* minor refactoring to remove unneeded/unspecific header filesVince Harron2015-01-161-4/+0
| | | | | | Differential review: http://reviews.llvm.org/D6919 llvm-svn: 226249
* Create a HostThread abstraction.Zachary Turner2014-09-091-2/+6
| | | | | | | | | | | | | This patch moves creates a thread abstraction that represents a thread running inside the LLDB process. This is a replacement for otherwise using lldb::thread_t, and provides a platform agnostic interface to managing these threads. Differential Revision: http://reviews.llvm.org/D5198 Reviewed by: Jim Ingham llvm-svn: 217460
* Correct comment for thread name log optionEd Maste2014-05-211-1/+1
| | | | llvm-svn: 209299
* Fixed deadlocks that could occur when using python for breakpoints, ↵Greg Clayton2014-02-131-8/+17
| | | | | | | | | operating system plugins, and other async python usage. <rdar://problem/16054348> <rdar://problem/16040833> llvm-svn: 201372
* Change a printf() formatter to use %d for a uint32_t.Jason Molenda2013-09-111-1/+1
| | | | llvm-svn: 190548
* Remove <windows.h> from lldb-types.h.Virgile Bello2013-09-041-2/+2
| | | | llvm-svn: 189934
* Cleanup/rearrange includes:Virgile Bello2013-08-281-1/+0
| | | | | | | - factorize unistd.h and stdbool.h in lldb-types.h. - Add <functional> and <string> where required. llvm-svn: 189477
* MingW compilation (windows). Includes various refactoring to improve ↵Virgile Bello2013-08-231-1/+0
| | | | | | portability. llvm-svn: 189107
* <rdar://problem/13854277>Greg Clayton2013-05-101-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | <rdar://problem/13594769> Main changes in this patch include: - cleanup plug-in interface and use ConstStrings for plug-in names - Modfiied the BSD Archive plug-in to be able to pick out the correct .o file when .a files contain multiple .o files with the same name by using the timestamp - Modified SymbolFileDWARFDebugMap to properly verify the timestamp on .o files it loads to ensure we don't load updated .o files and cause problems when debugging The plug-in interface changes: Modified the lldb_private::PluginInterface class that all plug-ins inherit from: Changed: virtual const char * GetPluginName() = 0; To: virtual ConstString GetPluginName() = 0; Removed: virtual const char * GetShortPluginName() = 0; - Fixed up all plug-in to adhere to the new interface and to return lldb_private::ConstString values for the plug-in names. - Fixed all plug-ins to return simple names with no prefixes. Some plug-ins had prefixes and most ones didn't, so now they all don't have prefixed names, just simple names like "linux", "gdb-remote", etc. llvm-svn: 181631
* <rdar://problem/13521159>Greg Clayton2013-03-271-2/+2
| | | | | | | | LLDB is crashing when logging is enabled from lldb-perf-clang. This has to do with the global destructor chain as the process and its threads are being torn down. All logging channels now make one and only one instance that is kept in a global pointer which is never freed. This guarantees that logging can correctly continue as the process tears itself down. llvm-svn: 178191
* Fixed a case where the result of std::string's c_str() method was being ↵Greg Clayton2013-02-271-4/+3
| | | | | | called on a local variable and returned as a const char * incorrectly. We used to cache the thread names for threads in the current host process, but we shoudn't be caching that as the names can change over time, so now a std::string is returned from Host::GetThreadName(). llvm-svn: 176217
* Fix a few more clang (3.2) warnings on Linux:Daniel Malea2012-12-071-1/+1
| | | | | | | | | | | | | | | | | - remove unused members - add NO_PEDANTIC to selected Makefiles - fix return values (removed NULL as needed) - disable warning about four-char-constants - remove unneeded const from operator*() declaration - add missing lambda function return types - fix printf() with no format string - change sizeof to use a type name instead of variable name - fix Linux ProcessMonitor.cpp to be 32/64 bit friendly - disable warnings emitted by swig-generated C++ code Patch by Matt Kopec! llvm-svn: 169645
* Fix Linux build warnings due to redefinition of macros:Daniel Malea2012-12-051-0/+2
| | | | | | | | | - add new header lldb-python.h to be included before other system headers - short term fix (eventually python dependencies must be cleaned up) Patch by Matt Kopec! llvm-svn: 169341
* <rdar://problem/12798131> Greg Clayton2012-12-041-1/+1
| | | | | | | | | | | | Cleaned up the option parsing code to always pass around the short options as integers. Previously we cast this down to "char" and lost some information. I recently added an assert that would detect duplicate short character options which was firing during the test suite. This fix does the following: - make sure all short options are treated as "int" - make sure that short options can be non-printable values when a short option is not required or when an option group is mixed into many commands and a short option is not desired - fix the help printing to "do the right thing" in all cases. Previously if there were duplicate short character options, it would just not emit help for the duplicates - fix option parsing when there are duplicates to parse options correctly. Previously the option parsing, when done for an OptionGroup, would just start parsing options incorrectly by omitting table entries and it would end up setting the wrong option value llvm-svn: 169189
* Resolve printf formatting warnings on Linux:Daniel Malea2012-11-291-2/+2
| | | | | | | | - use macros from inttypes.h for format strings instead of OS-specific types Patch from Matt Kopec! llvm-svn: 168945
* Added a new "module" log channel which covers module creation, deletion, and ↵Greg Clayton2012-10-081-0/+3
| | | | | | | | | | common module list actions. Also added a new option for "log enable" which is "--stack" which will print out a stack backtrace for each log line. This was used to track down the leaking module issue I fixed last week. llvm-svn: 165438
* Add a logging mode that takes a callback and flush'es to that callback.Jim Ingham2012-02-211-6/+7
| | | | | | Also add SB API's to set this callback, and to enable the log channels. llvm-svn: 151018
* Process IDs (lldb::pid_t) and thread IDs (lldb::tid_t) are now 64 bit. This Greg Clayton2011-12-011-1/+1
| | | | | | | | will allow us to represent a process/thread ID using a pointer for the OS plug-ins where they might want to represent the process or thread ID using the address of the process or thread structure. llvm-svn: 145644
* Update declarations for all functions/methods that accept printf-styleJason Molenda2011-09-201-1/+1
| | | | | | | | stdarg formats to use __attribute__ format so the compiler can flag incorrect uses. Fix all incorrect uses. Most of these are innocuous, a few were resulting in crashes. llvm-svn: 140185
* Added auto completion for architecture names and for platforms.Greg Clayton2011-04-131-6/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Modified the OptionGroupOptions to be able to specify only some of the options that should be appended by using the usage_mask in the group defintions and also provided a way to remap them to a new usage mask after the copy. This allows options to be re-used and also targetted for specific option groups. Modfied the CommandArgumentType to have a new eArgTypePlatform enumeration. Taught the option parser to be able to automatically use the appropriate auto completion for a given options if nothing is explicitly specified in the option definition. So you don't have to specify it in the option definition tables. Renamed the default host platform name to "host", and the default platform hostname to be "localhost". Modified the "file" and "platform select" commands to make sure all options and args are good prior to creating a new platform. Also defer the computation of the architecture in the file command until all options are parsed and the platform has either not been specified or reset to a new value to avoid computing the arch more than once. Switch the PluginManager code over to using llvm::StringRef for string comparisons and got rid of all the AccessorXXX functions in lieu of the newer mutex + collection singleton accessors. llvm-svn: 129483
* Abtracted all mach-o and ELF out of ArchSpec. This patch is a modified formGreg Clayton2011-02-231-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of Stephen Wilson's idea (thanks for the input Stephen!). What I ended up doing was: - Got rid of ArchSpec::CPU (which was a generic CPU enumeration that mimics the contents of llvm::Triple::ArchType). We now rely upon the llvm::Triple to give us the machine type from llvm::Triple::ArchType. - There is a new ArchSpec::Core definition which further qualifies the CPU core we are dealing with into a single enumeration. If you need support for a new Core and want to debug it in LLDB, it must be added to this list. In the future we can allow for dynamic core registration, but for now it is hard coded. - The ArchSpec can now be initialized with a llvm::Triple or with a C string that represents the triple (it can just be an arch still like "i386"). - The ArchSpec can still initialize itself with a architecture type -- mach-o with cpu type and subtype, or ELF with e_machine + e_flags -- and this will then get translated into the internal llvm::Triple::ArchSpec + ArchSpec::Core. The mach-o cpu type and subtype can be accessed using the getter functions: uint32_t ArchSpec::GetMachOCPUType () const; uint32_t ArchSpec::GetMachOCPUSubType () const; But these functions are just converting out internal llvm::Triple::ArchSpec + ArchSpec::Core back into mach-o. Same goes for ELF. All code has been updated to deal with the changes. This should abstract us until later when the llvm::TargetSpec stuff gets finalized and we can then adopt it. llvm-svn: 126278
* Remove bzero use and replace with memset (patch from Kirk Beitz).Greg Clayton2011-02-041-1/+1
| | | | llvm-svn: 124897
* Make "log enable -v" work. We were only checking the log's stream's ↵Jim Ingham2011-01-221-0/+4
| | | | | | verbosity, not the log's verbosity... llvm-svn: 124013
* Cleaned up code that wasn't using the Initialize and Terminate paradigm byGreg Clayton2010-11-181-1/+14
| | | | | | | | | | | | | | | | | | changing it to use it. There was an extra parameter added to the static accessor global user settings controllers that wasn't needed. A bool was being used as a parameter to the accessor just so it could be used to clean up the global user settings controller which is now fixed by splitting up the initialization into the "static void Class::Initialize()", access into the "static UserSettingsControllerSP & Class::GetSettingsController()", and cleanup into "static void Class::Terminate()". Also added initialize and terminate calls to the logging code to avoid issues when LLDB is shutting down. There were cases after the logging was switched over to use shared pointers where we could crash if the global destructor chain was being run and it causes the log to be destroyed and any any logging occurred. llvm-svn: 119757
* Cleaned up the API logging a lot more to reduce redundant information and Greg Clayton2010-10-311-0/+1
| | | | | | | | | keep the file size a bit smaller. Exposed SBValue::GetExpressionPath() so SBValue users can get an expression path for their values. llvm-svn: 117851
* Add the ability to disable individual log categories, ratherCaroline Tice2010-10-291-4/+5
| | | | | | | | | than just the entire log channel. Add checks, where appropriate, to make sure a log channel/category has not been disabled before attempting to write to it. llvm-svn: 117715
* Updated the lldb_private::Flags class to have better method names and madeGreg Clayton2010-10-271-12/+10
| | | | | | | | | | | | | | | | | all of the calls inlined in the header file for better performance. Fixed the summary for C string types (array of chars (with any combo if modifiers), and pointers to chars) work in all cases. Fixed an issue where a forward declaration to a clang type could cause itself to resolve itself more than once if, during the resolving of the type itself it caused something to try and resolve itself again. We now remove the clang type from the forward declaration map in the DWARF parser when we start to resolve it and avoid this additional call. This should stop any duplicate members from appearing and throwing all the alignment of structs, unions and classes. llvm-svn: 117437
* Fixed the log streams for logs that output toSean Callanan2010-06-231-85/+0
| | | | | | standard output, resolving a crasher. llvm-svn: 106682
* Very large changes that were needed in order to allow multiple connectionsGreg Clayton2010-06-231-13/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to the debugger from GUI windows. Previously there was one global debugger instance that could be accessed that had its own command interpreter and current state (current target/process/thread/frame). When a GUI debugger was attached, if it opened more than one window that each had a console window, there were issues where the last one to setup the global debugger object won and got control of the debugger. To avoid this we now create instances of the lldb_private::Debugger that each has its own state: - target list for targets the debugger instance owns - current process/thread/frame - its own command interpreter - its own input, output and error file handles to avoid conflicts - its own input reader stack So now clients should call: SBDebugger::Initialize(); // (static function) SBDebugger debugger (SBDebugger::Create()); // Use which ever file handles you wish debugger.SetErrorFileHandle (stderr, false); debugger.SetOutputFileHandle (stdout, false); debugger.SetInputFileHandle (stdin, true); // main loop SBDebugger::Terminate(); // (static function) SBDebugger::Initialize() and SBDebugger::Terminate() are ref counted to ensure nothing gets destroyed too early when multiple clients might be attached. Cleaned up the command interpreter and the CommandObject and all subclasses to take more appropriate arguments. llvm-svn: 106615
* Use Host::GetCurrentThreadID() instead of mach_thread_self().Eli Friedman2010-06-111-3/+2
| | | | llvm-svn: 105811
* Initial checkin of lldb code from internal Apple repo.Chris Lattner2010-06-081-0/+590
llvm-svn: 105619
OpenPOWER on IntegriCloud