Commit Graph

19765 Commits

Author SHA1 Message Date
Raphael Isemann df9051e7cf [lldb] Disable TestDollarInVariable.py on Windows
It seems on Windows we don't handle the lldb_expr_result variable correctly:

```
AssertionError: False is not True : 'expr $__lldb_expr_result' returns expected result, got '(int &) $0 = 0x0000000000000000'
```

I'll disable the test until I can find a way to debug this on Windows.

llvm-svn: 365719
2019-07-11 00:35:31 +00:00
Jonas Devlieghere 597dc0061f [swig] Add workaround for old swig
Apparently, when using swig 1.3.40, properties to set values do not work
without the `__swig_setmethods__` workaround. I conditionally added this
back for SBTypeCategory, as it's causing a test failure on GreenDragon,
while I investigate this further.

llvm-svn: 365718
2019-07-11 00:12:59 +00:00
Raphael Isemann 0171866672 [lldb] Fix handling of dollar characters in expr command
llvm-svn: 365698
2019-07-10 21:04:01 +00:00
Alex Langford 461a9d98d7 [Expression] IR Instrumenters should have a UtilityFunction
Right now, IR Instrumenters take a DynamicCheckerFunctions object which
has all the UtilityFunctions used to instrument IR for expressions.
However, each Instrumenter (in practice) uses exactly one
UtilityFunction, so let's change the abstraction.

llvm-svn: 365696
2019-07-10 20:41:36 +00:00
Nico Weber d24faac011 Add Python 3.6 and 3.7 to the version list
Python 3.6 and 3.7 have been released.

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

Patch from Christian Biesinger <cbiesinger@google.com>!

llvm-svn: 365688
2019-07-10 19:18:38 +00:00
Davide Italiano 89ed2e0a0a [scripts] Remove the unused 'shush' script.
There are pre-made utilities doing this. If somebody finds an
use for it and wants to resurrect, I would recommend to revise
the error messages.

llvm-svn: 365677
2019-07-10 18:13:46 +00:00
Pavel Labath 1abaeece71 Options: Reduce code duplication
Summary:
While investigating breakages caused by D63110, I noticed we were
building the short options strings in three places. Some of them used a
leading ':' to detect missing arguments, and some didn't. This was the
indirect cause of D63110. Here, I move the common code into a utility
function.

Also, unify the code which appends the sentinel value at the end of the
option vector, and make it harder for users to pass invalid argc-argv
combos to getopt (another component of D63110) by having the
OptionParser::Parse function take a (Mutable)ArrayRef.

This unification has uncovered that we don't handle missing arguments
while building aliases, However, it's not possible to write an effective
test for this, as right now it is not possible to return an error out of
the alias parsing code (which means we are printing the generic
"failure" message even after this patch).

Reviewers: mgorny, aprantl

Reviewed By: mgorny

Subscribers: lldb-commits

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

llvm-svn: 365665
2019-07-10 17:09:47 +00:00
Pavel Labath 0ace98c9df ObjectFileELF: Add support for gnu-style compressed sections
With this style, a compressed section is indicated by a "z" in the section
name, instead of a section header flag. This patch consists of two small tweaks:
- use an llvm Decompressor method in order to properly detect compressed sections
- make sure we recognise .zdebug_info (and friends) when classifying section types.

llvm-svn: 365654
2019-07-10 16:10:43 +00:00
Stefan Granitz bf223dff7e [CMake][NFC] Remove dead code lldb_append_link_flags() from AddLLDB.cmake
llvm-svn: 365651
2019-07-10 16:02:46 +00:00
Stefan Granitz 86d3c9fd1f [CMake][NFC] Polish comments in AddLLDB.cmake
llvm-svn: 365650
2019-07-10 16:00:03 +00:00
Stefan Granitz f554ce7f92 [CMake] Add Apple-lldb-Linux.cmake cache
llvm-svn: 365649
2019-07-10 15:59:56 +00:00
Stefan Granitz 839e305eb1 [CMake] Polish Apple-lldb caches
llvm-svn: 365648
2019-07-10 15:59:50 +00:00
Stefan Granitz 110f97632e [CMake] `install-distribution` for LLDB on Darwin
Summary:
There's a number of requirements for installing LLDB on macOS that are untypical for LLVM projects: use special install-prefix for LLDB.framework, ship headers and tools as framework resources, patch RPATHs, externalize debug-info to dSYM's and strip binaries with `-ST`. For some of it we could use `llvm_externalize_debuginfo()` in the past and just add special cases. However, this complicates the code for all projects and comes with the major drawback, that it adds all these actions at build-time, i.e. dSYM creation and stripping take a lot of time and don't make sense at build-time.

