Commit Graph

19460 Commits

Author SHA1 Message Date
Pavel Labath 0261b9498b DWARF: Port most of other sections over to DWARFContext
This moves the sections from SymbolFileDWARF to DWARFContext, where it
was trivial to do so. A couple of sections are still left in
SymbolFileDWARF. These will be handled by separate patches.

llvm-svn: 361127
2019-05-20 08:38:47 +00:00
Pavel Labath 64b846d588 minidump: Remove checked-in files used for testing MemoryList handling
Now that yaml2obj supports this stream, we can use the yaml form
instead.

llvm-svn: 361126
2019-05-20 08:22:59 +00:00
Michal Gorny f8fccb14de [lldb] [lit] Skip more tests when Python is unavailable
LocalLLDBInit.test requires Python module loading support.
CommandScriptImmediateOutput tests are specific to running scripts.
Disable all of them when Python support is disabled.

llvm-svn: 361115
2019-05-19 09:27:52 +00:00
Michal Gorny 6f356784be [lldb] [lit] Driver/TestConvenienceVariables.test requires Python
Differential Revision: https://reviews.llvm.org/D62096

llvm-svn: 361114
2019-05-19 06:05:31 +00:00
Davide Italiano 8803124d23 [crashlog] Use loads() instead of readPlistFromString() for python 3.
<rdar://problem/50903413>

llvm-svn: 361087
2019-05-18 01:57:12 +00:00
Alex Langford 38cc896f00 Revert "Fix IPv6 support on lldb-server platform"
This reverts commit c28f81797084b8416ff5be4f9e79000a9741ca6a.
This reverts commit 7e79b64642486f510f7872174eb831df68d65b84.

Looks like there is more work to be done on this patch. I've spoken to
the author and for the time being we will revert to keep the buildbots
green.

llvm-svn: 361086
2019-05-18 01:09:44 +00:00
Alex Langford f9399de525 Unbreak windows build bot
Commit c28f81797084b8416ff5be4f9e79000a9741ca6a (svn r361079)
broke the windows buildbot. This should fix it.

llvm-svn: 361083
2019-05-18 00:09:43 +00:00
Jonas Devlieghere 2fc6b024b9 [CommandInterpreter] Refactor SourceInitFile
I was looking at the current implementation of SourceInitFile and there
were a few things that made this function hard to read:

 * The code to find the ~/.lldbinit file is duplicated across the cwd
   and non-cwd branch.
 * The ./.lldbinit is once computed by resolving .lldbinit and once by
   resolving ./.lldbinit.
 * It wasn't clear to me what happened when you're sourcing the
   .lldbinit file in the current working directory. Apparently we do
   nothing when we property to control that is set to warn (makes sense)
   and we don't care when the property is set to true (debatable).
 * There were at least two branches where the status of the
   CommandReturnObject were not set.

This patch attempts to simplify that code.

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

