Commit Graph

17603 Commits

Author SHA1 Message Date
Raphael Isemann bae7367cd9 Add unit tests for VMRange
Subscribers: clayborg, labath, mgorny, lldb-commits

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

llvm-svn: 337873
2018-07-24 23:52:39 +00:00
Jason Molenda d5522568e4 Add DumpRegisterValue.cpp.
llvm-svn: 337865
2018-07-24 23:19:56 +00:00
Raphael Isemann ea832b9578 Remove unused History class
Summary: This class doesn't seem to be used anywhere, so we might as well remove the code.

Reviewers: labath

Reviewed By: labath

Subscribers: labath, mgorny, lldb-commits

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

llvm-svn: 337855
2018-07-24 21:09:17 +00:00
Pavel Labath e03334cf6a Move dumping code out of RegisterValue class
Summary:
The dump function was the only part of this class which depended on
high-level functionality. This was due to the DumpDataExtractor
function, which uses info from a running target to control dump format
(although, RegisterValue doesn't really use the high-level part of
DumpDataExtractor).

This patch follows the same approach done for the DataExtractor class,
and extracts the dumping code into a separate function/file. This file
can stay in the higher level code, while the RegisterValue class and
anything that does not depend in dumping can stay go to lower layers.

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

Reviewers: zturner, jingham, clayborg

Subscribers: lldb-commits, mgorny

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

llvm-svn: 337832
2018-07-24 15:48:13 +00:00
Pavel Labath 082bab1cff Reimplement EventDataBytes::Dump to avoid DumpDataExtractor
This is the only external non-trivial dependency of the Event classes.

llvm-svn: 337819
2018-07-24 10:49:14 +00:00
Raphael Isemann 6188a42592 Added unit test for StreamTee
Reviewers: davide

Reviewed By: davide

Subscribers: davide, mgorny, lldb-commits

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

llvm-svn: 337778
2018-07-24 00:01:32 +00:00
Jason Molenda b794fc78fc Change sort-pbxproj.rb to find the project.pbxproj in the
most likely locations.  And have it overwrite the original
file with the sorted output.

llvm-svn: 337774
2018-07-23 23:34:50 +00:00
Greg Clayton 247aac81ab Fix Xcode project for unit tests.
llvm-svn: 337758
2018-07-23 22:22:46 +00:00
Raphael Isemann 9df80e8248 [cmake] Remove unused ${LLDB_PLUGINS} dependency from our Objective-C++ CMake config
Summary:
LLDB_PLUGINS doesn't exist as a variable, so this line doesn't add any dependencies and is
just confusing. It seems this slipped in from the gdb-remote CMake I was using as a CMake template.

The gdb-remote CMake itself is using a local LLDB_PLUGINS variable, so that code is fine.

Reviewers: davide

Reviewed By: davide

Subscribers: davide, mgorny, lldb-commits

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

llvm-svn: 337741
2018-07-23 21:14:52 +00:00
Raphael Isemann 17af5b6e20 [NFC] Minor code refactoring.
Subscribers: lldb-commits

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

llvm-svn: 337737
2018-07-23 20:56:49 +00:00
Greg Clayton 2dd7e5e222 Add support for parsing Breakpad minidump files that can have extra padding in the module, thread and memory lists.
Differential Revision: https://reviews.llvm.org/D49579

llvm-svn: 337694
2018-07-23 14:16:08 +00:00
Alexander Polyakov 19150571c5 Fix windows build after r337689
Added missing header.

llvm-svn: 337692
2018-07-23 14:10:30 +00:00
Alexander Polyakov e2183d508a [lldb-mi] Re-implement data-info-line command.
Summary: Now data-info-line command uses SB API instead of HandleCommand.

Reviewers: aprantl, clayborg, jingham

Reviewed By: aprantl

Subscribers: ki.stfu, lldb-commits

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

llvm-svn: 337689
2018-07-23 13:02:41 +00:00
Jim Ingham 40fa4a1a55 Defend LoadImageUsingPaths against a path list
with empty paths on it.

llvm-svn: 337515
2018-07-20 01:20:18 +00:00
Raphael Isemann 3914833099 Added unit tests for Flags
Reviewers: labath

Reviewed By: labath

Subscribers: labath, mgorny, lldb-commits

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

llvm-svn: 337475
2018-07-19 17:45:51 +00:00
Pavel Labath a274452924 ELF: Replace the header-extension unit test with a lit one
The new test checks that we are actually able to read data from these
kinds of elf headers correctly instead of just that we read the section
number correctly. It is also easier to figure out what's going on in the
test.

