Commit Graph

20236 Commits

Author SHA1 Message Date
Jonas Devlieghere 625ab43318 [dotest] Don't set the DWARF version override in CFLAGS_EXTRA.
We cannot override the DWARF version in the CFLAGS_EXTRA because they
are used by tests that explicitly build without debug info. Instead, we
pass them through the regular CFLAGS.

llvm-svn: 369477
2019-08-20 23:56:32 +00:00
Jonas Devlieghere 0dcd186b0d [NFC] Fix -Wdocumentation warnings in Utility.
This patch fixes a bunch of -Wdocumentation warnings in Utility. I'm
sure there are still a bunch outdated comments left, but this fixes the
most flagrant inconsistencies that the compiler understands.

llvm-svn: 369461
2019-08-20 22:20:46 +00:00
Alex Langford b2232a1af3 [Symbol] Move VerifyDecl to ClangASTContext
VerifyDecl is specific to clang and is only used in ClangASTContext.

llvm-svn: 369456
2019-08-20 22:06:13 +00:00
Med Ismail Bennani 27a313ebde [LLDB][Test] Remove `skipIfWindows` for conditional breakpoint test (NFC)
Summary:
The test for conditional breakpoints on Windows was skipped because
there was no expression evaluation support at the time it was written.

After removing the annotation and testing it again, the test is passing.
http://lists.llvm.org/pipermail/lldb-dev/2019-August/015405.html

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>

Reviewers: stella.stamenova, jingham

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 369453
2019-08-20 21:58:22 +00:00
Jonas Devlieghere c569d4af4c [NFC] Update RegularExpression documentation
llvm-svn: 369452
2019-08-20 21:56:49 +00:00
Alex Langford cb40f89c6e [Symbol][NFC] Remove references to clang in TypeMap
llvm-svn: 369436
2019-08-20 20:44:36 +00:00
Jonas Devlieghere 8509b0a778 [CMake] Remove LLDB_TEST_USE_CUSTOM_C(XX)_COMPILER
Given that LLDB_TEST_USE_CUSTOM_C_COMPILER and LLDB_TEST_C_COMPILER are
both set at configuration time, I don't really see the point of having
both. This patch simplifies things and uses the custom C/C++ compiler
when the variable is set, and uses the default one when it's not set.
The variable can be unset by passing -ULLDB_TEST_C_COMPILER to CMake.

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

llvm-svn: 369435
2019-08-20 20:20:20 +00:00
Alex Langford 1271521ed8 [ClangExpressionParser] Add ClangDeclVendor
Summary:
This introduces a layer between DeclVendor and the currently implemented
DeclVendors (ClangModulesDeclVendor and AppleObjCDeclVendor). This
allows the removal of DeclVendor::GetImporterSource which is extremely
clang-specific, freeing up the interface to be more general.

A good follow up to this would be to remove the remaining instances of
clang in DeclVendor, either by moving things to ClangDeclVendor or by
using wrappers (e.g. CompilerDecl instead of clang::NamedDecl).

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

llvm-svn: 369424
2019-08-20 18:47:30 +00:00
Adrian Prantl 260aa0f0f3 Make the FindTypes(std::vector<CompilerContext>, ...) API testable in lldb-test
This adds a -compiler-context=<...> option to lldb-test that trakes a
comma-separated string that is a list of kind/name pairs and
translates it into a std::vector<CompilerContext>, a CompilerContext
being a pair of context-kind and name.

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

<rdar://problem/54471165>

llvm-svn: 369407
2019-08-20 16:44:25 +00:00
Jan Kratochvil 1c56d3df19 [lldb] Use the new Regex::isValid() with no parameter
Differential Revision: https://reviews.llvm.org/D66463

llvm-svn: 369398
2019-08-20 16:08:27 +00:00
Pavel Labath 028fe5af60 Fix build for r369374
This patch added some gtest code to the TestingSupport library. As this
is not a unit test, but a unit test library, gtest does not get added to
the include path automatically, but we have to do that ourselves. (It
was working for me without this because the compiler picked up the
system gtest instead.)

llvm-svn: 369381
2019-08-20 13:17:20 +00:00
Pavel Labath 5877fb7cd7 Convert minidump unittests to use llvm::yaml::convertYAML
previously they used a minidump-specific function for this purpose, but
this is no longer needed now that whole of yaml2obj is available as a
library.

llvm-svn: 369379
2019-08-20 12:53:42 +00:00
Pavel Labath a2e270fa70 unittests: Use yaml2obj as a library instead of an external process
Summary:
Recently, yaml2obj has been turned into a library. This means we can use
it from our unit tests directly, instead of shelling out to an external
process. This patch does just that.

Reviewers: JDevlieghere, aadsm, espindola, jdoerfert

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

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

llvm-svn: 369374
2019-08-20 12:28:36 +00:00
Pavel Labath 66d109640f [cmake] Remove the test for libstdc++<4.9
It is no longer relevant now that llvm requires >=5.1.

llvm-svn: 369371
2019-08-20 12:17:42 +00:00
Raphael Isemann 213a5abb4f [lldb][NFC] Test quotes when completing
llvm-svn: 369353
2019-08-20 09:26:58 +00:00
Jan Kratochvil f9d90bc5f6 [lldb] D66174 `RegularExpression` cleanup
I find as a good cleanup to drop the Compile method. As I do not find TIMTOWTDI
as an advantage and there is already constructor parameter to compile the
regex.

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

llvm-svn: 369352
2019-08-20 09:24:20 +00:00
Med Ismail Bennani 6815b6ef2a [lldb] Fix typo on the BreakpointLocation header and the lldbtest.py (NFC)
Summary:
This commit fixes some typo I found while exploring LLDB's codebase.

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 369313
2019-08-19 23:59:31 +00:00
Saleem Abdulrasool 2e8b57558d Windows: Include "windows" Instead of "Windows"
The actual include directory is lldb/Host/windows not
lldb/Host/Windows which breaks on case sensitive file systems

Patch by Gwen Mittertreiner!

llvm-svn: 369307
2019-08-19 22:45:01 +00:00
Matthias Gehre 8b0d15e43f Fix use-after-free
Summary:
The warning
```
lldb/source/Core/FormatEntity.cpp:2350:25: warning: object backing the pointer will be destroyed at the end of the full-expression [-Wdangling]
```
is emitted after annotating `llvm::StringRef` with `[[gsl::Pointer]]`.

The reason is that in
```
 size_t FormatEntity::AutoComplete(CompletionRequest &request) {
  llvm::StringRef str = request.GetCursorArgumentPrefix().str();
```
the function `GetCursorArgumentPrefix()` returns a `StringRef`, and `StringRef::str()` returns
a temporary `std::string`.

