Commit Graph

18537 Commits

Author SHA1 Message Date
Nathan Lanza f9c2f2c0b7 Fix order of arguments in an lldb type summary in examples
The format for the -w argument is:

    -w name ( --category name )

Rearrange the flags correctly.

llvm-svn: 351664
2019-01-19 20:08:41 +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
Chandler Carruth 469bdefd44 Install new LLVM license structure and new developer policy.
This installs the new developer policy and moves all of the license
files across all LLVM projects in the monorepo to the new license
structure. The remaining projects will be moved independently.

Note that I've left odd formatting and other idiosyncracies of the
legacy license structure text alone to make the diff easier to read.
Critically, note that we do not in any case *remove* the old license
notice or terms, as that remains necessary until we finish the
relicensing process.

I've updated a few license files that refer to the LLVM license to
instead simply refer generically to whatever license the LLVM project is
under, basically trying to minimize confusion.

This is really the culmination of so many people. Chris led the
community discussions, drafted the policy update and organized the
multi-year string of meeting between lawyers across the community to
figure out the strategy. Numerous lawyers at companies in the community
spent their time figuring out initial answers, and then the Foundation's
lawyer Heather Meeker has done *so* much to help refine and get us ready
here. I could keep going on, but I just want to make sure everyone
realizes what a huge community effort this has been from the begining.

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

llvm-svn: 351631
2019-01-19 06:14:24 +00:00
Jonas Devlieghere 71c7303044 [dotest] Add logging to investigate CI issue.
We're seeing an odd issue on GreenDragon's lldb-cmake-matrix. Dotest is
unable to move a log file (OSError: [Errno 2] No such file or
directory). The os.rename call is guarded with a check that the source
file and destination directory exist.

This wraps the call in a try-except that prints the source and
destination path to see which component seemingly doesn't exist.

llvm-svn: 351611
2019-01-18 23:05:19 +00:00
Jim Ingham e33a90b9cd Add BreakpadRecords to the Xcode project.
llvm-svn: 351585
2019-01-18 20:20:40 +00:00
Greg Clayton 5764982713 Make sure to fill in the compiler register number so when we try to backtrace using EH frame, it works.
Prior to this, backtraces could fail due to not being able to convert a EH frame register number to LLDB register number.

llvm-svn: 351564
2019-01-18 17:06:01 +00:00
Pavel Labath 2cf5486ce4 Breakpad: Extract parsing code into a separate file
Summary:
This centralizes parsing of breakpad records, which was previously
spread out over ObjectFileBreakpad and SymbolFileBreakpad.

For each record type X there is a separate breakpad::XRecord class, and
an associated parse function. The classes just store the information in
the breakpad records in a more accessible form. It is up to the users to
determine what to do with that data.

This separation also made it possible to write some targeted tests for
the parsing code, which was previously unaccessible, so I write a couple
of those too.

Reviewers: clayborg, lemo, zturner

Reviewed By: clayborg

Subscribers: mgorny, fedor.sergeev, lldb-commits

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

llvm-svn: 351541
2019-01-18 10:37:04 +00:00
Jonas Devlieghere 17f277d754 [Reproducers] Fix reproducers unittest.
Fix fallout from r351501 in the reproducer unittest.

llvm-svn: 351524
2019-01-18 07:17:05 +00:00
Brad Smith ea512d629a Use llvm::VersionTuple instead of manual version marshalling
llvm-svn: 351504
2019-01-18 01:36:58 +00:00
Jonas Devlieghere e912cc512d [Reproducers] Refactor reproducer info
In the original reproducer design, I expected providers to be more
dynamic than they turned out. For example, we don't have any instances
where one provider has multiple files. Additionally, I expected there to
be less locality between capture and replay, with the provider being
defined in one place and the replay code to live in another. Both
contributed to the design of the provider info.

This patch refactors the reproducer info to be something static. This
means less magic strings and better type checking. The new design still
allows for the capture and replay code to live in different places as
long as they both have access to the new statically defined info class.

