Commit Graph

81 Commits

Author SHA1 Message Date
Pavel Labath 84a6856928 SymbolVendor: Move Symtab construction into the SymbolFile
Summary:
Instead of having SymbolVendor coordinate Symtab construction between
Symbol and Object files, make the SymbolVendor function a passthrough,
and put all of the logic into the SymbolFile.

Reviewers: clayborg, JDevlieghere, jingham, espindola

Subscribers: emaste, mgorny, arichardson, MaskRay, lldb-commits

Differential Revision: https://reviews.llvm.org/D65208

llvm-svn: 367086
2019-07-26 07:03:28 +00:00
Pavel Labath d8aca8886f Make UniqueCStringMap work with non-default-constructible types and other improvements/cleanups
Summary:
The motivation for this was me wanting to make the validity of dwarf
DIERefs explicit (via llvm::Optional<DIERef>). This meant that the class
would no longer have a default constructor. As the DIERef was being
stored in a UniqueCStringMap, this meant that this container (like all
standard containers) needed to work with non-default-constructible types
too.

This part is achieved by removing the default constructors for the map
entry types, and providing appropriate comparison overloads so that we
can search for map entries without constructing a dummy entry. While
doing that, I took the opportunity to modernize the code, and add some
tests. Functions that were completely unused are deleted.

This required also some changes in the Symtab code, as it was default
constructing map entries, which was not impossible even though its
value type was default-constructible. Technically, these changes could
be avoided with some SFINAE on the entry type, but I felt that the code
is cleaner this way anyway.

Reviewers: JDevlieghere, sgraenitz

Subscribers: mgorny, aprantl, lldb-commits

Differential Revision: https://reviews.llvm.org/D63268

llvm-svn: 363357
2019-06-14 06:33:31 +00:00
Greg Clayton 8a7779209d Include inlined functions when figuring out a contiguous address range
Checking this in for Antonio Afonso:

This diff changes the function LineEntry::GetSameLineContiguousAddressRange so that it also includes function calls that were inlined at the same line of code.

My motivation is to decrease the step over time of lines that heavly rely on inlined functions. I have multiple examples in the code base I work that makes a step over stop 20 or mote times internally. This can easly had up to step overs that take >500ms which I was able to lower to 25ms with this new strategy.

The reason the current code is not extending the address range beyond an inlined function is because when we resolve the symbol at the next address of the line entry we will get the entry line corresponding to where the original code for the inline function lives, making us barely extend the range. This then will end up on a step over having to stop multiple times everytime there's an inlined function.

To check if the range is an inlined function at that line I also get the block associated with the next address and check if there is a parent block with a call site at the line we're trying to extend.

To check this I created a new function in Block called GetContainingInlinedBlockWithCallSite that does exactly that. I also added a new function to Declaration for convinence of checking file/line named CompareFileAndLine.

To avoid potential issues when extending an address range I added an Extend function that extends the range by the AddressRange given as an argument. This function returns true to indicate sucess when the rage was agumented, false otherwise (e.g.: the ranges are not connected). The reason I do is to make sure that we're not just blindly extending complete_line_range by whatever GetByteSize() we got. If for some reason the ranges are not connected or overlap, or even 0, this could be an issue.

I also added a unit tests for this change and include the instructions on the test itself on how to generate the yaml file I use for testing.


Differential Revision: https://reviews.llvm.org/D61292

llvm-svn: 360071
2019-05-06 20:01:21 +00:00
George Rimar ed3eaf477c [LLDB] - Update the test cases after yaml2obj change.
https://reviews.llvm.org/D60122 (r357595) changed the
symbols description format in yaml2obj.

This change updates the LLDB tests.

llvm-svn: 357600
2019-04-03 15:28:35 +00:00
Adrian Prantl 0e4c482124 Pass ConstString by value (NFC)
My apologies for the large patch. With the exception of ConstString.h
itself it was entirely produced by sed.

ConstString has exactly one const char * data member, so passing a
ConstString by reference is not any more efficient than copying it by
value. In both cases a single pointer is passed. But passing it by
value makes it harder to accidentally return the address of a local
object.