Reviewers: jingham, JDevlieghere

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 369304
2019-08-19 21:39:16 +00:00
Alex Langford 3b4ce731fb [lldb-vscode] add `launchCommands` to handle launch specific commands
Summary:
This can help `lldb-vscode` handle launch commands associate with remote platform
attach request have field `attachCommands` to handle attach specific commands
add a corresponding one for launch request
if no launch command is provided, create a new target and launch; otherwise, execute the launch command

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

Patch by Wanyi Ye <kusmour@gmail.com>

llvm-svn: 369296
2019-08-19 20:17:27 +00:00
Raphael Isemann 0f4e9835c9 [lldb] Make TestIOHandlerCompletion more stable and document it
Instead of relying that three tabs show all completions, we should
show all remaining completions which will always stop the mode
where we show completions. Should fix this test on systems that
somehow have more completions that our normal LLDB (as they
would end up being stuck in the mode where we show completions).

llvm-svn: 369293
2019-08-19 19:13:26 +00:00
Jonas Devlieghere 8880ac648c [dotest] Add --dwarf-version to override the tested DWARF version.
On the matrix bot on GreenDragon [1] we want to run the test suite
against different DWARF versions. The idea here is not to replace
targeted tests for certain DWARF features, but rather to provide an easy
way to support this configuration.

[1] http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake-matrix/

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

llvm-svn: 369272
2019-08-19 16:04:21 +00:00
Raphael Isemann 6632ad5851 [lldb][NFC] Stop using GetNumberOfMatches in CompletionRequest test
This function is just a wrapper for GetNumberOfResults and will
be removed soon. This patch just changes all calls to GetNumberOfResults
where possible (which is currently just the unit test).

llvm-svn: 369267
2019-08-19 14:52:48 +00:00
Raphael Isemann 0684132107 [lldb][NFC] Use CompletionRequest in Variable::AutoComplete
llvm-svn: 369252
2019-08-19 11:49:43 +00:00
Raphael Isemann fb443746a8 [lldb][NFC] Add a few more completion tests to increase test coverage
These tests are mostly trying to reach the different completion functions
in CommandCompletions.cpp (::ArchitectureNames, ::DiskFiles, ::Modules).

llvm-svn: 369249
2019-08-19 10:46:38 +00:00
Raphael Isemann b8639f5c0f [lldb][NFC] Remove StringList::AutoComplete
We don't need this very specific function in StringList that
we only call once in LLDB.

llvm-svn: 369242
2019-08-19 08:15:46 +00:00
Raphael Isemann 81094aad61 [lldb][NFC] Use GetMaxStringLength in CommandObjectApropos::DoExecute
llvm-svn: 369240
2019-08-19 07:59:44 +00:00
Raphael Isemann 21599876be [lldb][NFC] Address review comments to StringList for-loop support
llvm-svn: 369237
2019-08-19 07:22:19 +00:00
Jan Kratochvil 0697bcd127 [lldb] Remove unused inheritance in RegularExpression
D66174 left inherited llvm::Regex which is now a member variable there.

Approved as a part of: https://reviews.llvm.org/D66392#1634575

llvm-svn: 369235
2019-08-19 07:06:56 +00:00
Jonas Devlieghere 45e598d135 [CMake] Update CMAKE_OSX_DEPLOYMENT_TARGET to 10.12.
After LLVM moved to C++14, the RWMutex implementation was removed in
favor of std::shared_timed_mutex, which is only available on macOS
10.12 and later. As a workaround for older deployment targets, I added
   the original RWMutexImpl again, guarded by the deployment target.

When doing a standalone build of LLDB using the Xcode generator, the
CMake cache specifies a minimum deployment target. However, LLVM and
Clang might have been built with a different minimum deployment target.

This is exactly what happened for the Xcode build. LLVM was built with a
minimum deployment target newer than 10.12, using
std::shared_timed_mutex. LLDB on the other hand was built with a minimum
deployment target of 10.11, using the old RWMutexImpl, resulting in
undefined symbols at link-time.

This patch changes the minimum deployment target for the Xcode build to
10.12 to work around this problem. A better solution would involve
synchronizing the minimum deployment or even not setting one at all.

llvm-svn: 369220
2019-08-18 21:54:26 +00:00
Raphael Isemann 37a928efd9 [lldb][NFC] Remove unused MaterializeInitializer and MaterializeInternalVariable
llvm-svn: 369198
2019-08-17 21:57:51 +00:00
Adrian Prantl 69cef325a3 Simplify code (NFC).
llvm-svn: 369179
2019-08-17 00:38:58 +00:00
Jonas Devlieghere 3af3f1e8e2 [Utility] Reimplement RegularExpression on top of llvm::Regex
Originally I wanted to remove the RegularExpression class in Utility and
replace it with llvm::Regex. However, during that transition I noticed
that there are several places where need the regular expression string.
So instead I propose to keep the RegularExpression class and make it a
thin wrapper around llvm::Regex.

This patch also removes the workaround for empty regular expressions.
The result is that we are now (more or less) POSIX conformant.

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

llvm-svn: 369153
2019-08-16 21:25:36 +00:00
Raphael Isemann 4c78b78825 [lldb][NFC] Allow for-ranges on StringList
llvm-svn: 369113
2019-08-16 14:27:35 +00:00
Aaron Smith 5032c6ea08 [lldb-server] Disable a test on Windows until it can be fixed
llvm-svn: 369083
2019-08-16 03:49:41 +00:00
Jonas Devlieghere de0ce98abe [DebugLine] Don't try to guess the path style
In r368879 I made an attempt to guess the path style from the files in
the line table. After some consideration I now think this is a poor
idea. This patch undoes that behavior and instead adds an optional
argument to specify the path style. This allows us to make that decision
elsewhere where we have more information. In case of LLDB based on the
Unit.

llvm-svn: 369072
2019-08-15 23:53:15 +00:00
Jim Ingham 7049b0ad4d Stop-hooks weren't getting called on step-out. Fix that.
There was a little bit of logic in the StopInfoBreakpoint::PerformAction
that would null out the StopInfo once we had a completed plan so that the
next call to GetStopInfo would replace it with the StopInfoThreadPlan.

But the stop-hooks check for whether a thread stopped for a reason didn't
trigger this conversion.  So I added an API to do that directly, and then
called it where before we just reset the StopInfo.

<rdar://problem/54270767>

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

llvm-svn: 369052
2019-08-15 21:37:52 +00:00
Adrian Prantl 69ec60d821 Change test to use uint64_t to support compiling for 32-bit architectures.
llvm-svn: 369034
2019-08-15 18:37:11 +00:00
Raphael Isemann 2fc20f652c [lldb][NFC] Refactor remaining completion logic to use CompletionRequests
This patch moves the remaining completion functions from the
old completion API (that used several variables) to just
passing a single CompletionRequest.

This is for the most part a simple change as we just replace
the old arguments with a single CompletionRequest argument.