LLVM's distribution mechanism (https://llvm.org/docs/BuildingADistribution.html) appears to be the natural candidate to install LLDB. Based on D64399 (enable in standalone builds), this patch integrates framework installation with the distribution mechanism and adds custom stripping flags and dSYM creation at install-time. Unlike the abandoned D61952, it leaves build-tree binaries untouched, so there's no side-effects on testing. Potential install-order issues must be handled externally.

Please let me know what you think, while I run a few more tests and add remarks+documentation.

Reviewers: xiaobai, compnerd, JDevlieghere, davide, labath, mgorny

Reviewed By: xiaobai, JDevlieghere

Subscribers: lldb-commits, #lldb

Tags: #lldb

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

llvm-svn: 365617
2019-07-10 11:09:29 +00:00
Stefan Granitz 05adc0f317 [CMake] Distribution builds for LLDB standalone
Summary:
Enable `distribution` and `install-distribution` targets in LLDB standalone and pre-populate the cache accordingly on macOS.
Documentation for distribution builds is here: https://llvm.org/docs/BuildingADistribution.html

Reviewers: xiaobai, mgorny, JDevlieghere, davide, compnerd

Reviewed By: xiaobai, JDevlieghere

Subscribers: lldb-commits, #lldb

Tags: #lldb

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

llvm-svn: 365616
2019-07-10 11:09:11 +00:00
Stefan Granitz 685911ffce [CMake] Remove extra lldb-framework target
Summary: The custom lldb-framework target was meant to encapsulate all build steps that LLDB.framework needs on top of the ordinaly liblldb. In the end all of it happens in post-build steps, so we can do the same with liblldb and cut down another source of confusion.

Reviewers: xiaobai, JDevlieghere

Reviewed By: xiaobai, JDevlieghere

Subscribers: mgorny, lldb-commits, #lldb

Tags: #lldb

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

llvm-svn: 365615
2019-07-10 11:09:01 +00:00
Aaron Smith 6858f337a8 Revert accidental change to file
llvm-svn: 365593
2019-07-10 03:41:34 +00:00
Aaron Smith 053eb35651 Try again to move common functionality from ProcessWindows into ProcessDebugger
This reverts commit ed499a36b6 and addresses
a problem causing a Windows build bot to hang.

llvm-svn: 365592
2019-07-10 03:34:57 +00:00
Alex Langford 269b9f940f [lldb] Quick Fix: IRExecutionUnit check pointer before access it
Summary:
Move checking pointer code block before accessing the pointer
This caused lldb to crash when testing on Android

Patch by Wanyi Ye!

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

llvm-svn: 365567
2019-07-09 22:24:54 +00:00
Alex Langford 695f7821e2 [lldb_test_suite] Fix lldb test suite targeting remote Android
Summary:
Fixed `Android.rules` for running test suite on remote android
- the build configuration is not compatible with ndk structure, change it to link to static libc++
- generally clang should be able to use libc++ and will link against the right library, but some libc++ installations require the user manually link libc++abi.
- add flag `-lc++abi` to fix the test binary build failure

Added `skipIfTargetAndroid` `skipUnlessTargetAndroid` for better test support
- the `skipIfPlatform` method will ask `lldbplatformutil.getPlatform()` for platform info which is actually the os type, and //Android// is not os type but environment
- create this function to handle the android target condition

**To Run Test on Remote Android**
1 start lldb-server on your devices
2 run lldb-dotest with following configuration:
`./lldb-dotest --out-of-tree-debugserver --arch aarch64 --platform-name remote-android --platform-url connect://localhost:12345 --platform-working-dir /data/local/tmp/ --compiler your/ndk/clang`

Reviewers: xiaobai, labath

Reviewed By: labath

Subscribers: labath, javed.absar, kristof.beyls, srhines, lldb-commits

Tags: #lldb

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

