summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core
Commit message (Collapse)AuthorAgeFilesLines
...
* Use llvm::ArrayRef rather than std::vector/std::initializer lists for someLang Hames2017-04-261-30/+4
| | | | | | | | | | | ValueObject methods. Using ArrayRef allows us to remove some overloads, work with more array-like types, and avoid some std::vector temporaries. https://reviews.llvm.org/D32518 llvm-svn: 301441
* Changed a use of APInt::getSignBit to APInt::getSignMask.Sean Callanan2017-04-201-1/+1
| | | | llvm-svn: 300862
* Recompute ArchSpec core after MergeFromPavel Labath2017-04-201-14/+18
| | | | | | | | | | | | | | | | | | Summary: MergeFrom was updating the architecture if the target triple did not have it set. However, it was leaving the core field as invalid. This resulted in assertion failures in core file tests as a missing core meant we were unable to compute the address byte size properly. Add a unit test for the new behaviour. Reviewers: jingham, clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D32221 llvm-svn: 300836
* Teach SBFrame how to guess its language.Jim Ingham2017-04-121-0/+8
| | | | | | <rdar://problem/31411646> llvm-svn: 300012
* iwyu fixes for lldbCore.Zachary Turner2017-04-0651-510/+862
| | | | | | | | | | | | | | This adjusts header file includes for headers and source files in Core. In doing so, one dependency cycle is eliminated because all the includes from Core to that project were dead includes anyway. In places where some files in other projects were only compiling due to a transitive include from another header, fixups have been made so that those files also include the header they need. Tested on Windows and Linux, and plan to address failures on OSX and FreeBSD after watching the bots. llvm-svn: 299714
* Stop calling ValueObject::SetName from synthetic child providersTamas Berghammer2017-03-311-0/+4
| | | | | | | | | | | | | | | Summary: Calling ValueObject::SetName from a sythetic child provider would change the underying value object used for the non-synthetic child as well what is clearly unintentional. Reviewers: jingham, labath Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D31371 llvm-svn: 299259
* Add support for sythetic operator dereferenceTamas Berghammer2017-03-311-0/+5
| | | | | | | | | | | | | | | | Summary: After this change a sythetic child provider can generate a special child named "$$dereference$$" what if present is used when "operator*" or "operator->" used on a ValueObject. The goal of the change is to make expressions like "up->foo" work inside the "frame variable" command. Reviewers: labath, jingham Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D31368 llvm-svn: 299251
* [LLDB][MIPS] Core Dump Support.Nitesh Jain2017-03-311-1/+1
| | | | | | | | | | Reviewers: labath, emaste Subscribers: jaydeep, bhushan, lldb-commits, slthakur Differential Revision: https://reviews.llvm.org/D30457 llvm-svn: 299200
* [LLDB][MIPS] Check if memory_info.GetName() is empty before finding ↵Nitesh Jain2017-03-311-1/+2
| | | | | | | | | | | | corresponding module. Reviewers: labath, clayborg Subscribers: jaydeep, bhushan, lldb-commits, slthakur Differential Revision: https://reviews.llvm.org/D30454 llvm-svn: 299196
* Delete some more dead includes.Zachary Turner2017-03-222-3/+0
| | | | | | | This breaks the cycle between Target and PluginLanguageC++, reducing the overall cycle count from 43 to 42. llvm-svn: 298561
* Move FileSpec from Host -> Utility.Zachary Turner2017-03-223-3/+3
| | | | llvm-svn: 298536
* Move StringList from Core -> Utility.Zachary Turner2017-03-213-269/+1
| | | | llvm-svn: 298412
* Add NetBSD case in Entry::Type::ThreadIDKamil Rytarowski2017-03-211-1/+2
| | | | | | | | | | | | | | | | | | | | | Summary: NetBSD native threads are printed as 64-bit unsigned integers. The underlying system type of a thread identity is lwpid_t of type int32_t. For consistency with Linux and FreeBSD share the 64-bit unsigned integer type. Sponsored by <The NetBSD Foundation> Reviewers: labath, kettenis, joerg, emaste Reviewed By: labath, emaste Subscribers: #lldb Tags: #lldb Differential Revision: https://reviews.llvm.org/D31132 llvm-svn: 298405
* FindTypes should find "struct TypeName" as well as "TypeName".Jim Ingham2017-03-211-1/+1
| | | | | | | | | | This fixes a bug introduced by r291559. The Module's FindType was passing the original name not the basename in the case where it didn't find any separators. I also added a testcase for this. <rdar://problem/31159173> llvm-svn: 298331
* Fix some signed/unsigned comparison warnings.Zachary Turner2017-03-171-4/+4
| | | | | | | Patch by Hugh Bellamy Differential Revision: https://reviews.llvm.org/D30926 llvm-svn: 298099
* Remove lldb streams from the Log class completelyPavel Labath2017-03-151-2/+2
| | | | | | | | | | | | | | | | | | | | | Summary: previously we switched to llvm streams for log output, this completes the switch for the error streams. I also clean up the includes and remove the unused argument from DisableAllLogChannels(). This required adding a bit of boiler plate to convert the output in the command interpreter, but that should go away when we switch command results to use llvm streams as well. Reviewers: zturner, eugene Subscribers: lldb-commits, emaste Differential Revision: https://reviews.llvm.org/D30894 llvm-svn: 297812
* cmake: Increase LINK_INTERFACE_MULTIPLICITY of lldbCorePavel Labath2017-03-091-1/+1
| | | | | | | | | | | | This is necessary to get debug builds of unit tests working on linux. I think we are at a point where removing dependencies does not prevent us from depending on the whole world yet. What it does do though, is make the dependency chains longer as the dependency graph gets sparser, which means we need to repeat the libraries more times to get the thing to link. llvm-svn: 297369
* Resubmit FileSystem changes.Zachary Turner2017-03-085-42/+36
| | | | | | | | | | This was originall reverted due to some test failures in ModuleCache and TestCompDirSymlink. These issues have all been resolved and the code now passes all tests. Differential Revision: https://reviews.llvm.org/D30698 llvm-svn: 297300
* Revert "Use LLVM for all stat-related functionality."Pavel Labath2017-03-075-36/+42
| | | | | | | | | | | | | | | this reverts r297116 because it breaks the unittests and TestCompDirSymlink. The ModuleCache unit test is trivially fixable, but the CompDirSymlink failure is a symptom of a deeper problem: llvm's stat functionality is not a drop-in replacement for lldb's. The former is based on stat(2) (which does symlink resolution), while the latter is based on lstat(2) (which does not). This also reverts subsequent build fixes (r297128, r297120, 297117) and r297119 (Remove FileSpec dependency on FileSystem) which builds on top of this. llvm-svn: 297139
* Use LLVM for all stat-related functionality.Zachary Turner2017-03-075-42/+36
| | | | | | | | | | This deletes LLDB's FileType enumeration and replaces all users, and all calls to functions that check whether a file exists etc with corresponding calls to LLVM. Differential Revision: https://reviews.llvm.org/D30624 llvm-svn: 297116
* Remove FileSpec::ReadFileContents.Zachary Turner2017-03-061-2/+3
| | | | | | | | | | | | | | | | This functionality is subsumed by DataBufferLLVM, which is also more efficient since it will try to mmap. However, we don't yet support mmaping writable private sections, and in some cases we were using ReadFileContents and then modifying the buffer. To address that I've added a flag to the DataBufferLLVM methods that allow you to map privately, which disables the mmaping path entirely. Eventually we should teach DataBufferLLVM to use mmap with writable private, but that is orthogonal to this effort. Differential Revision: https://reviews.llvm.org/D30622 llvm-svn: 297095
* Move many other files from Core -> Utility.Zachary Turner2017-03-0611-2635/+7
| | | | llvm-svn: 297043
* Move DataBuffer / DataExtractor and friends from Core -> Utility.Zachary Turner2017-03-0419-1699/+18
| | | | llvm-svn: 296943
* Move UUID from Core -> Utility.Zachary Turner2017-03-043-226/+1
| | | | llvm-svn: 296941
* Fix DataExtractor failures.Zachary Turner2017-03-031-0/+14
| | | | | | | Some code that doesn't get compiled on Windows had some references that needed updating, and I missed those. llvm-svn: 296930
* Isolate Target-specific functionality of DataExtractor.Zachary Turner2017-03-036-933/+821
| | | | | | | | | | | | | | | | In an effort to move the various DataBuffer / DataExtractor classes from Core -> Utility, we have to separate the low-level functionality from the higher level functionality. Only a few functions required anything other than reading/writing raw bytes, so those functions are separated out into a more appropriate area. Specifically, Dump() and DumpHexBytes() are moved into free functions in Core/DumpDataExtractor.cpp, and GetGNUEHPointer is moved into a static function in the only file that it's referenced from. Differential Revision: https://reviews.llvm.org/D30560 llvm-svn: 296910
* Move Log from Core -> Utility.Zachary Turner2017-03-0320-458/+18
| | | | | | | | | All references to Host and Core have been removed, so this class can now safely be lowered into Utility. Differential Revision: https://reviews.llvm.org/D30559 llvm-svn: 296909
* Made GetClangTargetCPU() const.Pavel Labath2017-03-031-1/+1
| | | | | | | | | | | | | | | | | | Summary: It does not change members or call non-const members. HostInfo::GetArchitecture() returns a const object ref (maybe others?), which can't access the non-const function. Reviewers: labath, eugene Reviewed By: labath, eugene Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D30515 Author: Jason Majors <jmajors@google.com> llvm-svn: 296868
* Remove some dead code in FileSpec.Zachary Turner2017-03-031-4/+0
| | | | | | | | This in turn triggered some fallout where other files had been transitively picking up includes that they needed from FileSpec.h, so I've fixed those up as well. llvm-svn: 296855
* Modernize Enable/DisableLogChannel interface a bitPavel Labath2017-03-012-21/+22
| | | | | | | | | | | | | | Summary: Use StringRef and ArrayRef where possible. This adds an accessor to the Args class to get a view of the arguments as ArrayRef<const char *>. Reviewers: zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D30402 llvm-svn: 296592
* clang-format the Mangled changes.Zachary Turner2017-02-281-12/+14
| | | | llvm-svn: 296517
* Wrap the call to UndecorateSymbolName in a mutex.Zachary Turner2017-02-281-11/+19
| | | | | | | MSDN documents that this function is not thread-safe, so we wrap it in a global mutex. llvm-svn: 296516
* Fix a bug in r294611 w.r.t. Darwin Kernel debugging.Jim Ingham2017-02-281-0/+7
| | | | | | <rdar://problem/30735021> llvm-svn: 296504
* Remove the callback-based log channel registration mechanismPavel Labath2017-02-271-63/+1
| | | | | | | All the existing channels have beens switched to the new mechanism and this code is now unused. llvm-svn: 296333
* Log: Fix a regression in handling log optionsPavel Labath2017-02-271-2/+4
| | | | | | | | The channel refactor introduced a regression where we were not honoring the log options passed when enabling the channel. Fix that and add a test. llvm-svn: 296329
* Delete DataBufferMemoryMap.Zachary Turner2017-02-243-300/+59
| | | | | | | | | | | | | | | After a series of patches on the LLVM side to get the mmaping code up to compatibility with LLDB's needs, it is now ready to go, which means LLDB's custom mmapping code is redundant. So this patch deletes it all and uses LLVM's code instead. In the future, we could take this one step further and delete even the lldb DataBuffer base class and rely entirely on LLVM's facilities, but this is a job for another day. Differential Revision: https://reviews.llvm.org/D30054 llvm-svn: 296159
* Switch "lldb" log channel to the new registration mechanismPavel Labath2017-02-222-283/+42
| | | | llvm-svn: 295823
* Log: Fix race in accessing the stream variablePavel Labath2017-02-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The code was attempting to copy the shared pointer member in order to guarantee atomicity, but this is not enough. Instead, protect the pointer with a proper read-write mutex. This bug was present here for a long time, but my recent refactors must have altered the timings slightly, such that now this fails fairly often when running the tests: the test runner runs the "log disable" command just as the thread monitoring the lldb-server child is about to report that the server has exited. I add a test case for this. It's not possible to reproduce the race deterministically in normal circumstances, but I have verified that before the fix, the test failed when run under tsan, and was running fine afterwards. Reviewers: clayborg, zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D30168 llvm-svn: 295712
* Fix a couple of corner cases in NameMatchesPavel Labath2017-02-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: I originally set out to move the NameMatches closer to the relevant function and add some unit tests. However, in the process I've found a couple of bugs in the implementation: - the early exits where not always correct: - (test==pattern) does not mean the match will always suceed because of regular expressions - pattern.empty() does not mean the match will fail because the "" is a valid prefix of any string So I cleaned up those and added some tests. The only tricky part here was that regcomp() implementation on darwin did not recognise the empty string as a regular expression and returned an REG_EMPTY error instead. The simples fix here seemed to be to replace the empty expression with an equivalent non-empty one. Reviewers: clayborg, zturner Subscribers: mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D30094 llvm-svn: 295651
* Reapply "Refactor log channel registration mechanism"Pavel Labath2017-02-172-178/+126
| | | | | | | | | Changes wrt. previous version: - add #include <atomic>: fix build on windows - add extra {} around the string literals used to initialize llvm::StringLiteral: fix gcc build llvm-svn: 295442
* Revert "Refactor log channel registration mechanism"Pavel Labath2017-02-152-126/+178
| | | | | | | The change breaks on Windows and NetBSD bots. Revert while I investigate. llvm-svn: 295201
* Refactor log channel registration mechanismPavel Labath2017-02-152-178/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: We currently have two log channel registration mechanisms. One uses a set of function pointers and the other one is based on the PluginManager. The PluginManager dependency is unfortunate, as logging is also used in lldb-server, and the PluginManager pulls in a lot of classes which are not used in lldb-server. Both approach have the problem that they leave too much to do for the user, and so the individual log channels end up reimplementing command line argument parsing, category listing, etc. Here, I replace the PluginManager-based approach with a one. The new API is more declarative, so the user only needs to specify the list of list of channels, their descriptions, etc., and all the common tasks like enabling/disabling categories are hadled by common code. I migrate the LogChannelDWARF (only user of the PluginManager method) to the new API. In the follow-up commits I'll replace the other channels with something similar. Reviewers: clayborg, zturner, beanz Subscribers: aprantl, lldb-commits Differential Revision: https://reviews.llvm.org/D29895 llvm-svn: 295190
* Fix debug build of unit testsPavel Labath2017-02-151-0/+3
| | | | | | | | | | | | | | | | | | Summary: It turns out listing each library twice is not enough to resolve all references in a debug build on linux - a number of executables fails to link with random symbols missing. Increasing the number to three seems to be enough. The choice of lldbCore to set the multiplicity on is somewhat arbitrary, but it seems fitting, as it is the biggest layering transgressor. Reviewers: beanz Subscribers: mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D29888 llvm-svn: 295189
* Remove dependencies from Utility to Core and Target.Zachary Turner2017-02-148-8/+8
| | | | | | | | | | With this patch, the only dependency left is from Utility to Host. After this is broken, Utility will finally be standalone. Differential Revision: https://reviews.llvm.org/D29909 llvm-svn: 295088
* FindFunctions now works again with mangled names.Greg Clayton2017-02-131-20/+29
| | | | | | <rdar://problem/28147057> llvm-svn: 294990
* Clean up debug loggingPavel Labath2017-02-132-23/+1
| | | | | | | | | | | | | | | | | | | | | Summary: We've had two ways to print a "debug" log message. - Log::GetDebug() was testing a Stream flag which was never set. - Log::Debug() was checking for the presence of "log enable --debug" flag. Given that these two were used very rarely and we already have a different way to specify "I want a more verbose log", I propose to remove these two functions and migrate the callers to LLDB_LOGV. This commit does that. Reviewers: clayborg, zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D29823 llvm-svn: 294939
* Add a format_provider for the Timeout classPavel Labath2017-02-102-11/+6
| | | | | | | | | | and use it in the appropriate log statements. Formatting of chrono types in log messages was very clunky. This should make it much nicer to use and give better output. For details of the formatting options see the chrono formatter in llvm. llvm-svn: 294738
* Convert Log class to llvm streamsPavel Labath2017-02-104-56/+40
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This converts LLDB's logging to use llvm streams instead of lldb_private::Stream and friends. The changes are mostly straight-forward and amount to s/lldb_private::Stream/llvm::raw_ostream. The part worth calling out is the rewrite of the StreamCallback class. Previously this class contained a per-thread buffer of data written. I assume this had something to do with it trying to make sure each log line is delivered as a single event, instead of multiple (possibly interleaved) events. However, this is no longer relevant as the Log class already writes things to a temporary buffer and then delivers the message as a single "write", so I have just removed the code in question. Reviewers: zturner, clayborg Subscribers: emaste, lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D29615 llvm-svn: 294736
* Get rid of Error::PutToLog().Zachary Turner2017-02-061-8/+6
| | | | | | | | | | | | | Instead just rely on LLDB_LOG(). This is part of an effort to sort out dependency hell in LLDB. Error is in Utility, but Log is in Core. Core can depend on Utility, but not vice versa. So this patch moves the knowledge about how to log Errors from the Error class to the Log file. Differential Revision: https://reviews.llvm.org/D29514 llvm-svn: 294210
* Switch std::call_once to llvm::call_onceKamil Rytarowski2017-02-062-3/+6
| | | | | | | | | | | | | | | | | | | | | Summary: The std::call_once implementation in libstdc++ has problems on few systems: NetBSD, OpenBSD and Linux PPC. LLVM ships with a homegrown implementation llvm::call_once to help on these platforms. This change is required in the NetBSD LLDB port. std::call_once with libstdc++ results with crashing the debugger. Sponsored by <The NetBSD Foundation> Reviewers: labath, joerg, emaste, mehdi_amini, clayborg Reviewed By: labath, clayborg Subscribers: #lldb Tags: #lldb Differential Revision: https://reviews.llvm.org/D29288 llvm-svn: 294202
OpenPOWER on IntegriCloud