There are a few places where I had to create new CompletionRequests
in the called functions as CompletionRequests itself are immutable
and don't expose their internal match list anymore. This means that
if a function wanted to change the CompletionRequest or directly
access the result list, we need to work around this by creating
a new CompletionRequest and a temporary match/description list.

Preparation work for rdar://53769355

llvm-svn: 369000
2019-08-15 13:14:10 +00:00
Raphael Isemann 5c5408ce2c [lldb] Let LLDB depend on intrinsics_gen to fix non-deterministic module build failures
Summary:
When building with modules we currently fail randomly to build LLDB's modules and get error messages like below:
```
In file included from <module-includes>:1:
In file included from llvm-project/llvm/include/llvm/IR/Argument.h:18:
llvm-project/llvm/include/llvm/IR/Attributes.h:74:14: fatal error: 'llvm/IR/Attributes.inc' file not found
    #include "llvm/IR/Attributes.inc"
             ^~~~~~~~~~~~~~~~~~~~~~~~
...
In file included from llvm-project/lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp:9:
llvm-project/lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.h:12:10: fatal error: could not build module 'lldb_Wrapper'
```

The reason for this is that our source files can include Clang headers which in turn include files like Attributes.inc which
are generated by intrinsics_gen. However, it seems Clang can't express this dependency in its CMake code, so intrinsics_gen
is actually not guaranteed to be built before we start parsing LLDB source files and Clang headers. Clang worked around this
by letting all libraries depend on intrinsics_gen, which at least lets their builds pass.

As I haven't figured out how to solve these dependencies properly and I want to get the LLDB+Modules build green,
I suggest we copy Clang's hack until we figure out how to get Clang's dependencies right.

Reviewers: sgraenitz, aprantl, JDevlieghere

Reviewed By: JDevlieghere

Subscribers: mgorny, javed.absar, kristof.beyls, mgrang, lldb-commits

Tags: #lldb

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

llvm-svn: 368975
2019-08-15 07:29:53 +00:00
Jonas Devlieghere 706cd70569 Fix variable mismatch between signature and body
I updated the signature to conform to the LLDB coding style but
accidentally forgot to update the function body.

llvm-svn: 368962
2019-08-15 05:09:09 +00:00
Jonas Devlieghere a7d4cec437 [NFC] Fix documentation for some utility classes.
This fixes a few warnings emitted when compiling with -Wdocumentation.

llvm-svn: 368959
2019-08-15 04:35:46 +00:00
Shafik Yaghmour 62abe494fb Improve anonymous class heuristic in ClangASTContext::CreateRecordType
Summary:
Currently the heuristic used in ClangASTContext::CreateRecordType to identify an anonymous class is that there is that name is a nullptr or simply a null terminator. This heuristic is not accurate since it will also sweep up unnamed classes and lambdas. The improved heuristic relies on the requirement that an anonymous class must be contained within a class.

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

llvm-svn: 368937
2019-08-14 22:30:29 +00:00
Jonas Devlieghere a8f3ae7c9c [LLDB] Migrate llvm::make_unique to std::make_unique
Now that we've moved to C++14, we no longer need the llvm::make_unique
implementation from STLExtras.h. This patch is a mechanical replacement
of (hopefully) all the llvm::make_unique instances across the monorepo.

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

llvm-svn: 368933
2019-08-14 22:19:23 +00:00
Raphael Isemann 66214b581c Revert "[lldb] Reinstate original guard variable check"
It seems this breaks the following tests:
    lldb-Suite :: expression_command/call-function/TestCallUserDefinedFunction.py
    lldb-Suite :: expression_command/rdar42038760/TestScalarURem.py

Let's revert this patch and wait until we find an actual issue that could be
fixed by also doing the guard variable check on Windows.

llvm-svn: 368920
2019-08-14 21:21:14 +00:00
Jordan Rupprecht 4ee1376dc6 [lldb][NFC] Remove unused function
llvm-svn: 368904
2019-08-14 19:31:56 +00:00
Jonas Devlieghere c0a9b1edca [DebugLine] Improve path handling.
After switching over LLDB's line table parser to libDebugInfo, we
noticed two regressions on the Windows bot. The problem is that when
obtaining a file from the line table prologue, we append paths without
specifying a path style. This leads to incorrect results on Windows for
debug info containing Posix paths:

  0x0000000000201000: /tmp\b.c, is_start_of_statement = TRUE

This patch is an attempt to fix that by guessing the path style whenever
possible.

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

llvm-svn: 368879
2019-08-14 17:00:10 +00:00
Aaron Smith 8664998046 Add missing NativeProcessFactory for lldb-server on Windows
llvm-svn: 368872
2019-08-14 16:39:41 +00:00
Aaron Smith 03eacbd489 Add missing SetID method to fix Windows build
llvm-svn: 368852
2019-08-14 13:49:52 +00:00
Pavel Labath b8ee0dd723 Revert "Minidump/Windows: Fix module lookup"
Although there is nothing wrong with this patch, the test added here
uncovers a problem in other parts of the code which cause the test to
fail when running under asan. Reverting the patch until I can fix the
underlying issue(s).

This reverts commit r368416.

llvm-svn: 368838
2019-08-14 12:26:51 +00:00
Pavel Labath 72ef113d40 [API] Have SBCommandReturnObject::GetOutput/Error return "" instead of nullptr
Summary:
It seems this was an unintended side-effect of D26698. AFAICT, these
functions did return an empty string before that patch, and the patch
contained code which attempted to ensure that, but those efforts were
negated by ConstString::AsCString, which by default returns a nullptr
even for empty strings.

This patch:
- fixes the GetOutput/Error methods to really return empty strings
- adds and explicit test for that
- removes a workaround in lldbtest.py, which was masking this problem
  from our other tests

Reviewers: jingham, clayborg

Subscribers: zturner, lldb-commits

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

llvm-svn: 368806
2019-08-14 08:11:20 +00:00
Raphael Isemann afd493ea2b [lldb] Reinstate original guard variable check
The isGuardVariableSymbol option for ignoring Microsoft's ABI
was originally added to get the bots green, but now that we found
the actual issue (that we checked for prefix instead of suffix
in the MS ABI check), we should be able to properly implement
the guard variable check without any strange Microsoft exceptions.

llvm-svn: 368802
2019-08-14 05:52:33 +00:00
Jonas Devlieghere b6946a2d12 Fix warning: suggest braces around initialization of subobject
This patch adds braces to the DEFINE_XMM macro.

llvm-svn: 368782
2019-08-14 01:25:10 +00:00
Aaron Smith 2a39024ac8 Update Python tests for lldb-server on Windows
Summary: Thanks to Hui Huang and reviewers for all the help with this patch!

Reviewers: labath, jfb, clayborg

Reviewed By: labath

Subscribers: Hui, clayborg, dexonsmith, lldb-commits

Tags: #lldb

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