llvm-svn: 361080
2019-05-17 22:53:04 +00:00
Alex Langford d84d02e197 Fix IPv6 support on lldb-server platform
This is a general fix for the ConnectionFileDescriptor class but my main
motivation was to make lldb-server working with IPv6.
The connect URI can use square brackets ([]) to wrap the interface part
of the URI (e.g.: <scheme>://[<interface>]:<port>). For IPv6 addresses
this is a must since its ip can include colons and it will overlap with
the port colon otherwise. The URIParser class parses the square brackets
correctly but the ConnectionFileDescriptor doesn't generate them for
IPv6 addresses making it impossible to connect to the gdb server when
using this protocol.

How to reproduce the issue:

$ lldb-server p --server --listen [::1]:8080
...
$ lldb
(lldb) platform select remote-macosx
(lldb) platform connect connect://[::1]:8080
(lldb) platform process -p <pid>
error: unable to launch a GDB server on 'computer'

The server was actually launched we were just not able to connect to it.
With this fix lldb will correctly connect. I fixed this by wrapping the
ip portion with [].

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

Patch by António Afonso <antonio.afonso@gmail.com>

llvm-svn: 361079
2019-05-17 22:30:53 +00:00
Davide Italiano 53f68c5764 [EditLine] Check string pointers before dereferencing them.
Get*AtIndex() can return nullptr. This only happens in the swift
REPL support, so it's hard to test upstream.

<rdar://problem/50875178>

llvm-svn: 361078
2019-05-17 21:49:17 +00:00
Stefan Granitz fd0779181f [CMake] Add first CMake cache files
Summary:
CMake cache scripts pre-populate the CMakeCache in a build directory with commonly used settings.
The CMake invocation from D61952 could look like this:

```
cmake -G Ninja -C /path/to/llvm-project/lldb/cmake/caches/Apple-lldb-osx.cmake -DLLVM_ENABLE_PROJECTS="clang;libcxx;libcxxabi;lldb" ../llvm-project/llvm
```

Options specified on the command line will override options in the cache files (as long as caches don't use `FORCE`).
What do you think? (This is a first proposal and not set in stone.)

Reviewers: xiaobai, compnerd, JDevlieghere, aprantl, labath

Subscribers: mgorny, lldb-commits, #lldb

Tags: #lldb

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

llvm-svn: 361069
2019-05-17 19:19:41 +00:00
Stefan Granitz dcc477e38c [CMake] Inline info plist in lldb driver
llvm-svn: 361068
2019-05-17 19:19:34 +00:00
Stella Stamenova 5bac706343 [CommandInterpreter] Fix trailing blanks after `all` or [0-9]+ for bt
The change that was committed for this used \\s to match spaces which does not work correctly on all platforms. Using [:space:] makes the test pass on both Linux and Windows

llvm-svn: 361064
2019-05-17 18:52:42 +00:00
Adrian Prantl 5d95b11b6b Update list of supported architectures.
llvm-svn: 361049
2019-05-17 17:05:23 +00:00
Jonas Devlieghere 777cad2c44 [Docs] Remove SVN checkout from LLDB build steps
This removes several older paragraphs in the LLDB build steps for Unix
systems which suggested checking out various components via SVN. Since
there's a separate page about getting the LLDB source which only
mentions Git, it seems appropriate to remove this older info from the
build docs.

Patch by: J. Ryan Stinnett

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

llvm-svn: 361046
2019-05-17 16:22:26 +00:00
Pavel Labath 62370dd0e0 minidump: Use MemoryList parsing code from llvm
llvm-svn: 361010
2019-05-17 09:47:34 +00:00
Pavel Labath ff9b4263f9 Make DWARFContext dwo-aware and port debug_info sections over
Summary:
The previous attempt and moving section handling over to DWARFContext
(D59611) failed because it did not take into account the dwo sections
correctly. All DWARFContexts (even those in SymbolFileDWARFDwo) used the
main module for loading the sections, but in the dwo scenario some
sections should come from the dwo file.

This patch fixes that by making the DWARFContext aware of whether it a
dwo context or a regular one. A dwo context gets two sections lists, and
it knows where to look for a particular type of a section. This isn't
fully consistent with how the llvm DWARFContext behaves, because that
one leaves it up to the user to know whether it should ask for a dwo
section or not. However, for the time being, it seems useful to have a
single entity which knows how to peice together the debug info in dwo
and non-dwo scenarios. The rough roadmap for the future is:
- port over the rest of the sections to DWARFContext
- find a way to get rid of SymbolFileDWARFDwo/Dwp/DwpDwo. This will
  likely involve adding the ability for the DWARFContext to spawn
  dwo sub-contexts, similarly to how it's done in llvm.
- get rid of the special handling of the "dwo" contexts by making
  sure everything knows whether it should ask for the .dwo version of
  the section or not (similarly to how llvm's DWARFUnits do that)

To demonstrate how the DWARFContext should behave in this new world, I
port the debug_info section (which is debug_info.dwo in the dwo file)
handling to DWARFContext. The rest of the sections will come in
subsequent patches.

Reviewers: aprantl, clayborg, JDevlieghere

Subscribers: zturner, lldb-commits

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

llvm-svn: 361000
2019-05-17 08:26:58 +00:00
Jonas Devlieghere 65cab8c639 [Docs] Fix headings in remote debugging
Add the proper headings instead of using just a bold font. Also add the
local ToC.

llvm-svn: 360971
2019-05-17 01:38:16 +00:00
Jonas Devlieghere 1e0ec81cf1 [Docs] Remove architectures from feature matrix
This is outdated, there's a bunch of architectures missing. If we want
them to be part of this table they should be a separate row anyway.

llvm-svn: 360967
2019-05-17 01:04:37 +00:00
Davide Italiano d768ee2140 [CommandInterpreter] Accept blanks after `all` or [0-9]+ for bt.
Previously "bt all    " would've failed as the regex didn't match
them.

Over the shoulder review by Jonas Devlieghere.

<rdar://problem/50824935>

llvm-svn: 360966
2019-05-17 01:03:21 +00:00
Jonas Devlieghere b5d7ad1d9a [Docs] Unify sidebar padding
Unify the padding across list items and the list header.

llvm-svn: 360964
2019-05-17 00:45:05 +00:00
Adrian Prantl 2b9a3ea13f Slightly update the macOS part of status.rst to be less out-of-date.
llvm-svn: 360956
2019-05-16 23:39:08 +00:00
Alex Langford d2284128a9 [Target] Stop linking against lldbPluginObjCLanguage
llvm-svn: 360945
2019-05-16 22:01:25 +00:00
Adrian Prantl de2cc01286 Factor out switch statement into a helper function (NFC)
This addresses post-commit review feedback for https://reviews.llvm.org/D62015.

llvm-svn: 360930
2019-05-16 20:03:05 +00:00
Adrian Prantl 431dd943a1 Make sure GetObjectDescription falls back to the Objective-C runtime.
This fixes an unintended regression introduced by
https://reviews.llvm.org/D61451 by making sure the Objective-C runtime
is also tried when the "correct" language runtime failed to return an
object description.

rdar://problem/50791055

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

llvm-svn: 360929
2019-05-16 19:21:31 +00:00
Jonas Devlieghere 3fdd4b74a6 [IRExecutionUnit] Remove static_assert
This doesn't make sense on platforms other than 64 bit.

llvm-svn: 360916
2019-05-16 16:54:41 +00:00
Pavel Labath 1a8630ac28 DWARFContext: Return empty data extractors instead of null pointers
Summary:
There are several reasons for doing this:
- generally, there's no reason to differentiate between a section being
  absent and it being present, but empty
- it matches more closely what llvm DWARF parser is doing (which also
  doesn't differentiate the two cases)
- SymbolFileDWARF also doesn't differentiate the two cases, which makes
  porting the rest of sections easier
- it fixes a bug in how the return-null-if-empty logic was implemented
  (it returned nullptr only the second time we tried to get the
  debug_aranges section), which meant that we hit an assert when trying
  to parse an empty-but-present section

Reviewers: JDevlieghere, clayborg, aprantl

Subscribers: zturner, lldb-commits

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

llvm-svn: 360874
2019-05-16 11:19:02 +00:00
Pavel Labath f4014e116e DWARF: Add ability to reference debug info coming from multiple sections
Summary:
This patch adds the ability to precisely address debug info in
situations when a single file can have more than one debug-info-bearing
sections (as is the case with type units in DWARF v4).

The changes here can be classified into roughly three categories:
- the code which addresses a debug info by offset gets an additional
  argument, which specifies the section one should look into.
- the DIERef class also gets an additional member variable specifying
  the section. This way, code dealing with DIERefs can know which
  section is the object referring to.
- the user_id_t encoding steals one bit from the dwarf_id field to store
  the section. This means the total number of separate object files
  (apple .o, or normal .dwo) is limited to 2 billion, but that is fine
  as it's not possible to hit that number without switching to DWARF64
  anyway.

This patch is functionally equivalent to (and inspired by) the two
patches (D61503 and D61504) by Jan Kratochvil, but there are differences
in the implementation:
- it uses an enum instead of a bool flag to differentiate the sections
- it increases the size of DIERef struct instead of reducing the amount
  of addressable debug info
- it sets up DWARFDebugInfo to store the units in a single vector
  instead of two. This sets us up for the future in which type units can
  also live in the debug_info section, and I believe it's cleaner
  because there's no need for unit index remapping

There are no tests with this patch as this is essentially NFC until
we start parsing type units from the debug_types section.

Reviewers: JDevlieghere, clayborg, aprantl

Subscribers: arphaman, jankratochvil, lldb-commits

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

llvm-svn: 360872
2019-05-16 11:07:58 +00:00
Fangrui Song 2f677ab07b Simplify Triple::ppc64{,le} checks with Triple::isPPC64()
While here, update some ppc64le specific check to isPPC64(), if it
applies to big-endian as well, in the hope that it will ease the support
of big-endian if people are interested in this area. The big-endian
variant is used by at least FreeBSD, Gentoo Linux, Adélie Linux, and
Void Linux.

llvm-svn: 360868
2019-05-16 09:07:33 +00:00
Fangrui Song ddb93b637e Simplify ArchSpec::IsMIPS()
llvm-svn: 360865
2019-05-16 08:37:32 +00:00
Adrian Prantl 8b92bb359e Update LLDB license on the LLDB home page to Apache+LLVM.
llvm-svn: 360822
2019-05-15 21:58:43 +00:00
Adrian Prantl 0d11505c73 Get back the navigation sidebar on the LLDB website.
This returns the look & feel of the Sphinx-generated LLDB website to
the original pre-Sphinx layout.

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

llvm-svn: 360819
2019-05-15 21:49:00 +00:00
Michal Gorny 11b515ac0a [lldb] [test] Skip one more TestMiBreak on NetBSD
llvm-svn: 360800
2019-05-15 20:03:31 +00:00
Jan Kratochvil e8a039d62c Permit cross-CU references
So far dw_offset_t was global for the whole SymbolFileDWARF but with
.debug_types the same dw_offset_t may mean two different things depending on
its section (=CU). So references now return whole new referenced DWARFDIE
instead of just dw_offset_t.

This means that some functions have to now handle 16 bytes instead of 8 bytes
but I do not see that anywhere performance critical.

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

llvm-svn: 360795
2019-05-15 19:22:33 +00:00
Michal Gorny 9c7188a08a [lldb] [test] Mark frequently failing flaky tests skipped on NetBSD
llvm-svn: 360767
2019-05-15 12:13:20 +00:00
Fangrui Song 71a44224e5 Delete unnecessary copy ctors/copy assignment operators
It's the simplest and gives the cleanest semantics.

llvm-svn: 360762
2019-05-15 11:23:54 +00:00
Michal Gorny 9de9b5e950 [lldb] [lit] Pass --mode=compile to fix compiler-full-path.test
Pass '--mode=compile' to fix compiler-full-path.test failure on NetBSD
buildbot (apparently due to lack of 'link' executable).

Fixes r360355.  Acked by Pavel Labath.

llvm-svn: 360761
2019-05-15 10:48:55 +00:00
Gabor Marton 5ac6d49065 [ASTImporter] Use llvm::Expected and Error in the importer API
Summary:
This is the final phase of the refactoring towards using llvm::Expected
and llvm::Error in the ASTImporter API.
This involves the following:
- remove old Import functions which returned with a pointer,
- use the Import_New functions (which return with Err or Expected) everywhere
  and handle their return value
- rename Import_New functions to Import
This affects both Clang and LLDB.

Reviewers: shafik, teemperor, aprantl, a_sidorin, balazske, a.sidorin

Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits, lldb-commits

Tags: #clang, #lldb

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

llvm-svn: 360760
2019-05-15 10:29:48 +00:00
Fangrui Song de1becfaa1 Group forward declarations in one namespace lldb_private {}
llvm-svn: 360757
2019-05-15 09:15:13 +00:00
Stefan Granitz a5588c4583 [CMake] Add error to clarify that lldb requires libcxx
Summary:
This adds a specific error message to clarify that lldb requires libcxx when
built together with clang on macOS. In addition, the lldb building docs are also
updated.

Fixes https://bugs.llvm.org/show_bug.cgi?id=41866

Reviewers: sgraenitz, JDevlieghere, EricWF

Reviewed By: sgraenitz

Subscribers: mgorny, lldb-commits

Tags: #lldb

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

llvm-svn: 360756
2019-05-15 08:59:02 +00:00
Pavel Labath 041f40e5da DWARF: s/CompileUnit/Unit/ in DWARFFormValue
The class has been converted to use DWARFUnit, but a number of uses of
the words compile unit remained. This removes all such references
Get/SetCompileUnit becomes Get/SetUnit, and m_cu becomes m_unit.

llvm-svn: 360754
2019-05-15 07:45:40 +00:00
Jonas Devlieghere 4c1d6ee83d Replace assert with static_assert here applicable.
Replaces assert() with static_assert() if the condition is can be
evaluated at compile time.

llvm-svn: 360753
2019-05-15 05:39:41 +00:00
Jonas Devlieghere c18740976e Mark private unimplemented functions as deleted
Applies modernize-use-equals-delete to the LLDB code base and removes
the now redundant comments.

llvm-svn: 360751
2019-05-15 05:31:14 +00:00
Jonas Devlieghere c31a45e62a [Docs] Document lldb-dotest
Document the lldb-dotest binary.

llvm-svn: 360748
2019-05-15 04:42:30 +00:00
Saleem Abdulrasool a23cc727d8 Revert "build: use the correct variable"
This reverts commit b5a8abd57f23e2f621d5ceb0f64f1bb8f9579c3f.  This
should not be needed as the lldb-server tool will add
`LLDB_CAN_USE_LLDB_SERVER` which will never be set to true on Windows.

llvm-svn: 360745
2019-05-15 03:57:07 +00:00
Michal Gorny 3bdbd97d67 [lldb] [lit] Fix whitespace in matches for remaining AVX512 tests
llvm-svn: 360744
2019-05-15 03:32:47 +00:00
Alex Langford bd3adfe5e3 [Target] Generalize some behavior in Thread
Summary:
I don't think there's a good reason for this behavior to be considered
ObjC-specific. We can generalize this.

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

llvm-svn: 360741
2019-05-15 01:46:45 +00:00
Jim Ingham 7d7b788fb1 Make SBDebugger.RunCommandInterpreter callable from Python.
Authored by: Lukas Boger

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

llvm-svn: 360730
2019-05-15 00:08:55 +00:00
Davide Italiano 092f85a594 [lit/Register] Fix matching of the output.
llvm-svn: 360725
2019-05-14 23:17:12 +00:00
Saleem Abdulrasool 1acec2b639 build: use the correct variable
Adjust the variable that controls whether the unit tests use `lldb-server`.
This should repair the default build on Windows.

llvm-svn: 360695
2019-05-14 17:24:45 +00:00