llvm-svn: 337459
2018-07-19 14:38:30 +00:00
Pavel Labath 67b8f573a7 Fix whitespace formatting in DWARFExpression::DumpLocation
we were printing an extra space before the start for the expression and
an extra space after some dwarf operators. This makes sure we only print
exactly one space **between** operators and nowhere else.

llvm-svn: 337452
2018-07-19 13:30:56 +00:00
Stella Stamenova a633e9dbde Fix variables.test after D49018
Summary: This one fixes variables.test after D49018. The test was broken because D49018 adds a location information to variables, but I hadn't noticed that, because I used 32-bit build to run tests, so the test looked to me already broken before that commit (the test relies on mangled names, but the mangling schemes are different for 32-bit and 64-bit).

Reviewers: stella.stamenova, lldb-commits

Reviewed By: stella.stamenova

Patch By: Aleksandr Urakov

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

llvm-svn: 337397
2018-07-18 15:50:24 +00:00
Stella Stamenova 027a9fc2c5 [windows] Use a well-known path for ComSpec if we fail to retrieve it
Summary: Right now we always try to retrieve ComSpec and if we fail, we give up. This rarely fails, but we can update the logic so that we fail even less frequently. Since there is a well-known path (albeit not always correct), try the path when we failed to retrieve it. Note that on other platforms, we generally just return a well-known path without any checking.

Reviewers: asmith, zturner, labath

Reviewed By: zturner, labath

Subscribers: llvm-commits

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

llvm-svn: 337395
2018-07-18 15:21:54 +00:00
Stella Stamenova 0f97581af7 [lit, lldbsuite] Remove tests that are duplicated between lit and lldb-suite
Summary: Several tests exist in both lit and lldbsuite. This removes the lit version of the duplicated tests.

Reviewers: asmith, zturner

Subscribers: llvm-commits

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

llvm-svn: 337393
2018-07-18 15:16:54 +00:00
Jason Molenda c6ab25deef Link the lldb driver ("lldb") against the llvm static
libraries because of the new prettystackprinter dependency.

llvm-svn: 337335
2018-07-17 23:44:09 +00:00
Alex Langford 97ba3b64dd Invert dependency between lldb-framework and lldb-suite
Summary:
Currently, if you build lldb-framework the entire framework doesn't
actually build. In order to build the entire framework, you need to actually
build lldb-suite. This abstraction doesn't feel quite right because
lldb-framework truly does depend on lldb-suite (liblldb + related tools).

In this change I want to invert their dependency. This will mean that lldb and
finish_swig will depend on lldb-framework in a framework build, and lldb-suite
otherwise. Instead of adding conditional logic everywhere to handle this, I
introduce LLDB_SUITE_TARGET to handle it.

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

llvm-svn: 337311
2018-07-17 18:28:51 +00:00
Jonas Devlieghere 4ab5731973 [CMake] Have check-lldb-unit use CMAKE_CURRENT_BINARY_DIR
llvm-lit uses `map_config` directives (generated at configuration-time) to
make it possible to pass a test path relative to the source instead of
the build folder (CMAKE_CURRENT_BINARY_DIR).

However, this doesn't work in the case of swift where the build
directory layout prevents llvm-lit from knowing about lldb and its test
paths. This caused check-lldb-unit to fail in this configuration, while
everything was working as expected upstream. This patch fixes the issue
by passing a path relative to the build directory. This was already the
case for check-lldb-lit.

llvm-svn: 337291
2018-07-17 15:11:15 +00:00
Jonas Devlieghere 2ad6e0a696 Move pretty stack trace printer into driver.
We used to have a pretty stack trace printer in SystemInitializerCommon.
This was disabled on Apple because we didn't want the library to be
setting signal handlers, as this was causing issues when loaded into
Xcode. However, I think it's useful to have this for the LLDB driver, so
I moved it up to use the PrettyStackTraceProgram in the driver's main.

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

llvm-svn: 337261
2018-07-17 10:04:19 +00:00
Alex Langford 8d33a085c3 [CMake] Give lldb tools functional install targets when building LLDB.framework
Summary:
This change makes the install targets for lldb tools functional when
building for the framework.

I am currently working on the install rules for lldb-framework and this will
let me make `install-lldb-framework` rely on `install-lldb-argdumper` for
instance. This is especially important for `install-lldb-framework-stripped`. It
is much better for `install-lldb-framework-stripped` to rely on
`install-lldb-argdumper-stripped` than to copy and strip lldb-argdumper
manually.

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

llvm-svn: 337202
2018-07-16 19:19:56 +00:00
Raphael Isemann 2d42579886 Fix some crashes and deadlocks in FormatAnsiTerminalCodes
Summary:
This patch fixes a few problems with the FormatAnsiTerminalCodes function:

* It does an infinite loop on an unknown color value.
* It crashes when the color value is at the end of the string.
* It deletes the first character behind the color token.

Also added a few tests that reproduce those problems (and test some other corner cases).

Reviewers: davide, labath

Reviewed By: labath

Subscribers: labath, lldb-commits, mgorny

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

llvm-svn: 337189
2018-07-16 16:38:30 +00:00
Pavel Labath 94d84088e9 Fix typo in find-basic-function test
Wrong FileCheck header meant that we were not matching what we should.

This allows us to get rid of the -allow-deprecated-dag-overlap flag in
the test.

llvm-svn: 337188
2018-07-16 16:18:52 +00:00
Pavel Labath 7cb4dfb083 Fix TestDataFormatterUnordered for older libc++ versions
clang recently started diagnosing "exception specification in
declaration does not match previous declaration" errors. Unfortunately
old libc++ versions had a bug, where they violated this rule, which
means that tests using this library version now fail due to build
errors.

Since it was easy to work around the bug by compiling this test with
-fno-exceptions, I do that here. If supporting old libc++ versions
becomes a burden, we'll have to revisit this.

llvm-svn: 337173
2018-07-16 14:37:58 +00:00
Sterling Augustine 94c4512a8c Rollback r337070.
Someone simultaneously fixed the breakage it was designed to fix.

llvm-svn: 337071
2018-07-13 23:03:15 +00:00
Sterling Augustine df28c9f12b Update ClangASTContext for the new DependentVector type.
https://reviews.llvm.org/D49326

llvm-svn: 337070
2018-07-13 22:54:41 +00:00
Alexander Polyakov f5b1c2fa39 [lldb-mi] Make symbol-list-lines.test XFAIL on Windows
It's a temporary decision until we reach out what causes
a failure.

llvm-svn: 337064
2018-07-13 22:41:16 +00:00
Fangrui Song 8f28488594 Fix -Wswitch after introduction of clang;:Type::DependentVector in r337036
llvm-svn: 337063
2018-07-13 22:40:40 +00:00
Jim Ingham c685f6c17f Make these tests c++ tests so they can be skipped on systems that don't support those tests.
llvm-svn: 337058
2018-07-13 22:31:59 +00:00
Jim Ingham 393fe62e33 Fix the libcxx set, multiset, vector and bitset formatters to work on references.
The synthetic child providers for these classes had a type expression that matched
pointers & references to the type, but the Front End only worked on the actual object.

I fixed this by adding a way for the Synthetic Child FrontEnd provider to request dereference,
and then had these formatters use that mode.

<rdar://problem/40849836>

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

llvm-svn: 337035
2018-07-13 19:28:32 +00:00
Jim Ingham 0925c1fdff Add the new PDBLocationToDWARFExpression.{cpp,h} to the Xcode project.
llvm-svn: 337034
2018-07-13 19:24:26 +00:00
Raphael Isemann 291e6c5db6 Add includes for CompletionRequest to every file that uses it
Summary: Should fix the builds (and prevent future builds from failing when people try to reduce includes).

Reviewers: jingham

Reviewed By: jingham

Subscribers: jingham, lldb-commits

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

llvm-svn: 337032
2018-07-13 18:54:55 +00:00
Raphael Isemann a2e76c0bfc Replaced more boilerplate code with CompletionRequest (NFC)
Summary:
As suggested in D48796, this patch replaces even more internal calls that were using the old
completion API style with a single CompletionRequest. In some cases we also pass an option
vector/index, but as we don't always have this information, it currently is not part of the
CompletionRequest class.

The constructor of the CompletionRequest is now also more sensible. You only pass the
user input, cursor position and your list of matches to the request and the rest will be
inferred (using the same code we used before to calculate this). You also have to pass these
match window parameters to it, even though they are unused right now.

The patch shouldn't change any behavior.

Reviewers: jingham

Reviewed By: jingham

Subscribers: lldb-commits

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

llvm-svn: 337031
2018-07-13 18:28:14 +00:00
Raphael Isemann d6c062bce1 No longer pass a StringRef to the Python API
Summary:
The refactoring patch for DoExecute missed this case of a variadic function that just silently
accepts a StringRef which it then tries to reinterpret as a C-string.

This should fix the Windows builds.

Reviewers: stella.stamenova

Reviewed By: stella.stamenova

Subscribers: lldb-commits

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

llvm-svn: 337030
2018-07-13 18:13:46 +00:00
Frederic Riss 8e04d937b0 Fix TestAttachDenied on macOS Mojave
TestAttachDenied tries to attach to a process that is ptracing itself and
verifies that we error out. Starting with macOS Mojave, processes need
an entitlement to be able to ptrace. This commit adds the entitlement for
the test binary when building on Darwin.