llvm-svn: 368776
2019-08-14 00:14:15 +00:00
Aaron Smith 216944ee03 Enable lldb-server on Windows
Summary:
This commit contains three small changes to enable lldb-server on Windows.

- Add lldb-server for Windows to the build
- Disable pty redirection on Windows for the initial lldb-server bring up
- Add a support to get the parent pid for a process on Windows
- Ifdef some signals which aren't supported on Windows

Thanks to Hui Huang for the help with this patch!

Reviewers: labath

Reviewed By: labath

Subscribers: JDevlieghere, compnerd, Hui, amccarth, xiaobai, srhines, mgorny, lldb-commits

Tags: #lldb

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

llvm-svn: 368774
2019-08-13 23:50:54 +00:00
Jonas Devlieghere 3cb3aa2ee8 [DebugLine] Be more robust in geussing the path style
My previous change didn't fix the Windows bot. This patch is an attempt
to make guessing the path style more robust by first looking at the
compile dir and falling back to the actual file if that's unsuccessful.

llvm-svn: 368772
2019-08-13 23:30:11 +00:00
Aaron Smith 5146a9ea5d Initial support for native debugging of x86/x64 Windows processes
Summary: Thanks to Hui Huang and the reviewers for all the help with this patch.

Reviewers: labath, Hui, jfb, clayborg, amccarth

Reviewed By: labath

Subscribers: amccarth, compnerd, dexonsmith, mgorny, jfb, teemperor, lldb-commits

Tags: #lldb

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

llvm-svn: 368759
2019-08-13 22:18:01 +00:00
Jonas Devlieghere 4d82fa6895 [DWARF] Guess the path style
Try to guess the FileSpec path style before defaulting to native.

llvm-svn: 368746
2019-08-13 21:00:27 +00:00
Jonas Devlieghere 235339357d [DWARF} Use LLVM's debug line parser in LLDB.
The line number table header was substantially revised in DWARF 5 and is
not fully supported by LLDB's current debug line implementation.

This patch replaces the LLDB debug line parser with its counterpart in
LLVM. This was possible because of the limited contact surface between
the code to parse the DWARF debug line section and the rest of LLDB.

We pay a small cost in terms of performance and memory usage. This is
something we plan to address in the near future.

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

llvm-svn: 368742
2019-08-13 19:51:51 +00:00
Alex Langford bddab07d4a [Symbol] Decouple clang from CompilerType
Summary:
Ideally CompilerType would have no knowledge of clang or any individual
TypeSystem. Decoupling clang is relatively straightforward.

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

llvm-svn: 368741
2019-08-13 19:40:36 +00:00
Raphael Isemann a23b25031e [lldb] Fix Microsoft guard variable detection
Apparently we need to check for a suffix, not a prefix. This broke
probably broke expression evaluation on Windows.

llvm-svn: 368695
2019-08-13 14:13:39 +00:00
Raphael Isemann 7f7b2966f7 [lldb] Reland "Refactor guard variable checks in IRForTarget"
It seems the broken guard variable check for Windows was a feature(TM)
and not a bug, so let's keep add a flag to the guard check that keeps
the old behavior in the places where we ignored guard variables before.

llvm-svn: 368688
2019-08-13 13:09:18 +00:00
Raphael Isemann 2515640aee [lldb][NFC] Add basic IOHandler completion test
We have no test coverage for the IOHandler code that is doing the
completion in the command line. This is adding a pexpect-based test
as a preparation for the switch to using CompletionRequest in the
whole completion machinery.

llvm-svn: 368679
2019-08-13 12:12:19 +00:00
Alex Langford f4446f1775 [Symbol] Remove redundant include
llvm-svn: 368638
2019-08-13 00:25:49 +00:00
Davide Italiano 7f9bbe0599 [CompilerType] Pass an ExecutionContextScope to GetTypeBitAlign.
llvm-svn: 368620
2019-08-12 21:49:54 +00:00
Stella Stamenova 532e724992 Revert "[lldb] Refactor guard variable checks in IRForTarget"
This reverts commit 94fbbf712e.

llvm-svn: 368616
2019-08-12 20:08:07 +00:00
Stella Stamenova e7daf78e05 Revert "[lldb] Fix dynamic_cast by no longer failing on variable without metadata"
This reverts commit b448d1bf21.

llvm-svn: 368615
2019-08-12 20:08:05 +00:00
Davide Italiano 36f13e4912 [Symbol] GetTypeBitAlign() should return None in case of failure.
Summary:
And not `zero`. This is the last API needed to be converted to
an Optional<T>.

Reviewers: xiaobai, compnerd

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 368614
2019-08-12 20:03:19 +00:00
Raphael Isemann df8bdcadf9 [lldb][NFC] Minor fixes for lldb_private::DiagnosticManager
llvm-svn: 368582
2019-08-12 14:37:12 +00:00
Raphael Isemann 8940687c6d [lldb] Remove undocumented return value from DiagnosticManager::PutString
The returned value is currently unused. It also seems to imply that
it somehow represents 'printf-style' the number of characters/bytes
written to some output stream (which is incorrect, as we only know
the actual size of the written message when we have rendered it,
e.g. via GetString and DiagnosticManagers have no associated
output stream).

llvm-svn: 368577
2019-08-12 14:11:37 +00:00
Raphael Isemann 5028654214 [lldb][NFC] Add unit test for lldb_private::DiagnosticManager
llvm-svn: 368567
2019-08-12 13:31:45 +00:00
Raphael Isemann b448d1bf21 [lldb] Fix dynamic_cast by no longer failing on variable without metadata
Summary:
Our IR rewriting infrastructure currently fails when it encounters a variable which has no metadata associated.
This causes dynamic_cast to fail as in this case IRForTarget considers the type info pointers ('@_ZTI...') to be
variables without associated metadata. As there are no variables for these internal variables, this is actually
not an error and dynamic_cast would work fine if we didn't throw this error.

This patch fixes this by removing this diagnostics code. In case we would actually hit a variable that has no
metadata (but is supposed to have), we still have the error in the expression log so this shouldn't make it
harder to diagnose any missing metadata errors.

This patch should fix dynamic_cast and also adds a bunch of test coverage to that language feature.

Fixes rdar://10813639

Reviewers: davide, labath

Reviewed By: labath

Subscribers: friss, labath, abidh, lldb-commits

Tags: #lldb

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

llvm-svn: 368511
2019-08-10 10:56:17 +00:00
Haibo Huang 575ce5da7d Small format fix
Differential Revision: https://reviews.llvm.org/D66034

llvm-svn: 368497
2019-08-09 22:59:56 +00:00
Haibo Huang a20a59d87a Detects whether RESOURCE_TYPE_IO is defined.
Summary: This fixes lldb build on macOS SDK prior to 10.12.