I didn't completely get rid of the index, because it is useful for (1)
sanity checking and (2) knowing what files are used by the reproducer.

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

llvm-svn: 351501
2019-01-18 01:04:59 +00:00
Alex Langford 9299d589ec [CMake] Only test debugserver if platform can use debugserver
In commit svn r351496 I changed this condition from
`if(LLDB_CAN_USE_DEBUGSERVER)` to `if(NOT SKIP_TEST_DEBUGSERVER)`.
This causes debugserver tests to run on windows, which shouldn't happen.
SKIP_TEST_DEBUGSERVER is set either by the user (it shouldn't be set on
windows builds) or in the debugserver CMake logic (which doesn't get
included when building on windows). Therefore, I changed the condition
to be `if(LLDB_CAN_USE_DEBUGSERVER AND NOT SKIP_TEST_DEBUGSERVER)`.

llvm-svn: 351498
2019-01-18 00:05:25 +00:00
Jonas Devlieghere 8ba58fa8e2 [lit] Fix lldbtest format
The lldbtest format was incorrectly detecting XFAIL as FAIL because it
was looking for the `FAIL:` substring in the dotest output.

llvm-svn: 351497
2019-01-17 23:30:06 +00:00
Alex Langford cb1c467edb [CMake] Prevent lldbDebugserverCommon from building if you disable debugserver builds
Summary:
The flags `LLDB_USE_SYSTEM_DEBUGSERVER` and `LLDB_NO_DEBUGSERVER` were
introduced to the debugserver build. If one of these two flags are set, then we
do not build and sign debugserver. However I noticed that we were still building
the lldbDebugserverCommon and lldbDebugserverCommon_NonUI libraries regardless
of whether or not these flags were set. I don't believe we should be building
these libraries unless we are building and signing debugserver.

Reviewers: sgraenitz, davide, JDevlieghere, beanz, vsk, aprantl, labath

Subscribers: mgorny, jfb, lldb-commits

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

llvm-svn: 351496
2019-01-17 23:14:04 +00:00
Jason Molenda 03e26de4d2 Don't run TestBreakpointThumbCodesection.py on darwin systems;
we don't use a thumb code section.

Don't run Test128BitsInteger.py on armv7k; it's not a supported
type on that target.

llvm-svn: 351490
2019-01-17 22:26:25 +00:00
Jonas Devlieghere 43977e8aa9 [CMake] Fix lldb-test-depends target
The lldb-test-depends target was using the old CMake variable name
LLDB_TEST_DEPENDS instead of LLDB_TEST_DEPS. This patch moves the target
definition and makes it use the correct one.

llvm-svn: 351489
2019-01-17 22:25:20 +00:00
Davide Italiano 1ef3866a64 [lit] Make sure tests are actually skipped on darwin and windows.
llvm-svn: 351486
2019-01-17 21:57:33 +00:00
Pavel Labath 7630e0bcbe Recommit "Teach the default symbol vendor to respect module.GetSymbolFileFileSpec()"
This reapplies commit r351330, which was reverted due to a failing test on
macos. The failure was because the SymbolVendor used on MacOS was stricter than
the default (or ELF) symbol vendor, and rejected the symbol file because it's
UUID did not match the object file.

This version of the patch adds a uuid load command to the test macho file to
make sure the UUIDs match.

llvm-svn: 351447
2019-01-17 15:07:35 +00:00
Pavel Labath bdbc14dc01 Recommit "Add a verbose mode to "image dump line-table" and use it to write a .debug_line test"
This reapplies r350802, which was reverted because of issues with
parsing posix-style paths on windows hosts (and vice-versa). These have
since been fixed in r351328, and lldb should now recognise the path
style used in a dwarf compile unit correctly.

llvm-svn: 351435
2019-01-17 13:11:04 +00:00
Adrian Prantl 6273bb5430 XFAIL test on Windows
http://lab.llvm.org:8011/builders/lldb-x64-windows-ninja/builds/677/steps/test/logs/stdio