llvm-svn: 365561
2019-07-09 21:35:58 +00:00
Dave Lee 90148db02a [Docs] Replace SVN revisions with lldb versions
Summary: Replaces references to svn commits with the lldb version number those commits first appeared in. Themotivation is to show that these features are no longer that new and can generally be adopted.

Reviewers: JDevlieghere

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 365559
2019-07-09 21:21:45 +00:00
Stella Stamenova 20ecec6116 [lldb, windows] Include WindowsError instead of ErrorHandling in ThreadLauncher
ErrorHandling.h does not include WindowsError.h which is needed for mapWindowsError

llvm-svn: 365533
2019-07-09 18:41:31 +00:00
Stella Stamenova 2ea514c566 [lldb-suite] Skip TestMachCore on Windows
This test was originally marked as expected failure on Windows, but it is timing out instead of outright failing now. The expectedFailure attribute does not correctly track timeouts (as in, they don't count as failures), so now this is causing the test suite to fail.

llvm-svn: 365527
2019-07-09 18:18:02 +00:00
Stella Stamenova 631b5f7dc0 [lldb, windows] Update two more locations that use LaunchThread to the new function signature
llvm-svn: 365526
2019-07-09 18:10:36 +00:00
Stefan Granitz e5b868d6a3 [CMake] Polish a comment
llvm-svn: 365459
2019-07-09 10:29:07 +00:00
Stefan Granitz e9298dc902 [CMake] Don't initialize LLVM_INSTALL_TOOLCHAIN_ONLY in Apple-lldb-base cache
llvm-svn: 365458
2019-07-09 10:29:00 +00:00
Stefan Granitz 189355f3ee [CMake] Remove old lldb_setup_framework_rpaths_in_tool()
llvm-svn: 365457
2019-07-09 10:28:53 +00:00
Jonas Devlieghere 53d5f3a08d Fix ASCII art header
llvm-svn: 365421
2019-07-09 01:35:34 +00:00
Jonas Devlieghere 4936cbc9f1 [Windows] Include ErrorHandling.h
Include ErrorHandling.h for mapWindowsError.

llvm-svn: 365420
2019-07-09 01:35:31 +00:00
Davide Italiano 68946d10ad [crashlog] Fix a mismatch between bytes and strings.
The functions in read_plist() want bytes as input, not
strings.

<rdar://problem/52600712>

llvm-svn: 365416
2019-07-09 01:05:12 +00:00
Jonas Devlieghere ba06f15ac8 [ThreadLauncher] Use mapWindowsError and LLDB_INVALID_HOST_THREAD
Address post-commit feedback from Pavel and Jim.

llvm-svn: 365403
2019-07-08 22:45:59 +00:00
Stella Stamenova 7f843e22ba [lldb, windows] When StartMonitoring fails, return a proper error
This is possible now that the function returns an llvm::Expected

llvm-svn: 365400
2019-07-08 22:09:08 +00:00
Jonas Devlieghere a5ede3182b Remove install-headers
After discussing this internally, it is my understanding this was used
for building LLDB internally at Apple, and is no longer used or
necessary.

llvm-svn: 365392
2019-07-08 21:53:22 +00:00
Jonas Devlieghere cbdf794872 Remove lldb-perf
As discussed offline, this tool is no longer used or maintained, and
doesn't provide the right abstraction for performance tracking in lldb.

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

llvm-svn: 365391
2019-07-08 21:38:34 +00:00
Jonas Devlieghere 39d1f2f5ea [Windows] Convert GetLastError to std::error_code
Create a std::error_code from the result of GetLastError, which in turn
we can use to return an llvm::Error.

llvm-svn: 365390
2019-07-08 21:19:02 +00:00
Stella Stamenova 05590baa07 [lldb] Fix two more issues in Windows following rL365226: Change LaunchThread interface to return an expected
A couple of the function signatures changed and they were not updated in the Windows HostProcess

llvm-svn: 365388
2019-07-08 21:17:58 +00:00
Stella Stamenova ed499a36b6 Revert "Move common functionality from processwindows into processdebugger"
This reverts commit 9c01eaff6a.

The changes in this commit are causing several of the LLDB tests to hang and/or timeout.

llvm-svn: 365371
2019-07-08 18:53:32 +00:00
Jonas Devlieghere 099231839a [Host] Fix out-of-line definition on Windows
Add missing interface changes after r365295.

llvm-svn: 365358
2019-07-08 17:45:11 +00:00
Jonas Devlieghere 2734f5c89c [Host] Fix out-of-line definition of StartMonitoringChildProcess
llvm-svn: 365344
2019-07-08 16:31:37 +00:00
Michal Gorny 10c96cabc1 [lldb] [test] Update NetBSD XFAILs in test suite
llvm-svn: 365338
2019-07-08 16:16:07 +00:00
Fangrui Song 23d10f7a4e Change LaunchThread interface to return an Expected for non-Apple-non-Windows
Fixes Linux build errors after D64163/r365226

llvm-svn: 365295
2019-07-08 07:07:05 +00:00
Saleem Abdulrasool 842f55f3ef Process: generalise Windows thread setup
The Windows build currently cannot support debugging foreign targets or
debugging Windows ARM NT and Windows ARM64 targets.  Do not assume a
x64/x86 host.  This enables building lldb for Windows ARM64.

llvm-svn: 365282
2019-07-07 17:58:11 +00:00
Jonas Devlieghere abd1561f15 [LLDBAssert] Use unreachable instead of assert(0)
As per Davide's suggestion offline.

llvm-svn: 365250
2019-07-05 21:54:20 +00:00
Raphael Isemann 5ccdabf25d [lldb] Added assert to VerifyDecl
We could VerifyDecl sometimes with a nullptr. It would be nice if we
could get an actual assert here instead of triggering UB.

llvm-svn: 365247
2019-07-05 21:32:39 +00:00
Jonas Devlieghere b0fc4d470f lldb_assert: abort when assertions are enabled.
We had a long discussion in D59911 about lldb_assert and what it means.
The result was the assert manifesto on lldb.llvm.org.

> LLDB provides lldb_assert() as a soft alternative to cover the middle
> ground of situations that indicate a recoverable bug in LLDB. In a
> Debug configuration lldb_assert() behaves like assert(). In a Release
> configuration it will print a warning and encourage the user to file a
> bug report, similar to LLVM’s crash handler, and then return
> execution.

However, currently lldb_assert doesn't behave they way it's being
described there: it doesn't abort in a debug/assert build. This patch
fixes that by adding a call to assert() in lldb_assert().

Differential revision: https://reviews.llvm.org/D64267#1571962

llvm-svn: 365246
2019-07-05 21:22:54 +00:00
Davide Italiano ee7b1ce665 [CplusPlus] ISVTableName is unused. NFCI.
Reviewers: teemperor, JDevlieghere

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 365243
2019-07-05 20:45:57 +00:00
Jonas Devlieghere f39c2e188d Change LaunchThread interface to return an expected.
Change the interface to return an expected, instead of taking a Status
pointer.

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

llvm-svn: 365226
2019-07-05 17:42:08 +00:00
Raphael Isemann c494481ea4 Add assert for 'bad' code path in GetUniqueNamespaceDeclaration
Summary:
If we call this function with a non-namespace as a second argument (and a nullptr name), we currently
only get a nullptr as a return when we hit the "Bad!!!" code path. This patch just adds an assert as this
seems to be a programming error in the calling code.

Reviewers: shafik

Subscribers: abidh, lldb-commits

Tags: #lldb

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

llvm-svn: 365157
2019-07-04 19:49:31 +00:00
Saleem Abdulrasool 1522073fed Plugins: permit building on Windows ARM64
Rather than relying on `sizeof(void *)` to determine the architecture,
use the `CMAKE_SYSTEM_PROCESSOR` variable.  This should allow us to
build for Windows and cross-compile.  Without this, we would attempt to
build the x64 plugin on ARM64 which would fail due to the `CONTEXT` type
being defined for ARM64 rather than `x64`.

llvm-svn: 365155
2019-07-04 19:26:49 +00:00
Raphael Isemann e0afcd8d26 Refactor ObjectFile::GetSDKVersion
Summary: This patch modernizes the GetSDKVersion API and hopefully prevents problems such as the ones discovered in D61218.

Reviewers: aprantl, jasonmolenda, clayborg

Reviewed By: aprantl, clayborg

Subscribers: clayborg, labath, lldb-commits

Tags: #lldb

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

llvm-svn: 365090
2019-07-03 22:21:10 +00:00
Jonas Devlieghere 667ca68bde [Docs] Remove stale builder
llvm-svn: 365086
2019-07-03 20:53:57 +00:00