Reviewers: JDevlieghere

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 368496
2019-08-09 22:47:46 +00:00
Raphael Isemann 19351b24ca [lldb][NFC] Assert on invalid cursors positions when creating CompletionRequest
Before we just triggered undefined behavior on invalid positions.

llvm-svn: 368444
2019-08-09 14:32:50 +00:00
Raphael Isemann db7d874b71 [lldb][NFC] Remove unused IRForTarget::BuildRelocation
llvm-svn: 368442
2019-08-09 14:21:27 +00:00
Raphael Isemann ac42e741e0 [lldb][NFC] Unify InstrList typedef in IRForTarget
llvm-svn: 368425
2019-08-09 10:01:51 +00:00
Raphael Isemann 339b5d1ac2 [lldb][NFC] Fix warning about missing switch cases
These types were recently added in D62960 but it seems the patch didn't
consider LLDB which causes a bunch of compiler warnings about
missing enum values. It seems this feature isn't fully implemented yet,
so I don't think we can write any test for this. For now lets just add
the missing types to our usual list of unsupported types.

llvm-svn: 368424
2019-08-09 09:58:47 +00:00
Raphael Isemann 94fbbf712e [lldb] Refactor guard variable checks in IRForTarget
Not NFC as this will probably fix a wrong guard variable check
on Windows. Not sure though what Windows test can now be safely
enabled.

llvm-svn: 368417
2019-08-09 09:27:04 +00:00
Pavel Labath af1744cd6e Minidump/Windows: Fix module lookup
Summary:
When opening a minidump, we were failing to find an executable because
we were searching for i386-unknown-windows, whereas we recognize the
pe/coff files as i386-pc-windows. This fixes the triple computation code
in the minidump parser to match pe/coff, and adds an appropriate test.

NB: I'm not sure setting the vendor to "pc" is really correct for
arm(64) windows, but right now that seems to match what we do in the
pe/coff case (ArchSpec.cpp:935).

Reviewers: clayborg, amccarth

Subscribers: javed.absar, kristof.beyls, rnk, markmentovai, lldb-commits

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

llvm-svn: 368416
2019-08-09 09:10:50 +00:00
Raphael Isemann 4ef50a33b1 [lldb][NFC] Clean up logging in IRForTarget
llvm-svn: 368415
2019-08-09 08:54:01 +00:00
Raphael Isemann 474d70b220 [lldb][NFC] Remove last C string uses from IRForTarget
llvm-svn: 368406
2019-08-09 08:10:02 +00:00
Raphael Isemann dced445b24 [lldb][NFC] Use range-based for-loops in IRForTarget
llvm-svn: 368405
2019-08-09 07:59:18 +00:00
Raphael Isemann 50f7e945ee [lldb][NFC] Modernize IRForTarget::CreateResultVariable
llvm-svn: 368359
2019-08-08 22:19:16 +00:00
Raphael Isemann a7040525ce [lldb][NFC] Move to StringRef in some places in IRForTarget
llvm-svn: 368353
2019-08-08 21:43:21 +00:00
Haibo Huang 7debc93afc [lldb] Fix HAVE_LIBCOMPRESSION
Summary:
This test doesn't make sense. Change to be consistent with what we did
in GDBRemoteCommunication.cpp.

Reviewers: labath

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 368352
2019-08-08 21:42:33 +00:00
Raphael Isemann 7491f36494 [lldb][NFC] Directly use StringRef instead of temporary std::string
llvm-svn: 368346
2019-08-08 21:22:21 +00:00
Adrian Prantl fe9eaadd68 SymbolFileDWARF: Unconditionally scan through clang modules. NFCish
When looking up a type by name, also scan through any referenced Clang
modules regardsless of whether a type with this name has been
found. This is NFCish (= a potential performance regression) for Clang
projects, but necessary in mixed Swift and Objective-C projects (and
tested in swift-lldb).

This only affects projects compiled with -gmodules that were not run
through dsymutil.

llvm-svn: 368345
2019-08-08 21:16:01 +00:00
Jim Ingham 8240b0d7fe Fix a comment which was incorrect.
llvm-svn: 368340
2019-08-08 20:47:40 +00:00
Adrian Prantl d9cbd2acfa Remove unused and undocumented data_offset parameter (NFC)
Value::GetValueAsData() takes an undocumented parameter called
data_offset that is always 0.

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

llvm-svn: 368330
2019-08-08 19:22:32 +00:00
Raphael Isemann 0e5eef5c8f [lldb][NFC] Simplify return in MaybeHandleVariable
This function anyway returns true, no need to do this extra work.

llvm-svn: 368309
2019-08-08 16:41:32 +00:00
Stefan Granitz c822ab8f9a [lldb][CMake] Disable modules in Xcode projects
Summary: Apparently, module-enabled builds clash with Xcode's analysis.

Reviewers: aprantl, jingham, davide, teemperor

Reviewed By: davide

Subscribers: mgorny, lldb-commits, #lldb

Tags: #lldb

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

llvm-svn: 368294
2019-08-08 13:39:25 +00:00
Pavel Labath 88c77d6752 ObjectFileELF: Convert a unit test to a lit test
It is much easier to test this functionality via lldb-test.

llvm-svn: 368289
2019-08-08 12:57:46 +00:00
Pavel Labath 0de33de813 Fix LLDB_CONFIGURATION_DEBUG builds for the GetSymbolVendor removal
fix one usage that is ifdefed-out in non-debug builds.

llvm-svn: 368279
2019-08-08 11:49:55 +00:00
Pavel Labath 6db975b7b8 Add a missing include to SymbolFilePDBTests.cpp
This should _really_ fix the pdb unit tests.

llvm-svn: 368271
2019-08-08 09:43:20 +00:00
Pavel Labath bac7862c00 Remove xcode-specific Config.h
Summary:
Now that the xcode project is removed, we no longer need/use the
hand-maintained Config.h file, as everything is configured through
cmake.

This patch deletes that file and reverts some of the changes from
r300372, which were made to support this use case.

Reviewers: sgraenitz, beanz

Subscribers: mgorny, lldb-commits

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

llvm-svn: 368266
2019-08-08 08:27:25 +00:00
Pavel Labath 959e603456 Fix PDB unit tests for the GetSymbolVendor deletion
llvm-svn: 368265
2019-08-08 08:22:26 +00:00
Pavel Labath 579d6d1aa5 Remove Module::GetSymbolVendor
Summary:
This patch removes the GetSymbolVendor function, and the various
mentions of the SymbolVendor in the Module class. The implementation of
GetSymbolVendor is "inlined" into the GetSymbolFile class which I
created earlier.

After this patch, the SymbolVendor class still exists inside the Module
object, but only as an implementation detail -- a fancy holder for the
SymbolFile. That will be removed in the next patch.

Reviewers: clayborg, JDevlieghere, jingham, jdoerfert

Subscribers: jfb, lldb-commits

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

