2015-03-17 22:51:21 +00:00
|
|
|
add_lldb_unittest(UtilityTests
|
2018-07-16 16:38:30 +00:00
|
|
|
AnsiTerminalTest.cpp
|
2018-04-17 18:53:35 +00:00
|
|
|
ArgsTest.cpp
|
2018-07-10 20:17:38 +00:00
|
|
|
OptionsWithRawTest.cpp
|
2017-11-13 16:16:33 +00:00
|
|
|
ArchSpecTest.cpp
|
2018-12-14 15:59:49 +00:00
|
|
|
BroadcasterTest.cpp
|
2017-02-05 00:44:54 +00:00
|
|
|
ConstStringTest.cpp
|
Refactoring for for the internal command line completion API (NFC)
Summary:
This patch refactors the internal completion API. It now takes (as far as possible) a single
CompletionRequest object instead o half a dozen in/out/in-out parameters. The CompletionRequest
contains a common superset of the different parameters as far as it makes sense. This includes
the raw command line string and raw cursor position, which should make the `expr` command
possible to implement (at least without hacks that reconstruct the command line from the args).
This patch is not intended to change the observable behavior of lldb in any way. It's also as
minimal as possible and doesn't attempt to fix all the problems the API has.
Some Q&A:
Q: Why is this not fixing all the problems in the completion API?
A: Because is a blocker for the expr command completion which I want to get in ASAP. This is the
smallest patch that unblocks the expr completion patch and which allows trivial refactoring in the future.
The patch also doesn't really change the internal information flow in the API, so that hopefully
saves us from ever having to revert and resubmit this humongous patch.
Q: Can we merge all the copy-pasted code in the completion methods
(like computing the current incomplete arg) into CompletionRequest class?
A: Yes, but it's out of scope for this patch.
Q: Why the `word_complete = request.GetWordComplete(); ... ` pattern?
A: I don't want to add a getter that returns a reference to the internal integer. So we have
to use a temporary variable and the Getter/Setter instead. We don't throw exceptions
from what I can tell, so the behavior doesn't change.
Q: Why are we not owning the list of matches?
A: Because that's how the previous API works. But that should be fixed too (in another patch).
Q: Can we make the constructor simpler and compute some of the values from the plain command?
A: I think this works, but I rather want to have this in a follow up commit. Especially when making nested
request it's a bit awkward that the parsed arguments behave as both input/output (as we should in theory
propagate the changes on the nested request back to the parent request if we don't want to change the
behavior too much).
Q: Can't we pass one const request object and then just return another result object instead of mixing
them together in one in/out parameter?
A: It's hard to get keep the same behavior with that pattern, but I think we can also get a nice API with just
a single request object. If we make all input parameters read-only, we have a clear separation between what
is actually an input and what an output parameter (and hopefully we get rid of the in-out parameters).
Q: Can we throw out the 'match' variables that are not implemented according to the comment?
A: We currently just forward them as in the old code to the different methods, even though I think
they are really not used. We can easily remove and readd them once every single completion method just
takes a CompletionRequest, but for now I prefer NFC behavior from the perspective of the API user.
Reviewers: davide, jingham, labath
Reviewed By: jingham
Subscribers: mgorny, friss, lldb-commits
Differential Revision: https://reviews.llvm.org/D48796
llvm-svn: 336146
2018-07-02 21:29:56 +00:00
|
|
|
CompletionRequestTest.cpp
|
2022-04-01 22:59:18 +00:00
|
|
|
DataBufferTest.cpp
|
2021-12-07 17:44:22 +00:00
|
|
|
DataEncoderTest.cpp
|
2018-11-14 14:58:36 +00:00
|
|
|
DataExtractorTest.cpp
|
Add Utility/Environment class for handling... environments
Summary:
There was some confusion in the code about how to represent process
environment. Most of the code (ab)used the Args class for this purpose,
but some of it used a more basic StringList class instead. In either
case, the fact that the underlying abstraction did not provide primitive
operations for the typical environment operations meant that even a
simple operation like checking for an environment variable value was
several lines of code.
This patch adds a separate Environment class, which is essentialy a
llvm::StringMap<std::string> in disguise. To standard StringMap
functionality, it adds a couple of new functions, which are specific to
the environment use case:
- (most important) envp conversion for passing into execve() and likes.
Instead of trying to maintain a constantly up-to-date envp view, it
provides a function which creates a envp view on demand, with the
expectation that this will be called as the very last thing before
handing the value to the system function.
- insert(StringRef KeyEqValue) - splits KeyEqValue into (key, value)
pair and inserts it into the environment map.
- compose(value_type KeyValue) - takes a map entry and converts in back
into "KEY=VALUE" representation.
With this interface most of the environment-manipulating code becomes
one-liners. The only tricky part was maintaining compatibility in
SBLaunchInfo, which expects that the environment entries are accessible
by index and that the returned const char* is backed by the launch info
object (random access into maps is hard and the map stores the entry in
a deconstructed form, so we cannot just return a .c_str() value). To
solve this, I have the SBLaunchInfo convert the environment into the
"envp" form, and use it to answer the environment queries. Extra code is
added to make sure the envp version is always in sync.
(This also improves the layering situation as Args was in the Interpreter module
whereas Environment is in Utility.)
Reviewers: zturner, davide, jingham, clayborg
Subscribers: emaste, lldb-commits, mgorny
Differential Revision: https://reviews.llvm.org/D41359
llvm-svn: 322174
2018-01-10 11:57:31 +00:00
|
|
|
EnvironmentTest.cpp
|
2018-12-14 15:59:49 +00:00
|
|
|
EventTest.cpp
|
2018-04-20 08:27:27 +00:00
|
|
|
FileSpecTest.cpp
|
2018-07-19 17:45:51 +00:00
|
|
|
FlagsTest.cpp
|
2018-12-14 15:59:49 +00:00
|
|
|
ListenerTest.cpp
|
2017-03-03 20:56:28 +00:00
|
|
|
LogTest.cpp
|
2017-02-20 11:35:33 +00:00
|
|
|
NameMatchesTest.cpp
|
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
|
|
|
PredicateTest.cpp
|
Move ProcessInfo from Host to Utility.
There are set of classes in Target that describe the parameters of a
process - e.g. it's PID, name, user id, and similar. However, since it
is a bare description of a process and contains no actual functionality,
there's nothing specifically that makes this appropriate for being in
Target -- it could just as well be describing a process on the host, or
some hypothetical virtual process that doesn't even exist.
To cement this, I'm moving these classes to Utility. It's possible that
we can find a better place for it in the future, but as it is neither
Host specific nor Target specific, Utility seems like the most appropriate
place for the time being.
After this there is only 2 remaining references to Target from Host,
which I'll address in a followup.
Differential Revision: https://reviews.llvm.org/D58842
llvm-svn: 355342
2019-03-04 21:51:03 +00:00
|
|
|
ProcessInfoTest.cpp
|
2019-08-26 13:07:02 +00:00
|
|
|
ProcessInstanceInfoTest.cpp
|
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
|
|
|
RangeMapTest.cpp
|
|
|
|
RangeTest.cpp
|
2018-08-07 11:07:21 +00:00
|
|
|
RegisterValueTest.cpp
|
2019-08-16 21:25:36 +00:00
|
|
|
RegularExpressionTest.cpp
|
2018-08-07 13:10:16 +00:00
|
|
|
ScalarTest.cpp
|
2020-01-31 14:45:58 +00:00
|
|
|
SharedClusterTest.cpp
|
2018-08-07 11:07:21 +00:00
|
|
|
StateTest.cpp
|
2017-05-12 04:51:55 +00:00
|
|
|
StatusTest.cpp
|
2018-07-24 00:01:32 +00:00
|
|
|
StreamTeeTest.cpp
|
2018-08-01 06:04:48 +00:00
|
|
|
StreamTest.cpp
|
2021-03-30 11:25:06 +00:00
|
|
|
StringExtractorGDBRemoteTest.cpp
|
2015-03-17 22:51:21 +00:00
|
|
|
StringExtractorTest.cpp
|
2018-08-22 20:22:34 +00:00
|
|
|
StringLexerTest.cpp
|
2018-08-04 17:28:21 +00:00
|
|
|
StringListTest.cpp
|
2017-06-27 10:45:31 +00:00
|
|
|
StructuredDataTest.cpp
|
2019-12-23 09:38:12 +00:00
|
|
|
SubsystemRAIITest.cpp
|
2017-03-22 17:33:23 +00:00
|
|
|
TildeExpressionResolverTest.cpp
|
2016-11-25 11:58:44 +00:00
|
|
|
TimeoutTest.cpp
|
2017-06-29 14:32:17 +00:00
|
|
|
TimerTest.cpp
|
2022-03-22 13:15:56 +00:00
|
|
|
TraceGDBRemotePacketsTest.cpp
|
2015-03-17 22:51:21 +00:00
|
|
|
UriParserTest.cpp
|
2019-03-04 18:48:00 +00:00
|
|
|
UserIDResolverTest.cpp
|
2018-06-21 15:07:43 +00:00
|
|
|
UUIDTest.cpp
|
2017-02-16 19:38:21 +00:00
|
|
|
VASprintfTest.cpp
|
2018-07-24 23:52:39 +00:00
|
|
|
VMRangeTest.cpp
|
2020-03-20 01:51:36 +00:00
|
|
|
XcodeSDKTest.cpp
|
2017-02-01 22:17:00 +00:00
|
|
|
|
|
|
|
LINK_LIBS
|
|
|
|
lldbUtility
|
2017-06-29 13:02:11 +00:00
|
|
|
lldbUtilityHelpers
|
2018-08-07 13:10:16 +00:00
|
|
|
LLVMTestingSupport
|
2017-02-17 10:19:46 +00:00
|
|
|
LINK_COMPONENTS
|
|
|
|
Support
|
[Support] Move TargetParsers to new component
This is a fairly large changeset, but it can be broken into a few
pieces:
- `llvm/Support/*TargetParser*` are all moved from the LLVM Support
component into a new LLVM Component called "TargetParser". This
potentially enables using tablegen to maintain this information, as
is shown in https://reviews.llvm.org/D137517. This cannot currently
be done, as llvm-tblgen relies on LLVM's Support component.
- This also moves two files from Support which use and depend on
information in the TargetParser:
- `llvm/Support/Host.{h,cpp}` which contains functions for inspecting
the current Host machine for info about it, primarily to support
getting the host triple, but also for `-mcpu=native` support in e.g.
Clang. This is fairly tightly intertwined with the information in
`X86TargetParser.h`, so keeping them in the same component makes
sense.
- `llvm/ADT/Triple.h` and `llvm/Support/Triple.cpp`, which contains
the target triple parser and representation. This is very intertwined
with the Arm target parser, because the arm architecture version
appears in canonical triples on arm platforms.
- I moved the relevant unittests to their own directory.
And so, we end up with a single component that has all the information
about the following, which to me seems like a unified component:
- Triples that LLVM Knows about
- Architecture names and CPUs that LLVM knows about
- CPU detection logic for LLVM
Given this, I have also moved `RISCVISAInfo.h` into this component, as
it seems to me to be part of that same set of functionality.
If you get link errors in your components after this patch, you likely
need to add TargetParser into LLVM_LINK_COMPONENTS in CMake.
Differential Revision: https://reviews.llvm.org/D137838
2022-12-20 10:24:02 +00:00
|
|
|
TargetParser
|
2015-03-17 22:51:21 +00:00
|
|
|
)
|
2017-06-27 10:45:31 +00:00
|
|
|
|
2022-11-03 18:25:40 +00:00
|
|
|
set(test_inputs
|
2017-06-27 10:45:31 +00:00
|
|
|
StructuredData-basic.json
|
2022-11-03 18:25:40 +00:00
|
|
|
StructuredData-nested.json
|
|
|
|
StructuredData-full.json
|
2017-06-27 10:45:31 +00:00
|
|
|
)
|
2022-11-03 18:25:40 +00:00
|
|
|
|
|
|
|
add_unittest_inputs(UtilityTests "${test_inputs}")
|