llvm-svn: 351385
2019-01-16 22:07:21 +00:00
Adrian Prantl 2ee7b881a0 Change TypeSystem::GetBitSize() to return an optional result.
This patch changes the behavior when printing C++ function references:
where we previously would get a <could not determine size>, there is
now a <no summary available>. It's not clear to me whether this is a
bug or an omission, but it's one step further than LLDB previously
got.

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

llvm-svn: 351376
2019-01-16 21:19:20 +00:00
Pavel Labath 081194d9fa Fix dir-separator-no-comp-dir-relative-name.s test added in r351328
In this test we have deliberately removed all information which may hint
at the correct path style, so we cannot assert that lldb uses a
particular style. Instead, we should just check that it does something
vaguely reasonable.

llvm-svn: 351359
2019-01-16 17:39:06 +00:00
Pavel Labath d38bd4ee82 Revert "Teach the default symbol vendor to respect module.GetSymbolFileFileSpec()"
This reverts commit r351330 due to failures on MacOS bots.

llvm-svn: 351353
2019-01-16 16:09:13 +00:00
Pavel Labath 2a32a69c53 TestClangASTContext: Rewrite an if-else chain into a switch
This avoids the "ambiguous else" warning, which comes from within the
EXPECT_TRUE macro.

llvm-svn: 351331
2019-01-16 12:43:01 +00:00
Pavel Labath dd487d6521 Teach the default symbol vendor to respect module.GetSymbolFileFileSpec()
Summary:
Adding a breakpad symbol file to an existing MachO module with "target symbols
add" currently works only if one's host platform is a mac. This is
because SymbolVendorMacOSX (which is the one responsible for loading
symbols for MachO files) is conditionally compiled for the mac platform.

While we will sooner or later have a special symbol vendor for breakpad
files (to enable more advanced searching), and so this flow could be
made to work through that, it's not clear to me whether this should be a
requirement for the "target symbols add" flow to work. After all, since
the user has explicitly specified the symbol file to use, the symbol
vendor plugin's job is pretty much done.

This patch teaches the default symbol vendor to respect module's symbol
file spec, and load the symbol from that file if it is specified (and no
plugin requests any special handling).

Reviewers: clayborg, zturner, lemo

Subscribers: lldb-commits

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

llvm-svn: 351330
2019-01-16 12:42:57 +00:00
Pavel Labath 7d36d723ab DWARF: Add some support for non-native directory separators
Summary:
If we opened a file which was produced on system with different path
syntax, we would parse the paths from the debug info incorrectly.

The reason for that is that we would parse the paths as they were
native. For example this meant that on linux we would treat the entire
windows path as a single file name with no directory component, and then
we would concatenate that with the single directory component from the
DW_AT_comp_dir attribute. When parsing posix paths on windows, we would
at least get the directory separators right, but we still would treat
the posix paths as relative, and concatenate them where we shouldn't.

This patch attempts to remedy this by guessing the path syntax used in
each compile unit. (Unfortunately, there is no info in DWARF which would
give the definitive path style used by the produces, so guessing is all
we can do.) Currently, this guessing is based on the DW_AT_comp_dir
attribute of the compile unit, but this can be refined later if needed
(for example, the DW_AT_name of the compile unit may also contain some
useful info). This style is then used when parsing the line table of
that compile unit.

This patch is sufficient to make the line tables come out right, and
enable breakpoint setting by file name work correctly. Setting a
breakpoint by full path still has some kinks (specifically, using a
windows-style full path will not work on linux because the path will be
parsed as a linux path), but this will require larger changes in how
breakpoint setting works.

Reviewers: clayborg, zturner, JDevlieghere

Subscribers: aprantl, lldb-commits

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

llvm-svn: 351328
2019-01-16 12:30:41 +00:00
Pavel Labath fd9780c9e6 Revert "Simplify Value::GetValueByteSize()"
This reverts commit r351250 because it breaks the
SymbolFile/NativePDB/function-types-builtins.cpp.