llvm-svn: 368263
2019-08-08 07:34:07 +00:00
Davide Italiano e04c62bb23 [Materializer] Remove wrong SetSizeAndAlignmentFromType().
This function is unused.  It's also wrong, because it computes
the size and the alignment of the type without asking the runtime,
so it doesn't work for any language that has one (e.g. swift).

One could consider re-implementing this passing an execution scope
context, and modifying GetTypeBitAlign() to do the right thing,
but given there are no uses, it's not really useful.

llvm-svn: 368249
2019-08-08 03:15:48 +00:00
Jonas Devlieghere b78c8a0a35 [Utility] Remove unused function 'GetMatchSpanningIndices'
llvm-svn: 368243
2019-08-08 01:44:03 +00:00
Jonas Devlieghere 30703de3a7 [Docs] Fix (incorrect) code highlighting
llvm-svn: 368233
2019-08-07 23:12:40 +00:00
Adrian Prantl f81d6fe75c Adjust a ValueObjectChild's offset when the child is a bitfield
If a bitfield doesn't fit into the child_byte_size'd window at
child_byte_offset, move the window forward until it fits.  The problem
here is that Value has no notion of bitfields and thus the Value's
DataExtractor is sized like the bitfields CompilerType; a sequence of
bitfields, however, can be larger than their underlying type.

This was not in the big-endian-derived DWARF 2 bitfield attributes
because their offsets were counted from the end of the window, so they
always fit.

rdar://problem/53132189

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

llvm-svn: 368226
2019-08-07 22:40:05 +00:00
Jonas Devlieghere 333f14d52d [CommandObject] Remove unused function
llvm-svn: 368208
2019-08-07 20:56:17 +00:00
Alex Langford 4cd04547f5 [Symbol] Remove commented out code from CompileUnit
llvm-svn: 368205
2019-08-07 20:51:21 +00:00
Nico Weber 8883ec7da2 Add support for deterministically linked binaries on macOS to lldb.
When ld64 links a binary deterministically using the flag ZERO_AR_DATE,
it sets a timestamp of 0 for N_OSO members in the symtab section, rather
than the usual last modified date of the object file. Prior to this
patch, lldb would compare the timestamp from the N_OSO member against
the last modified date of the object file, and skip loading the object
file if there was a mismatch. This patch updates the logic to ignore the
timestamp check if the N_OSO member has timestamp 0.

The original logic was added in https://reviews.llvm.org/rL181631 as a
safety check to avoid problems when debugging if the object file was out
of date. This was prior to the introduction of deterministic build in
ld64. lld still doesn't support deterministic build.

Other code in llvm already relies on and uses the assumption that a
timestamp of 0 means deterministic build. For example, commit
9ccfddc39d adds similar timestamp checking
logic to dsymutil, but special cases timestamp 0. Likewise, commit
0d1bb79a04 adds a long comment describing
deterministic archive, which mostly uses timestamp 0 for determinism.

Patch from Erik Chen <erikchen@chromium.org>!

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

llvm-svn: 368199
2019-08-07 19:29:04 +00:00
Jonas Devlieghere 9f75418e1a [Driver] Expand the executable path in the target create output
Resolve the path in the target create output. This is nice when passing
relative paths to the lldb command line driver.

  $ lldb ./binary
  (lldb) target create "./binary"
  Current executable set to '/absolute/path/to/binary' (x86_64).

This change only affects the target create output and does not change
the debugger's behavior. It doesn't resolve symbolic links so it won't
cause confusing when debugging something like clang++ that's symlinked
to clang.

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

llvm-svn: 368182
2019-08-07 16:21:40 +00:00
Jonas Devlieghere af0c828a1e [ExecutionContext] Return the target/process byte order.
Currently ExecutionContext::GetByteOrder() always returns the host byte
order. This seems like a simple mistake: the return keyword appears to
have been omitted by accident. This patch fixes that and adds a unit
test.

Bugreport: https://llvm.org/PR37950

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

llvm-svn: 368181
2019-08-07 16:09:35 +00:00
Pavel Labath b9f31b6f4e ProcessElfCore: Remove linux and freebsd NT_*** constants
These are already defined in llvm/BinaryFormat/ELF.h. Leaving the NetBSD
and OpenBSD constants as-is, as they have no llvm counterparts.

llvm-svn: 368168
2019-08-07 13:12:59 +00:00
Pavel Labath 8280730f96 ObjectFileELF: Remove NT_*** constants
llvm now has definitions of those in BinaryFormat/ELF.h. Use those
instead.

llvm-svn: 368159
2019-08-07 12:13:48 +00:00
Pavel Labath b53203ec1f A more robust way of testing debug_line parser near the end of module
Summary:
While removing -z separate-code makes lld produce place the code at the
end of a segment right now, it's possible that future changes to the
linker will change that, thereby removing the coverage for the changes
in r367983. This patch adds a linker script to one of the line table
tests, which ensures that the code (and its line table) will be placed
at the very end of a module.

Reviewers: MaskRay

Subscribers: lldb-commits

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

llvm-svn: 368154
2019-08-07 11:33:56 +00:00
Stefan Granitz f241001793 [lldb][CMake] Workaround debugserver code-signing issue in generated Xcode project
Summary:
Explicitly code-sign the LLDB.framework copy of debugserver in the build-tree. This is necessary, because the Xcode-specific logic in `llvm_codesign` [1] has the side-effect that Xcode code-signs after post-build steps (here: after copying debugserver over into the framework). The special case for Xcode was necessary to avoid double-signing errors in the past (see D55116 and D55816).

[1] https://github.com/llvm/llvm-project/blob/36fb93982f0e/llvm/cmake/modules/AddLLVM.cmake#L1676

Reviewers: jingham, davide, JDevlieghere, teemperor

Reviewed By: JDevlieghere

Subscribers: beanz, mgorny, lldb-commits, #lldb

Tags: #lldb

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

llvm-svn: 368151
2019-08-07 11:02:04 +00:00
Raphael Isemann 44b8e5f4a6 [lldb][NFC] Remove commented out code in ClangASTContext::AddMethodToCXXRecordType
llvm-svn: 368150
2019-08-07 10:59:34 +00:00
Stefan Granitz befde45a6f [lldb][CMake] Fix one more detail in r368066
Differential Revision: https://reviews.llvm.org/D65797

llvm-svn: 368148
2019-08-07 10:47:49 +00:00
Stefan Granitz efd0e11b26 [lldb][NFC] Fix typo in 368066
Differential Revision: https://reviews.llvm.org/D65797

llvm-svn: 368143
2019-08-07 10:03:11 +00:00
Haibo Huang c6551bf013 Detect HAVE_SYS_TYPES_H in lldb
Summary:
After rL368069 I noticed that HAVE_SYS_TYPES_H is not defined in
Platform.h, or anywhere else in lldb. This change fixes that.