llvm-svn: 337029
2018-07-13 17:45:43 +00:00
Tatyana Krasnukha 0b8bea311f Adjust thread name column width depending on real name length.
Make 16-byte aligned field instead of truncating a name to 16 byte.

llvm-svn: 336993
2018-07-13 11:49:28 +00:00
Tatyana Krasnukha 1a728f66ef Add abbreviated name for Debugger::EventHandlerThread.
On OS's where thread names are limited to 16 bytes, the full name was truncated to not very meaningful "r.event-handler".

llvm-svn: 336991
2018-07-13 11:21:06 +00:00
Jonas Devlieghere 924d560867 Convert a location information from PDB to a DWARF expression
The current version of SymbolFilePDB::ParseVariableForPDBData function
always initializes variables with an empty location. This patch adds the
converter of a location information from PDB to a DWARF expression, so
it becomes possible to watch values of variables of primitive data
types. At the moment the converter supports only Static, TLS, RegRel,
Enregistered and Constant PDB location types, but it seems that it's
enough for most cases. There are still some problems with retrieving
values of variables (e.g. we can't watch variables of composite types),
but they look not relevant to the conversion to DWARF.

Patch by: Aleksandr Urakov

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

llvm-svn: 336988
2018-07-13 10:29:27 +00:00
Stella Stamenova 7b68fa7fcd [lldbsuite] The test inside TestOverloadedFunctions.py has the wrong class name
Summary: It looks like the test file was copied from TestCPPStaticMethods.py because they have the same name. This means that the two tests will try to write to the same output files and will either overwrite each other's output or occasionally cause failures because they can't both access the same file.

Reviewers: asmith, zturner

Reviewed By: zturner

Subscribers: llvm-commits

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

llvm-svn: 336960
2018-07-12 23:02:33 +00:00
Jason Molenda a2476ab7c9 Remove incorrect thread-pc-values clearing
from ProcessGDBRemote::UpdateThreadIDsFromStopReplyThreadsValue.

Patch by Venkata Ramanaiah.

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

llvm-svn: 336956
2018-07-12 22:45:41 +00:00
Raphael Isemann 4d51a90297 Get rid of the C-string parameter in DoExecute
Summary:
This patch gets rid of the C-string parameter in the RawCommandObject::DoExecute function,
making the code simpler and less memory unsafe.

There seems to be a assumption in some command objects that this parameter could be a nullptr,
but from what I can see the rest of the API doesn't actually allow this (and other command
objects and related code pieces dereference this parameter without any checks).

Especially CommandObjectRegexCommand has error handling code for a nullptr that is now gone.

Reviewers: davide, jingham, teemperor

Reviewed By: teemperor

Subscribers: jingham, lldb-commits

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

llvm-svn: 336955
2018-07-12 22:28:52 +00:00
Stella Stamenova 4835a02b80 [process] Update the documentation for ReadMemory and DoReadMemory to include the error parameter
Summary: The current documentation does not include the error parameter.

Reviewers: jingham, asmith

Reviewed By: jingham

Subscribers: llvm-commits

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

llvm-svn: 336948
2018-07-12 21:27:56 +00:00
Leonard Mosescu 2ae3ec3b81 Restructure the minidump loading path and add early & explicit consistency checks
Corrupted minidumps was leading to unpredictable behavior.

This change adds explicit consistency checks for the minidump early on. The
checks are not comprehensive but they should catch obvious structural violations:

streams with type == 0
duplicate streams (same type)
overlapping streams
truncated minidumps

Another early check is to make sure we actually support the minidump architecture
instead of crashing at a random place deep inside LLDB.

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

llvm-svn: 336918
2018-07-12 17:27:18 +00:00
Eric Christopher b860318198 Remove the unused m_signal member variable, but leave the code that gets it out of the json.
llvm-svn: 336885
2018-07-12 03:52:46 +00:00
Eric Christopher 4bfb8011f7 Remove unused variable m_header as it hasn't been used since it was
added in 2016.

llvm-svn: 336884
2018-07-12 03:52:45 +00:00
Davide Italiano a9d84cb9d8 [IRInterpreter] Fix misevaluation of interpretation expressions with `urem`.
Scalar::MakeUnsigned was implemented incorrectly so it didn't
really change the sign of the type (leaving signed types signed).
This showed up as a misevaluation when IR-interpreting urem but
it's likely to arise in other contexts.

This commit fixes the definition, and adds a test to make
sure this won't regress in future (hopefully).

Fixes rdar://problem/42038760 and LLVM PR38076

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

llvm-svn: 336872
2018-07-12 00:31:04 +00:00