llvm-svn: 351327
2019-01-16 12:19:22 +00:00
George Rimar a3a25afe38 [lldb] - Fix crash when listing the history with the key up.
This is https://bugs.llvm.org/show_bug.cgi?id=40112,

Currently, lldb crashes after pressing the up arrow key when listing the history for expressions.

The patch fixes the mistype that was a reason.

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

llvm-svn: 351313
2019-01-16 09:27:04 +00:00
Alex Langford f510bc7972 [lldb-mi] Remove use of dialog box
Summary:
This really is only implemented on Windows, and it requires us to pull
in User32. This was only useful when debugging on lldb-mi on Windows, and there
doesn't seem to be a good reason why using a dialog box is better than what
exists for other platforms.

Reviewers: zturner, jingham, compnerd

Subscribers: ki.stfu

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

llvm-svn: 351276
2019-01-16 00:09:50 +00:00
Adrian Prantl ee031dfacb Remove redundant check.
llvm-svn: 351274
2019-01-15 23:33:26 +00:00
Adrian Prantl 222474b9ff Simplify code by using Optional::getValueOr()
llvm-svn: 351264
2019-01-15 22:30:01 +00:00
Alex Langford 76cb3089de [debugserver][CMake] Remove commented out line
This has been commented out since rL300111
(commit d742d081f3a1e7412cc609765139ba32d597ac15). Looks like it was
committed as a commented out line, so I'm removing it.

llvm-svn: 351263
2019-01-15 22:27:59 +00:00
Adrian Prantl 5b73c9bf27 Simplify Value::GetValueByteSize()
llvm-svn: 351250
2019-01-15 21:26:03 +00:00
Adrian Prantl 2f1fa7a027 Simplify code
llvm-svn: 351244
2019-01-15 21:04:19 +00:00
Adrian Prantl bb2a2c537e Add Doxygen comments.
llvm-svn: 351243
2019-01-15 21:04:18 +00:00
Adrian Prantl d6a9bbf68e Replace auto -> llvm::Optional<uint64_t>
This addresses post-commit feedback for https://reviews.llvm.org/D56688

llvm-svn: 351237
2019-01-15 20:33:58 +00:00
Adrian Prantl d8024371a5 Silence compiler warnings
llvm-svn: 351215
2019-01-15 18:07:54 +00:00
Adrian Prantl d963a7c398 Make CompilerType::getBitSize() / getByteSize() return an optional result. NFC
The code in LLDB assumes that CompilerType and friends use the size 0
as a sentinel value to signal an error. This works for C++, where no
zero-sized type exists, but in many other programming languages
(including I believe C) types of size zero are possible and even
common. This is a particular pain point in swift-lldb, where extra
code exists to double-check that a type is *really* of size zero and
not an error at various locations.

To remedy this situation, this patch starts by converting
CompilerType::getBitSize() and getByteSize() to return an optional
result. To avoid wasting space, I hand-rolled my own optional data
type assuming that no type is larger than what fits into 63
bits. Follow-up patches would make similar changes to the ValueObject
hierarchy.

rdar://problem/47178964

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

llvm-svn: 351214
2019-01-15 18:07:52 +00:00
David L. Jones 2d5b317cfc [LLDB] Remove the unused variable oso_dwarf.
Patch by Ali Tamur! (tamur@google.com)

llvm-svn: 351158
2019-01-15 03:27:54 +00:00
Zachary Turner 576495e67b [SymbolFile] Remove SymbolContext parameter from FindTypes.
This parameter was only ever used with the Module set, and
since a SymbolFile is tied to a module, the parameter turns
out to be entirely unnecessary.  Furthermore, it doesn't make
a lot of sense to ask a caller to ask SymbolFile which is tied
to Module X to find types for Module Y, but that possibility
was open with the previous interface.  By removing this
parameter from the API, it makes it harder to use incorrectly
as well as easier for an implementor to understand what it
needs to do.