Reviewers: labath

Subscribers: mgorny, lldb-commits

Tags: #lldb

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

llvm-svn: 368125
2019-08-07 06:15:01 +00:00
Jason Molenda 6cebeafac3 Upstream a few small Apple changes to debugserver - arm64_32, Catalyst
Adrian's changes to support Catalyst processes and my
changes to support debugserver running on an arm64_32
device (Apple Watch Series 4, which uses an IPL32 model
on arm64 cpus).

llvm-svn: 368118
2019-08-07 02:06:06 +00:00
Jonas Devlieghere 171dd2e6e5 [Gardening] Remove more dead code from IOHandler
Remove more dead code and reformat the file.

llvm-svn: 368116
2019-08-07 01:50:03 +00:00
Raphael Isemann 4c7b28d6bb [lldb][NFC] Minor refactorings to (Clang)ExpressionSourceCode
llvm-svn: 368082
2019-08-06 20:25:02 +00:00
Alex Langford 5fdf10bae8 [SymbolFile] Remove commented out method
llvm-svn: 368075
2019-08-06 19:47:08 +00:00
Haibo Huang a63417fe6c Various build fixes for lldb on MinGW
Subscribers: mstorsjo, lldb-commits

Tags: #lldb

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

llvm-svn: 368069
2019-08-06 18:20:43 +00:00
Stefan Granitz 7f34a3652e [lldb][CMake] Generating Xcode projects
Summary:
Print a warning if the wrong cache script is used when generating a Xcode project, because it's too easy to confuse with Apple-lldb-macOS.cmake

```
  When building with Xcode, we recommend using the corresponding cache
  script.  If this was a mistake, clean your build directory and re-run
  CMake with:

    -C /path/to/llvm-project/lldb/cmake/caches/Apple-lldb-Xcode.cmake

  See: https://lldb.llvm.org/resources/build.html#cmakegeneratedxcodeproject
```

Also set the generator inside the cache script.

Reviewers: JDevlieghere, jingham, clayborg

Reviewed By: JDevlieghere

Subscribers: mgorny, lldb-commits, #lldb

Tags: #lldb

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

llvm-svn: 368066
2019-08-06 17:21:34 +00:00
Igor Kudrin 0be738895c Update LLDB to follow changes in llvm::DWARFDebugNames::NameIndex (4/5)
Differential Revision: https://reviews.llvm.org/D65640

llvm-svn: 368033
2019-08-06 13:38:27 +00:00
Pavel Labath 1177bc597d ObjectFileELF: permit thread-local sections with overlapping file addresses
Summary:
In an attempt to make file-address-based lookups more predictable, in D55998
we started ignoring sections which would result in file address
overlaps. It turns out this was too aggressive because thread-local
sections typically will have file addresses which apear to overlap
regular data/code. This does not cause a problem at runtime because
thread-local sections are loaded into memory using special logic, but it
can cause problems for lldb when trying to lookup objects by their file
address.

This patch changes ObjectFileELF to permit thread-local sections to
overlap regular ones by essentially giving them a separate address
space. It also makes them more symmetrical to regular sections by
creating container sections from PT_TLS segments.

Simultaneously, the patch changes the regular file address lookup logic
to ignore sections with the thread-specific bit set. I believe this is
what the users looking up file addresses would typically expect, as
looking up thread-local data generally requires more complex logic (e.g.
DWARF has a special opcode for that).

Reviewers: clayborg, jingham, MaskRay

Subscribers: emaste, aprantl, arichardson, lldb-commits

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

llvm-svn: 368010
2019-08-06 10:04:27 +00:00
Pavel Labath 465eae3669 SymbolVendor: Remove passthrough methods
After the recent refactorings the SymbolVendor passthrough no longer
serve any purpose. This patch removes those methods, and updates all
callsites to go to the symbol file directly -- in most cases that just
means calling GetSymbolFile()->foo() instead of
GetSymbolVendor()->foo().

llvm-svn: 368001
2019-08-06 09:12:42 +00:00
Pavel Labath 001ecbde11 SymbolVendorELF: Perform build-id lookup even without a debug link
Summary:
The debug link and build-id lookups are two independent ways one can
search for a separate symbol file. However, our implementation in
SymbolVendorELF was tying the two together and refusing to look up the
symbol file based on a build id if the file did not contain a debug
link.

This patch makes it possible to search for the symbol file with
just one of the two methods available. To demonstrate, I split the
build-id-case test into two, so that we test the search using both
methods.

Reviewers: jankratochvil, mgorny, clayborg, espindola, alexshap

Subscribers: emaste, arichardson, MaskRay, lldb-commits

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

llvm-svn: 367994
2019-08-06 08:18:39 +00:00
Raphael Isemann efe5fd16d1 [lldb][NFC] Remove unnecessary cast in ClangUserExpression
llvm-svn: 367989
2019-08-06 08:07:45 +00:00
Pavel Labath a3bdcdf714 Fix line table resolution near the end of a section
Summary:
lld r367537 changed the way the linker organizes sections and segments.
This exposed an lldb bug and caused some tests to fail.

In all of the failing tests the root cause was the same -- when we were
trying to resolve the last address in the line_table section, we failed
because it pointed past the end of the section.

This patch changes the line table address resolution code to back up the
address by one for end-of-sequence entries. This ensures the address
still points inside a section/module even if the line table sequence
ends at the very end of a section.

It also reverts the linker flags which were added to the failing tests
to restore previous behavior.

Reviewers: clayborg, jingham

Subscribers: mgorny, MaskRay, lldb-commits

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

llvm-svn: 367983
2019-08-06 06:52:05 +00:00
Jonas Devlieghere d099c89391 [Gardening] Remove dead code from ASTDumper (NFC)
These functions are not referenced.

llvm-svn: 367978
2019-08-06 04:46:02 +00:00
Jonas Devlieghere ea1752a79a [Gardening] Remove dead code from ScriptInterpreterPython (NFC)
The terminal state is never saved or restored.

llvm-svn: 367977
2019-08-06 04:45:59 +00:00
Jonas Devlieghere 3c3dce2545 [Gardening] Remove dead code from IOHandler (NFC)
These functions are not referenced.

llvm-svn: 367976
2019-08-06 04:45:55 +00:00
Jonas Devlieghere 78dfc945b0 Remove unused function 'SetMangledCounterparts' (NFC)
This function is not referenced.

llvm-svn: 367975
2019-08-06 04:01:58 +00:00
Davide Italiano 78f05d3599 Revert "[CompilerType] Simplify the interface a bit more.."
There's actually a test downstream that fails with this.
I think we can still get rid of it, but I need to do some work
there first.

