summaryrefslogtreecommitdiffstats
path: root/lldb/source/lldb-log.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Make sure to #include <atomic> when using std::atomic.Zachary Turner2014-09-191-0/+1
| | | | llvm-svn: 218148
* use std::atomic<> to protect variables being accessed by multiple threadsTodd Fiala2014-09-151-1/+1
| | | | | | | | | | There are several places where multiple threads are accessing the same variables simultaneously without any kind of protection. I propose using std::atomic<> to make it safer. I did a special build of lldb, using the google tool 'thread sanitizer' which identified many cases of multiple threads accessing the same memory. std::atomic is low overhead and does not use any locks for simple types such as int/bool. See http://reviews.llvm.org/D5302 for more details. Change by Shawn Best. llvm-svn: 217818
* Fix typos.Bruce Mitchener2014-07-011-1/+1
| | | | llvm-svn: 212132
* Put "jit" in alpha order in log category listEd Maste2014-03-051-2/+2
| | | | llvm-svn: 202976
* Add support for JIT debugging on Linux using the GDB JIT interface. Patch ↵Andrew MacPherson2014-03-051-1/+4
| | | | | | written with Keno Fischer. llvm-svn: 202956
* Fixed deadlocks that could occur when using python for breakpoints, ↵Greg Clayton2014-02-131-0/+3
| | | | | | | | | operating system plugins, and other async python usage. <rdar://problem/16054348> <rdar://problem/16040833> llvm-svn: 201372
* Change the Mac OS X SystemRuntime plugin from using the placeholderJason Molenda2014-02-051-0/+3
| | | | | | | | | | | | | | libldi library to collect extended backtrace information; switch to the libBacktraceRecording library and its APIs. Complete the work of adding QueueItems to Queues and allow for the QueueItems to be interrogated about their extended backtraces in turn. There's still cleanup and documentation to do on this code but the code is functional and I it's a good time to get the work-in-progress checked in. <rdar://problem/15314027> llvm-svn: 200822
* The output of 'log list' was missing a few of the lldb channels:Jason Molenda2013-09-121-14/+19
| | | | | | | | communication, connection, host, module, mmap, os. Add those. Also sort the entries so they come in alphabetical order, to make it a little easier to scan down the list for a specific channel. llvm-svn: 190570
* merge lldb-platform-work branch (and assorted fixes) into trunkDaniel Malea2013-08-261-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This merge brings in the improved 'platform' command that knows how to interface with remote machines; that is, query OS/kernel information, push and pull files, run shell commands, etc... and implementation for the new communication packets that back that interface, at least on Darwin based operating systems via the POSIXPlatform class. Linux support is coming soon. Verified the test suite runs cleanly on Linux (x86_64), build OK on Mac OS X Mountain Lion. Additional improvements (not in the source SVN branch 'lldb-platform-work'): - cmake build scripts for lldb-platform - cleanup test suite - documentation stub for qPlatform_RunCommand - use log class instead of printf() directly - reverted work-in-progress-looking changes from test/types/TestAbstract.py that work towards running the test suite remotely. - add new logging category 'platform' Reviewers: Matt Kopec, Greg Clayton Review: http://llvm-reviews.chandlerc.com/D1493 llvm-svn: 189295
* Don't compare 4 characters on a 2 character string.Greg Clayton2013-05-221-2/+2
| | | | llvm-svn: 182540
* Added a new "lldb" log channel named "os" for the OperatingSystem plug-ins ↵Greg Clayton2013-05-221-0/+2
| | | | | | | | to use. Added logging for the OS plug-in python objects in OperatingSystemPython so we can see the python dictionary returned from the plug-in when logging is enabled. llvm-svn: 182530
* Fixing lldb log list text for commands categoryAndrew Kaylor2013-04-261-1/+1
| | | | llvm-svn: 180612
* <rdar://problem/13521159>Greg Clayton2013-03-271-27/+32
| | | | | | | | 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
* <rdar://problem/13159777> Greg Clayton2013-02-061-0/+2
| | | | | | | | | | | | | | lldb was mmap'ing archive files once per .o file it loads, now it correctly shares the archive between modules. LLDB was also always mapping entire contents of universal mach-o files, now it maps just the slice that is required. Added a new logging channel for "lldb" called "mmap" to help track future regressions. Modified the ObjectFile and ObjectContainer plugin interfaces to take a data offset along with the file offset and size so we can implement the correct caching and efficient reading of parts of files without mmap'ing the entire file like we used to. The current implementation still keeps entire .a files mmaped (once) and entire slices from universal files mmaped to ensure that if a client builds their binaries during a debug session we don't lose our data and get corrupt object file info and debug info. llvm-svn: 174524
* Add an LLDB_LOG_TARGET logging channel (log eanble lldb target).Jason Molenda2012-12-051-0/+3
| | | | | | | Update the Target methods which can change the target log to this channel. llvm-svn: 169342
* Added a new "module" log channel which covers module creation, deletion, and ↵Greg Clayton2012-10-081-19/+22
| | | | | | | | | | 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
* Patch from Filipe Cabecinhas.Greg Clayton2012-04-261-7/+2
| | | | llvm-svn: 155639
* Add a logging mode that takes a callback and flush'es to that callback.Jim Ingham2012-02-211-9/+7
| | | | | | Also add SB API's to set this callback, and to enable the log channels. llvm-svn: 151018
* Switching back to using std::tr1::shared_ptr. We originally switched awayGreg Clayton2012-01-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | due to RTTI worries since llvm and clang don't use RTTI, but I was able to switch back with no issues as far as I can tell. Once the RTTI issue wasn't an issue, we were looking for a way to properly track weak pointers to objects to solve some of the threading issues we have been running into which naturally led us back to std::tr1::weak_ptr. We also wanted the ability to make a shared pointer from just a pointer, which is also easily solved using the std::tr1::enable_shared_from_this class. The main reason for this move back is so we can start properly having weak references to objects. Currently a lldb_private::Thread class has a refrence to its parent lldb_private::Process. This doesn't work well when we now hand out a SBThread object that contains a shared pointer to a lldb_private::Thread as this SBThread can be held onto by external clients and if they end up using one of these objects we can easily crash. So the next task is to start adopting std::tr1::weak_ptr where ever it makes sense which we can do with lldb_private::Debugger, lldb_private::Target, lldb_private::Process, lldb_private::Thread, lldb_private::StackFrame, and many more objects now that they are no longer using intrusive ref counted pointer objects (you can't do std::tr1::weak_ptr functionality with intrusive pointers). llvm-svn: 149207
* Fixed an issue where a lexical block or inlined function might have bad debugGreg Clayton2011-09-291-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | information generated for it. Say we have a concrete function "foo" which has inlined function "a" which calls another inlined function "b": foo 1 { 2 { a () 3 { b () 4 { } } } } Sometimes we see the compiler generate an address range in the DWARF for "foo" (block 1 above) as say [0x1000-0x1100). Then the range for "a" is something like [0x1050-0x1060) (note that it is correctly scoped within the "foo" address range). And then we get "b" which is a child of "a", yet the debug info says it has a range of [0x1060-0x1080) (not contained within "a"). We now detect this issue when making our blocks and add an extra range to "a". Also added a new "lldb" logging category named "symbol" where we can find out about symbol file errors and warnings. llvm-svn: 140822
* Fixed the logging output to be done consistently across all plug-ins.Greg Clayton2011-09-121-18/+18
| | | | | | | Added a new log category for DWARF called "aranges" to log the parsing of address ranges. llvm-svn: 139489
* Include lldb/commands as a valid logging type in theJason Molenda2011-08-251-0/+1
| | | | | | | | | | | | 'log list' output. Remove an extraneous \n from one of the lldb/commands log line. Add an lldb/commands log indicating whether the command was successful or not. llvm-svn: 138530
* some editing of data visualization error messages to make them more meaningfulEnrico Granata2011-07-221-1/+4
| | | | | | | debugging printfs() for data visualization turned into a meaningful log: - introduced a new log category `types' in channel `lldb' llvm-svn: 135773
* Deleted one too many characters...Jim Ingham2011-05-071-1/+1
| | | | llvm-svn: 131041
* Make the log message & setter match for "dyld/shlib". The ↵Jim Ingham2011-05-061-1/+1
| | | | | | "ListLogCategories" output should really be auto-generated from the settings so you can't make this sort of mistake... llvm-svn: 131003
* Patch to remove uses of non-standard strcasestr and replace then withGreg Clayton2011-02-041-42/+42
| | | | | | strncasecmp equivalents from Kirk Beitz. llvm-svn: 124889
* Spelling changes applied from lldb_spelling.diffs from Bruce Mitchener.Greg Clayton2011-01-081-1/+1
| | | | | | Thanks Bruce! llvm-svn: 123083
* - Fix alias-building & resolving to properly handle optional arguments for ↵Caroline Tice2010-12-071-0/+2
| | | | | | | | | | | | | | | | | | command options. - Add logging for command resolution ('log enable lldb commands') - Fix alias resolution to properly handle commands that take raw input (resolve the alias, but don't muck up the raw arguments). Net result: Among other things, 'expr' command can now take strings with escaped characters and not have the command handling & alias resolution code muck up the escaped characters. E.g. 'expr printf ("\n\n\tHello there!")' should now work properly. Not working yet: Creating aliases with raw input for commands that take raw input. Working on that. e.g. 'command alias print_hi expr printf ("\n\tHi!")' does not work yet. llvm-svn: 121171
* Cleaned up code that wasn't using the Initialize and Terminate paradigm byGreg Clayton2010-11-181-30/+33
| | | | | | | | | | | | | | | | | | 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
* Move the embedded Python interpreter onto a separate thread, to preventCaroline Tice2010-11-101-0/+3
| | | | | | | main thread from having to wait on it (which was causing some I/O hangs). llvm-svn: 118700
* Modified all logging calls to hand out shared pointers to make sure weGreg Clayton2010-11-061-32/+28
| | | | | | | | | | | don't crash if we disable logging when some code already has a copy of the logger. Prior to this fix, logs were handed out as pointers and if they were held onto while a log got disabled, then it could cause a crash. Now all logs are handed out as shared pointers so this problem shouldn't happen anymore. We are also using our new shared pointers that put the shared pointer count and the object into the same allocation for a tad better performance. llvm-svn: 118319
* Don't need both LIBLLDB_LOG_DYNAMIC_LOADER and LIBLLDB_LOG_SHLIB. Go with ↵Jim Ingham2010-11-051-2/+0
| | | | | | the former. llvm-svn: 118283
* Fixed shared library unloads when the unloaded library doesn't come offGreg Clayton2010-11-031-0/+2
| | | | | | | | | | | | | | | | | | | the end of the list. We had an issue in the MacOSX dynamic loader where if we had shlibs: 1 - a.out 2 - a.dylib 3 - b.dylib And then a.dylib got unloaded, we would unload b.dylib due to the assumption that only shared libraries could come off the end of the list. We now properly search and find which ones get loaded. Added a new internal logging category for the "lldb" log channel named "dyld". This should allow all dynamic loaders to use this as a generic log channel so we can track shared library loads and unloads in the logs without having to have each plug-in make up its own logging channel. llvm-svn: 118147
* Add the ability to disable individual log categories, ratherCaroline Tice2010-10-291-3/+46
| | | | | | | | | 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-6/+6
| | | | | | | | | | | | | | | | | 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
* First pass at adding logging capabilities for the API functions. At the momentCaroline Tice2010-10-261-0/+2
| | | | | | | | | | | | | | | | | | it logs the function calls, their arguments and the return values. This is not complete or polished, but I am committing it now, at the request of someone who really wants to use it, even though it's not really done. It currently does not attempt to log all the functions, just the most important ones. I will be making further adjustments to the API logging code over the next few days/weeks. (Suggestions for improvements are welcome). Update the Python build scripts to re-build the swig C++ file whenever the python-extensions.swig file is modified. Correct the help for 'log enable' command (give it the correct number & type of arguments). llvm-svn: 117349
* Check in the native lldb unwinder. Jason Molenda2010-10-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Not yet enabled as the default unwinder but there are no known backtrace problems with the code at this point. Added 'log enable lldb unwind' to help diagnose backtrace problems; this output needs a little refining but it's a good first step. eh_frame information is currently read unconditionally - the code is structured to allow this to be delayed until it's actually needed. There is a performance hit when you have to parse the eh_frame information for any largeish executable/library so it's necessary to avoid if possible. It's confusing having both the UnwindPlan::RegisterLocation struct and the RegisterConextLLDB::RegisterLocation struct, I need to rename one of them. The writing of registers isn't done in the RegisterConextLLDB subclass yet; neither is the running of complex DWARF expressions from eh_frame (e.g. used for _sigtramp on Mac OS X). llvm-svn: 117256
* Add a "lldb host" logging channel, and put logging in the ↵Jim Ingham2010-08-311-0/+1
| | | | | | Host::OpenInExternalEditor code. llvm-svn: 112614
* Move Args.{cpp,h} and Options.{cpp,h} to Interpreter where they really belong.Jim Ingham2010-06-151-1/+1
| | | | llvm-svn: 106034
* Add missing include.Eli Friedman2010-06-101-1/+1
| | | | llvm-svn: 105781
* Initial checkin of lldb code from internal Apple repo.Chris Lattner2010-06-081-0/+190
llvm-svn: 105619
OpenPOWER on IntegriCloud