llvm-svn: 351133
2019-01-14 22:41:21 +00:00
Zachary Turner c0a246afbe [SymbolFile] Remove the SymbolContext parameter from FindNamespace.
Every callsite was passing an empty SymbolContext, so this parameter
had no effect.  Inside the DWARF implementation of this function,
however, there was one codepath that checked members of the
SymbolContext.  Since no call-sites actually ever used this
functionality, it was essentially dead code, so I've deleted this
code path as well.

llvm-svn: 351132
2019-01-14 22:41:00 +00:00
Zachary Turner ffc1b8fd76 [SymbolFile] Rename ParseFunctionBlocks to ParseBlocksRecursive.
This method took a SymbolContext but only actually cared about the
case where the m_function member was set.  Furthermore, it was
intended to be implemented to parse blocks recursively despite not
documenting this in its name.  So we change the name to indicate
that it should be recursive, while also limiting the function
parameter to be a Function&.  This lets the caller know what is
required to use it, as well as letting new implementers know what
kind of inputs they need to be prepared to handle.

llvm-svn: 351131
2019-01-14 22:40:41 +00:00
Stella Stamenova da97713fc4 [lldbsuite] Skip two more flaky tests on Windows
TestNamespaceLookup occasionally passes unexpectedly and TestExitDuringStep occasionally fails unexpectedly

llvm-svn: 351080
2019-01-14 17:55:17 +00:00
Aleksandr Urakov b4c1e4c2fb [Core] Use the implementation method GetAddressOf in ValueObjectConstResultChild
Summary:
This patch allows to retrieve an address object for `ValueObject`'s children
retrieved through e.g. `GetChildAtIndex` or `GetChildMemberWithName`. It just
uses the corresponding method of the implementation object `m_impl` to achieve
that.

Reviewers: zturner, JDevlieghere, clayborg, labath, serge-sans-paille

Reviewed By: clayborg

Subscribers: leonid.mashinskiy, lldb-commits

Tags: #lldb

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

llvm-svn: 351065
2019-01-14 13:08:13 +00:00
Stefan Granitz 4b7e12f2cf [CMake] LLVM exports utility targets since r350959, so we can use them without standalone-checks now
llvm-svn: 351037
2019-01-14 09:24:50 +00:00
Jason Molenda 0053d15d9c Add SymbolFileBreakpad.
llvm-svn: 350990
2019-01-12 03:17:39 +00:00
Stella Stamenova c2fb9ed1d0 [lldbsuite] Skip TestExitDuringStep on Windows
This test is flaky on Windows and will occasionally hang or fail.

llvm-svn: 350978
2019-01-11 23:08:35 +00:00
Zachary Turner ce386e306d Fix build breaks after the ParseCompileUnit changes.
The addition of SymbolFileBreakpad crossed paths with my change,
so this interface needs to be fixed up as well.

llvm-svn: 350950
2019-01-11 18:35:58 +00:00
Pavel Labath 15b58ce5d4 Attempt to fix PDB tests broken by r350924
The patch added the symbol plugin name to the lldb-test output. Update
the tests to account for that.

llvm-svn: 350947
2019-01-11 18:24:17 +00:00
Stefan Granitz bb3df52c0c [CMake] Include tests by default also in standalone builds
In-tree builds include tests by default. Standalone builds should behave the same.

llvm-svn: 350945
2019-01-11 18:11:04 +00:00
Zachary Turner 863f8c18b9 [SymbolFile] Make ParseCompileUnitXXX accept a CompileUnit&.
Previously all of these functions accepted a SymbolContext&.
While a CompileUnit is one member of a SymbolContext, there
are also many others, and by passing such a monolithic parameter
in this way it makes the requirements and assumptions of the
API unclear for both callers as well as implementors.

All these methods need is a CompileUnit.  By limiting the
parameter type in this way, we simplify the code as well as
make it self-documenting for both implementers and users.

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

llvm-svn: 350943
2019-01-11 18:03:20 +00:00