llvm-svn: 367963
2019-08-06 00:42:11 +00:00
Davide Italiano b31f60b9c2 [CompilerType] Simplify the interface a bit more..
Summary:
.. removing IsMeaninglessWithoutTypeResolution(). I'm fairly
confident this was introduced to support swift, where
static types [without dynamic counterpart] don't carry a lot
of value. Since then, the formatters and dynamic type resolution
has been rewritten, and we employ different solutions. This function
is unused here too, so let's get read of it.

<rdar://problem/36377967>

Reviewers: shafik, JDevlieghere, alex, compnerd, teemperor

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 367957
2019-08-06 00:01:52 +00:00
Jonas Devlieghere 9bb525adb2 [CMake] Remove check for the readline target.
This was introduced when we were building a custom readline Python
module on Linux [1]. Now that the readline  target doesn't exist
anymore, it's safe to remove this dependency.

This fixes https://llvm.org/PR25136

[1] https://reviews.llvm.org/D13268

llvm-svn: 367956
2019-08-05 23:54:13 +00:00
Davide Italiano d32d5db4da [CompilerType] Remove an unused function.
Summary:
This simplifies the interface, as I'm trying to understand how
we can upstream swift support.

<rdar://problem/36377967>

Reviewers: teemperor, JDevlieghere, xiaobai, compnerd, friss

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 367946
2019-08-05 23:18:00 +00:00
Raphael Isemann 9de7169053 [lldb][NFC] Document and refactor ClangPersistentVariables::RemovePersistentVariable
llvm-svn: 367936
2019-08-05 21:43:53 +00:00
Raphael Isemann 5eb87cf30f [lldb][NFC] Refactor ClangUserExpression::UpdateLanguageForExpr
The UpdateLanguageForExpr should only update the language, but over
time it started to do also do different things related to the generation
of the expression source code. This patch refactors all the source code
generation part into its own function.

llvm-svn: 367922
2019-08-05 20:31:47 +00:00
Nilanjana Basu da60fc813c Changing representation of .cv_def_range directives in Codeview debug info assembly format for better readability
llvm-svn: 367867
2019-08-05 14:16:58 +00:00
Rainer Orth 6ca1707b23 [lldb][clang] Reflect LangStandard.h move to clang/Basic
D65562 <https://reviews.llvm.org/D65562> moves LangStandard.h from clang/Frontend to clang/Basic.  This patch
adjusts the single file in lldb that uses it to match.

Tested on x86_64-pc-linux-gnu.

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

llvm-svn: 367865
2019-08-05 14:00:43 +00:00
Nilanjana Basu b5e4d7de17 Revert "Changing representation of .cv_def_range directives in Codeview debug info assembly format for better readability"
This reverts commit a885afa9fa.

llvm-svn: 367861
2019-08-05 13:55:21 +00:00
Raphael Isemann 2fb7cf8236 [lldb][NFC] Fix documentation for ClangPersistentVariables::m_next_persistent_variable_id
llvm-svn: 367857
2019-08-05 13:40:39 +00:00
Nilanjana Basu a885afa9fa Changing representation of .cv_def_range directives in Codeview debug info assembly format for better readability
llvm-svn: 367850
2019-08-05 13:11:51 +00:00
Raphael Isemann f619e0cd77 [lldb][NFC] Clang format GetNextPersistentVariableName signature
llvm-svn: 367843
2019-08-05 12:37:54 +00:00
Raphael Isemann 6c64a9b8ab [lldb] Move redundant persistent variable counter to ClangPersistentVariables
Currently Target::m_next_persistent_variable_index is counting up
for our persistent variables ($0, $1, ...) but we also have a
unused counter that is supposed to do this in
ClangPersistentVariables but that stays always at 0 (because
we currently increase the target counter when we should increase
that unused counter).

This patch removes the counter in Target and lets the documented
counter in ClangPersistentVariables do the variable counting.

Patch *should* be NFC, but it might unexpectedly bring LLDB to
new code paths that could contain exciting new bugs to fix.

llvm-svn: 367842
2019-08-05 12:32:59 +00:00
Pavel Labath 5a7e1e978f Fix PDB tests after r367820
The commit changed Module dumping code to call SymbolFile::Dump
directly, which meant that we were no longer showing the plugin name in
the output (as that was done in the SymbolVendor).

This adds the plugin name printing code to the SymbolFile dump method,
and tweak the assertions in the PDB tests to match it correctly.

llvm-svn: 367835
2019-08-05 11:29:01 +00:00
Raphael Isemann 08f81513e9 [lldb][NFC] Remove unimplemented ClangExpressionSourceCode::GetNumBodyLines
llvm-svn: 367830
2019-08-05 11:08:47 +00:00
Pavel Labath bfb261baca ObjectFile[ELF]: Refactor gnu_debuglink interface
Summary:
The contents of the gnu_debuglink section were passed through the
GetDebugSymbolFilePaths interface, which was more generic than needed.
As the only class implementing this function is ObjectFileELF, we can
modify the function to return just a single FileSpec (instead of a
list). Also, since the SymbolVendorELF already assumes ELF object files,
we don't have to make this method available on the generic ObjectFile
interface -- instead we can put it on ObjectFileELF directly.

This change also makes is so that if the Module has an explicit symbol
file spec set, we disregard the value the value of the debug link
(instead of doing a secondary lookup using that). I think it makes sense
to honor the users wishes if he had explicitly set the symbol file spec,
and this seems to be consistent with what SymbolVendorMacOSX is doing
(SymbolVendorMacOSX.cpp:125).

The main reason for making these changes is to make the treatment of
build-ids and debug links simpler in the follow-up patch.

Reviewers: clayborg, jankratochvil, mgorny, espindola

Subscribers: emaste, arichardson, MaskRay, lldb-commits

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

llvm-svn: 367824
2019-08-05 09:55:07 +00:00
Pavel Labath d5d47a3574 Remove SymbolVendor::GetSymtab
Summary:
This patch removes the GetSymtab method from the SymbolVendor, which is
a no-op as it's implementation just forwards to the relevant SymbolFile.
Instead it creates a Module::GetSymtab, which calls the SymbolFile
method directly.

All callers have been updated to use the Module method directly instead
of a two phase GetSymbolVendor->GetSymtab search, which leads to reduced
intentation in a lot of deeply nested code.

Reviewers: clayborg, JDevlieghere, jingham

Subscribers: lldb-commits

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

llvm-svn: 367820
2019-08-05 09:21:47 +00:00
Pavel Labath 3d4f7655e7 Remove usage of usleep in generic code
This function is not portable, and there are only a handful of usages of
it anyway. Replacing it with std::this_thread::sleep_for enables us to
get rid of the compatibility code in PosixApi.h.

llvm-svn: 367814
2019-08-05 08:23:25 +00:00
Fangrui Song d9b948b6eb Rename F_{None,Text,Append} to OF_{None,Text,Append}. NFC
F_{None,Text,Append} are kept for compatibility since r334221.

llvm-svn: 367800
2019-08-05 05:43:48 +00:00