(This fixes rdar://problem/48640859 for the Apple folks)

Differential Revision: https://reviews.llvm.org/D59030

llvm-svn: 355553
2019-03-06 21:22:25 +00:00
Pavel Labath b8093314ef Move RangeMap.h into Utility
Summary:
This file implements some general purpose data structures, and so it
belongs to the Utility module.

Reviewers: zturner, jingham, JDevlieghere, clayborg, espindola

Subscribers: emaste, mgorny, javed.absar, arichardson, MaskRay, lldb-commits

Differential Revision: https://reviews.llvm.org/D58970

llvm-svn: 355509
2019-03-06 14:41:43 +00:00
Chandler Carruth 2946cd7010 Update the file headers across all of the LLVM projects in the monorepo
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

llvm-svn: 351636
2019-01-19 08:50:56 +00:00
Pavel Labath 0611642f3a RangeMap.h: merge RangeDataArray and RangeDataVector
Summary:
The main difference between the classes was supposed to be the fact that
one is backed by llvm::SmallVector, and the other by std::vector.
However, over the years, they have accumulated various other differences
too.

This essentially removes the std::vector version, as that is pretty much
identical to llvm::SmallVector<T, 0>, and combines their interfaces. It
does not attempt to do a more significant refactoring, even though there
is still a lot of duplication in this file, as it is hard to tell which
quirk of some API is depended on by somebody (and, a previous, more
ambitious attempt at this in D16769 has failed).

I also add some tests, including one which demonstrates one of the
quirks/bugs of the API I have noticed in the process.

Reviewers: clayborg, teemperor, tberghammer

Subscribers: mgorny, JDevlieghere, lldb-commits

Differential Revision: https://reviews.llvm.org/D56170

llvm-svn: 350380
2019-01-04 07:14:17 +00:00
Pavel Labath 181b823b04 Move Broadcaster+Listener+Event combo from Core into Utility
Summary:
These are general purpose "utility" classes, whose functionality is not
debugger-specific in any way. As such, I believe they belong in the
Utility module.

This doesn't break any particular dependency (yet), but it reduces the
number of Core dependencies across the board.

Reviewers: zturner, jingham, teemperor, clayborg

Subscribers: mgorny, lldb-commits

Differential Revision: https://reviews.llvm.org/D55361

llvm-svn: 349157
2018-12-14 15:59:49 +00:00
Pavel Labath 07e93c57a3 Move DataExtractorTest to unittests/Utility
The DataExtractor class itself was moved to Utility some time ago, but
it seems this was not reflected in the location of the test code. Fix
that.

llvm-svn: 346867
2018-11-14 14:58:36 +00:00
Jonas Devlieghere 8f3be7a32b [FileSystem] Move path resolution logic out of FileSpec
This patch removes the logic for resolving paths out of FileSpec and
updates call sites to rely on the FileSystem class instead.

Differential revision: https://reviews.llvm.org/D53915

llvm-svn: 345890
2018-11-01 21:05:36 +00:00
Jonas Devlieghere 46376966ea [FileSystem] Extend file system and have it use the VFS.
This patch extends the FileSystem class with a bunch of functions that
are currently implemented as methods of the FileSpec class. These
methods will be removed in future commits and replaced by calls to the
file system.

The new functions are operated in terms of the virtual file system which
was recently moved from clang into LLVM so it could be reused in lldb.
Because the VFS is stateful, we turned the FileSystem class into a
singleton.

Differential revision: https://reviews.llvm.org/D53532

llvm-svn: 345783
2018-10-31 21:49:27 +00:00
Bruce Mitchener 173946dca6 Fix typos.
Reviewers: lldb-commits

Subscribers: srhines, ki.stfu

Differential Revision: https://reviews.llvm.org/D52884

llvm-svn: 343825
2018-10-04 22:33:39 +00:00
Aaron Smith 2fc9c3b05f [lldb] Remove an assertion in RichManglingContext::GetBufferRef() hit when debugging a native x86 Windows process
Summary: A RichManglingContext constructed with an invalid demangled name or with a demangled function name without any context will have an empty context. This triggers an assertion in RichManglingContext::GetBufferRef() when debugging a native Windows process on x86 when it shouldn't. Remove the assertion.

Reviewers: aleksandr.urakov, zturner, lldb-commits

Reviewed By: zturner

Subscribers: erik.pilkington

Differential Revision: https://reviews.llvm.org/D52626

llvm-svn: 343292
2018-09-28 02:33:51 +00:00
Raphael Isemann 7fae4932ad Move Predicate.h from Host to Utility
Summary:
This class was initially in Host because its implementation used to be
very OS-specific. However, with C++11, it has become a very simple
std::condition_variable wrapper, with no host-specific code.

It is also a general purpose utility class, so it makes sense for it to
live in a place where it can be used by everyone.

This has no effect on the layering right now, but it enables me to later
move the Listener+Broadcaster+Event combo to a lower layer, which is
important, as these are used in a lot of places (notably for launching a
process in Host code).

Reviewers: jingham, zturner, teemperor

Reviewed By: zturner

Subscribers: xiaobai, mgorny, lldb-commits

Differential Revision: https://reviews.llvm.org/D50384

llvm-svn: 341089
2018-08-30 17:51:10 +00:00
Raphael Isemann 1ede18fb4d Added test for Core/Range class.
Summary:
We can optimize and refactor some of the classes in RangeMap.h, but first
we should have some tests for all the data structures in there. This adds a first
batch of tests for the Range class itself.

There are some unexpected results happening when mixing invalid and valid ranges, so
I added some FIXME's for that in the tests.

Reviewers: vsk

Reviewed By: vsk

Subscribers: mgorny, lldb-commits

Differential Revision: https://reviews.llvm.org/D50620

llvm-svn: 339611
2018-08-13 20:43:06 +00:00
Stefan Granitz d051416491 RichManglingContext: Make m_ipd_str_len a local variable and simplify processIPDStrResult + polishing in test and Mangled
llvm-svn: 339440
2018-08-10 15:21:33 +00:00
Stefan Granitz f1a98df6ee Use rich mangling information in Symtab::InitNameIndexes()
Summary:
I set up a new review, because not all the code I touched was marked as a change in old one anymore.

In preparation for this review, there were two earlier ones:
* https://reviews.llvm.org/D49612 introduced the ItaniumPartialDemangler to LLDB demangling without conceptual changes
* https://reviews.llvm.org/D49909 added a unit test that covers all relevant code paths in the InitNameIndexes() function

Primary goals for this patch are:
(1) Use ItaniumPartialDemangler's rich mangling info for building LLDB's name index.
(2) Provide a uniform interface.
(3) Improve indexing performance.

The central implementation in this patch is our new function for explicit demangling:
```
const RichManglingInfo *
Mangled::DemangleWithRichManglingInfo(RichManglingContext &, SkipMangledNameFn *)
```

It takes a context object and a filter function and provides read-only access to the rich mangling info on success, or otherwise returns null. The two new classes are:
* `RichManglingInfo` offers a uniform interface to query symbol properties like `getFunctionDeclContextName()` or `isCtorOrDtor()` that are forwarded to the respective provider internally (`llvm::ItaniumPartialDemangler` or `lldb_private::CPlusPlusLanguage::MethodName`).
* `RichManglingContext` works a bit like `LLVMContext`, it the actual `RichManglingInfo` returned from `DemangleWithRichManglingInfo()` and handles lifetime and configuration. It is likely stack-allocated and can be reused for multiple queries during batch processing.

The idea here is that `DemangleWithRichManglingInfo()` acts like a gate keeper. It only provides access to `RichManglingInfo` on success, which in turn avoids the need to handle a `NoInfo` state in every single one of its getters. Having it stored within the context, avoids extra heap allocations and aids (3). As instantiations of the IPD the are considered expensive, the context is the ideal place to store it too. An efficient filtering function `SkipMangledNameFn` is another piece in the performance puzzle and it helps to mimic the original behavior of `InitNameIndexes`.

Future potential:
* `DemangleWithRichManglingInfo()` is thread-safe, IFF using different contexts in different threads. This may be exploited in the future. (It's another thing that it has in common with `LLVMContext`.)
* The old implementation only parsed and indexed Itanium mangled names. The new `RichManglingInfo` can be extended for various mangling schemes and languages.

One problem with the implementation of RichManglingInfo is the inaccessibility of class `CPlusPlusLanguage::MethodName` (defined in source/Plugins/Language/..), from within any header in the Core components of LLDB. The rather hacky solution is to store a type erased reference and cast it to the correct type on access in the cpp - see `RichManglingInfo::get<ParserT>()`. At the moment there seems to be no better way to do it. IMHO `CPlusPlusLanguage::MethodName` should be a top-level class in order to enable forward delcarations (but that is a rather big change I guess).

First simple profiling shows a good speedup. `target create clang` now takes 0.64s on average. Before the change I observed runtimes between 0.76s an 1.01s. This is still no bulletproof data (I only ran it on one machine!), but it's a promising indicator I think.

Reviewers: labath, jingham, JDevlieghere, erik.pilkington

Subscribers: zturner, clayborg, mgorny, lldb-commits

Differential Revision: https://reviews.llvm.org/D50071

llvm-svn: 339291
2018-08-08 21:57:37 +00:00
Pavel Labath 87730a6391 Move ScalarTest to follow the class being tested
This should have been a part of r339127, but I missed it somehow.

llvm-svn: 339136
2018-08-07 13:10:16 +00:00
Pavel Labath d821c997aa Move RegisterValue,Scalar,State from Core to Utility
These three classes have no external dependencies, but they are used
from various low-level APIs. Moving them down to Utility improves
overall code layering (although it still does not break any particular
dependency completely).

The XCode project will need to be updated after this change.

Differential Revision: https://reviews.llvm.org/D49740

llvm-svn: 339127
2018-08-07 11:07:21 +00:00
Stefan Granitz 149fede165 Unit test for Symtab::InitNameIndexes
Summary: In order to exploit the potential of LLVM's new ItaniumPartialDemangler for indexing in LLDB, we expect conceptual changes in the implementation of the InitNameIndexes function. Here is a unit test that aims at covering all relevant code paths in that function.

Reviewers: labath, jingham, JDevlieghere

Reviewed By: JDevlieghere

Subscribers: friss, teemperor, davide, clayborg, erik.pilkington, lldb-commits, mgorny

Differential Revision: https://reviews.llvm.org/D49909

llvm-svn: 338695
2018-08-02 10:13:18 +00:00
Stefan Granitz 2f842d68df Use LLVM's new ItaniumPartialDemangler in LLDB
Summary:
Replace the existing combination of FastDemangle and the fallback to llvm::itaniumDemangle() with LLVM's new ItaniumPartialDemangler. It slightly reduces complexity and slightly improves performance, but doesn't introduce conceptual changes. This patch is preparing for more fundamental improvements on LLDB's demangling approach.

Reviewers: friss, jingham, erik.pilkington, labath, clayborg, mgorny, davide, JDevlieghere

Reviewed By: JDevlieghere

Subscribers: teemperor, JDevlieghere, labath, clayborg, davide, lldb-commits, mgorny, erik.pilkington

Differential Revision: https://reviews.llvm.org/D49612

llvm-svn: 337931
2018-07-25 15:19:04 +00:00
Pavel Labath 082bab1cff Reimplement EventDataBytes::Dump to avoid DumpDataExtractor
This is the only external non-trivial dependency of the Event classes.

llvm-svn: 337819
2018-07-24 10:49:14 +00:00
Pavel Labath 61547259de Scalar: Use llvm integer conversion functions
StringConvert was the only non-Utility dependency of this class. Getting
rid of it means it will be easy to move this class to a lower layer.

While I was in there, I also added a couple of unit tests for the Scalar
string conversion function.

llvm-svn: 335060
2018-06-19 17:24:03 +00:00
Adrian McCarthy 4ee16bfff7 Fix narrowing warning by appending `f` to literal constant.
llvm-svn: 330354
2018-04-19 18:31:57 +00:00
Davide Italiano 49d802862d [Core] Grab-bag of improvements for Scalar.
Remove Scalar::Cast.

It was noted on the list that this method is unused. So, this patch
removes it.

Fix Scalar::Promote for most integer types

This fixes promotion of most integer types (128- and 256-bit types are
handled in a subsequent patch) to floating-point types. Previously
promotion was done bitwise, where value preservation is correct.

Fix Scalar::Promote for 128- and 256-bit integer types

This patch fixes the behavior of Scalar::Promote when trying to
perform a binary operation involving a 128- or 256-bit integer type
and a floating-point type. Now, the integer is cast to the floating
point type for the operation.

Patch by Tom Tromey!

Differential Revision:  https://reviews.llvm.org/D44907

llvm-svn: 328985
2018-04-02 16:50:54 +00:00
Davide Italiano 01c33b8189 [Core] Correctly handle float division in Scalar.
Patch by Tom Tromey!

Differential Revision:  https://reviews.llvm.org/D44693

llvm-svn: 328649
2018-03-27 18:37:54 +00:00
Raphael Isemann 0b16ef7814 Fix unrepresentable float value in ScalarTest
Summary: float can't represent the given value in the literal, so we get this UB error: `runtime error: 1.23457e+48 is outside the range of representable values of type 'float'`. The test seems to not rely on this specific value, so let's just choose a smaller one that can be represented.

Reviewers: uweigand

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D42338

llvm-svn: 323081
2018-01-22 08:11:29 +00:00
Pavel Labath 5f19b90783 Move ArchSpec to the Utility module
The rationale here is that ArchSpec is used throughout the codebase,
including in places which should not depend on the rest of the code in
the Core module.

This commit touches many files, but most of it is just renaming of
 #include lines. In a couple of cases, I removed the #include ArchSpec
line altogether, as the file was not using it. In one or two places,
this necessitated adding other #includes like lldb-private-defines.h.

llvm-svn: 318048
2017-11-13 16:16:33 +00:00
Petr Pavlu dbd7c338a0 Fix dumping of characters with non-standard sizes
* Prevent dumping of characters in DumpDataExtractor() with
  item_byte_size bigger than 8 bytes. This case is not supported by the
  code and results in a crash because the code calls
  DataExtractor::GetMaxU64Bitfield() -> GetMaxU64() that asserts for
  byte size > 8 bytes.
* Teach DataExtractor::GetMaxU64(), GetMaxU32(), GetMaxS64() and
  GetMaxU64_unchecked() how to handle byte sizes that are not a multiple
  of 2. This allows DumpDataExtractor() to dump characters and booleans
  with item_byte_size in the interval of [1, 8] bytes. Values that are
  not a multiple of 2 would previously result in a crash because they
  were not handled by GetMaxU64().

llvm-svn: 315444
2017-10-11 08:48:18 +00:00
Pavel Labath 38d0632e6a Move Timer and TraceOptions from Core to Utility
Summary:
The classes have no dependencies, and they are used both by lldb and
lldb-server, so it makes sense for them to live in the lowest layers.

Reviewers: zturner, jingham

Subscribers: emaste, mgorny, lldb-commits

Differential Revision: https://reviews.llvm.org/D34746

llvm-svn: 306682
2017-06-29 14:32:17 +00:00
Pavel Labath f2a8bccf85 Move StructuredData from Core to Utility
Summary:
It had a dependency on StringConvert and file reading code, which is not
in Utility. I've replaced that code by equivalent llvm operations.

I've added a unit test to demonstrate that parsing a file still works.

Reviewers: zturner, jingham

Subscribers: kubamracek, mgorny, lldb-commits

Differential Revision: https://reviews.llvm.org/D34625

llvm-svn: 306394
2017-06-27 10:45:31 +00:00
Zachary Turner 264b5d9e88 Move Object format code to lib/BinaryFormat.
This creates a new library called BinaryFormat that has all of
the headers from llvm/Support containing structure and layout
definitions for various types of binary formats like dwarf, coff,
elf, etc as well as the code for identifying a file from its
magic.

Differential Revision: https://reviews.llvm.org/D33843

llvm-svn: 304864
2017-06-07 03:48:56 +00:00
Pavel Labath f9d1647657 Remove an expensive lock from Timer
The Timer destructor would grab a global mutex in order to update
execution time. Add a class to define a category once, statically; the
class adds itself to an atomic singly linked list, and thus subsequent
updates only need to use an atomic rather than grab a lock and perform a
hashtable lookup.

Differential Revision: https://reviews.llvm.org/D32823
Patch by Scott Smith <scott.smith@purestorage.com>.

llvm-svn: 303058
2017-05-15 13:02:37 +00:00
Zachary Turner 97206d5727 Rename Error -> Status.
This renames the LLDB error class to Status, as discussed
on the lldb-dev mailing list.

A change of this magnitude cannot easily be done without
find and replace, but that has potential to catch unwanted
occurrences of common strings such as "Error".  Every effort
was made to find all the obvious things such as the word "Error"
appearing in a string, etc, but it's possible there are still
some lingering occurences left around.  Hopefully nothing too
serious.

llvm-svn: 302872
2017-05-12 04:51:55 +00:00
Pavel Labath 68e3886e57 Recompute ArchSpec core after MergeFrom
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
2017-04-20 12:30:18 +00:00
Zachary Turner 720bd7af62 Fix build failure in unit test.
llvm-svn: 299718
2017-04-06 21:57:39 +00:00
Zachary Turner fb1a0a0d2f Move many other files from Core -> Utility.
llvm-svn: 297043
2017-03-06 18:34:25 +00:00
Zachary Turner 666cc0b291 Move DataBuffer / DataExtractor and friends from Core -> Utility.
llvm-svn: 296943
2017-03-04 01:30:05 +00:00
Zachary Turner 6f9e690199 Move Log from Core -> Utility.
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
2017-03-03 20:56:28 +00:00
Zachary Turner 1e021a162e [Windows] Remove the #include <eh.h> hack.
Prior to MSVC 2015 we had to manually include this header any
time we were going to include <thread> or <future> due to a
bug in MSVC's STL implementation.  This has been fixed in MSVC
for some time now, and we require VS 2015 minimum, so we can
remove this across all subprojects.

llvm-svn: 296906
2017-03-03 20:21:59 +00:00
Pavel Labath e2b2c70bc1 Fix gcc compilation of LogTest.cpp
llvm-svn: 296595
2017-03-01 10:08:51 +00:00
Pavel Labath 5e336903be Modernize Enable/DisableLogChannel interface a bit
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
2017-03-01 10:08:40 +00:00
Pavel Labath 88d081b505 Log: Fix a regression in handling log options
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
2017-02-27 11:05:39 +00:00
Pavel Labath ba95a28c18 Log: Fix race in accessing the stream variable
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
2017-02-21 09:58:23 +00:00
Pavel Labath fb0d22d645 Reapply "Refactor log channel registration mechanism"
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
2017-02-17 13:27:42 +00:00
Pavel Labath a272fa8fff Fix breakage caused by r295368
Also move the ErrorTest into the Utility package, to follow the class it
is testing.

llvm-svn: 295436
2017-02-17 10:19:46 +00:00
Pavel Labath f0713996b2 Revert "Refactor log channel registration mechanism"
The change breaks on Windows and NetBSD bots. Revert while I
investigate.

llvm-svn: 295201
2017-02-15 17:13:19 +00:00
Pavel Labath 5fb8af40df Refactor log channel registration mechanism
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
2017-02-15 16:11:59 +00:00
Zachary Turner 01c3243fc1 Remove dependencies from Utility to Core and Target.
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
2017-02-14 19:06:07 +00:00