summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
* update TestRunCommandInterpreterAPI to use SBFileLawrence D'Anna2019-10-101-4/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: If you look at what this test is doing, it's actually quite mysterious why it works at all. It sets the input file inside a "with open". As soon as the with block ends, that file will be closed. And yet somehow LLDB reads commands from it anyway. What's actually happening is that the file descriptor gets dup'd when something inside LLDB calls File::GetStream(). I think it's fair to say that what this test is doing is illegal and it has no right to expect it to work. This patch updates the test with two cases. One uses the SBFile api, and actually transfers ownership of the original file descriptor to the debugger. The other just uses the old FILE* API, but in a sane way. I also set NO_DEBUG_INFO_TESTCASE, because this test doesn't use any debug info and doesn't need to run three times. Reviewers: JDevlieghere, jasonmolenda, labath Reviewed By: labath Subscribers: aprantl, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68738 llvm-svn: 374424
* update SBDebugger::SetInputFile() etc to work on native FilesLawrence D'Anna2019-10-104-6/+48
| | | | | | | | | | | | | | | | | | | Summary: This patch adds FileSP versions of SetInputFile(), SetOutputFile, and SetErrorFile(). SWIG will convert native python file objects into FileSP. Reviewers: JDevlieghere, jasonmolenda, labath Reviewed By: labath Subscribers: clayborg, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68734 llvm-svn: 374422
* TestFileHandle.py: fix for Python 3.6Lawrence D'Anna2019-10-101-2/+2
| | | | | | | | | | | | | | | | | | | Summary: Python 3.6 stringifies exceptions as `ExceptionClass("foo",)` instead of `ExceptionClass("foo")`. This patch makes the test assertions a little more flexible so the test passes anyway. Reviewers: JDevlieghere, jasonmolenda, labath Reviewed By: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68745 llvm-svn: 374417
* Remove merge marker :-)Adrian Prantl2019-10-101-4/+0
| | | | llvm-svn: 374414
* Die, TABS, die, die, die, die...Jim Ingham2019-10-101-3/+7
| | | | | | Not sure how tabs got into this file, but they don't belong there. llvm-svn: 374412
* Remove CC autodetection from Makefile.rulesAdrian Prantl2019-10-101-9/+2
| | | | | | | | | | | Auto-detecting CC in Makefile.rules is no longer useful. Ever since out-of-tree builds we are better off just running lldb-dotest which sets it directly. This also makes it harder to accidentally unset CC in a Makefile. Differential Revision: https://reviews.llvm.org/D68731 llvm-svn: 374402
* Speed up accelerator table lookupsAdrian Prantl2019-10-1012-3/+116
| | | | | | | | | | | | | | | | | | | When debugging a large program like clang and doing "frame variable *this", the ValueObject pretty printer is doing hundreds of scoped FindTypes lookups. The ones that take longest are the ones where the DWARFDeclContext ends in something like ::Iterator which produces many false positives that need to be filtered out *after* extracting the DIEs. This patch demonstrates a way to filter out false positives at the accerator table lookup step. With this patch lldb clang-10 -o "b EmitFunctionStart" -o r -o "f 2" -o "fr v *this" -b -- ... goes (in user time) from 5.6s -> 4.8s or (in wall clock) from 6.9s -> 6.0s. Differential Revision: https://reviews.llvm.org/D68678 llvm-svn: 374401
* Implement serializing scripted breakpoints and their extra args.Jim Ingham2019-10-107-37/+123
| | | | | | Differential Revision: https://reviews.llvm.org/D68750 llvm-svn: 374394
* [test] Use a different module cache for Shell and API tests.Jonas Devlieghere2019-10-1011-28/+65
| | | | | | | | | | | | | | Before the test reorganization, everything was part of a single test suite with a single module cache. Now that things are properly separated this is no longer the case. Only the shell tests inherited the logic to properly configure and wipe the module caches. This patch adds that logic back for the API tests. While doing so, I noticed that we were configuring a Clang module cache in CMake, but weren't actually using it from dotest.py. I included a fix for that in this patch as well. Differential revision: https://reviews.llvm.org/D68755 llvm-svn: 374386
* [test] Pass DSYMUTIL and SDKROOT as part of the Make invocation.Jonas Devlieghere2019-10-101-5/+36
| | | | | | | | | | Pass the DSYMUTIL and SDKROOT variables on the command line instead of the environment. This makes it easier to reproduce the make invocation during development. Differential revision: https://reviews.llvm.org/D68812 llvm-svn: 374385
* [test] Trim the symbtab test case (NFC)Jonas Devlieghere2019-10-101-10/+0
| | | | | | We don't actually need the section content for this tests. llvm-svn: 374382
* Increase timeout in pexpect to lower chances of tests failing under ASAN.Adrian Prantl2019-10-101-1/+1
| | | | | | | If this doesn't actually work, I'll revert the change and just disable the remaining thee pexpect tests under asan. llvm-svn: 374375
* Increase timeout in gdbclientutils.py to decrease chance of test failing ↵Adrian Prantl2019-10-101-1/+1
| | | | | | under ASAN. llvm-svn: 374371
* unwind-via-stack-win.yaml: update for changes in yaml formatPavel Labath2019-10-101-1/+15
| | | | llvm-svn: 374353
* [lldb] Fix minidebuginfo-set-and-hit-breakpoint.testRaphael Isemann2019-10-101-1/+1
| | | | | | | | | This was failing for me because of this error: llvm-objcopy: error: 'build/tools/lldb/test/ObjectFile/ELF/Output/minidebuginfo-set-and-hit-breakpoint.test.tmp.mini_debuginfo': section '.dynsym' cannot be removed because it is referenced by the section '.hash' Patch by Konrad Kleine! llvm-svn: 374352
* [lldb] Add log output for the support files we pass to the ↵Raphael Isemann2019-10-101-0/+11
| | | | | | | | | | | CppModuleConfiguration CppModuleConfiguration is the most likely point of failure when we have weird setups where we fail to load a C++ module. With this logging it should be easier to figure out why we can't find a valid configuration as the configuration only depends on the list of file paths. llvm-svn: 374350
* Fix the unwinding plan augmentation from x86 assemblyPavel Labath2019-10-102-16/+106
| | | | | | | | | | | | | | | | | | Unwind plan augmentation should compute the plan row at offset x from the instruction before offset x, but currently we compute it from the instruction at offset x. Note that this behavior is a regression introduced when moving the x86 assembly inspection engine to its own file (https://github.com/llvm/llvm-project/commit/1c9858b298d79ce82c45a2954096718b39550109#diff-375a2be066db6f34bb9a71442c9b71fcL913); the original version handled this properly by copying the previous instruction out before advancing the instruction pointer. The relevant bug with more info is here: https://bugs.llvm.org/show_bug.cgi?id=43561 Differential Revision: https://reviews.llvm.org/D68454 Patch by Jaroslav Sevcik <jarin@google.com>. llvm-svn: 374342
* Fix some dangling else warningsPavel Labath2019-10-101-9/+10
| | | | | | | | EXPECT_EQ contains an if-else statement. It also contains some magic to suppress the dangling else warnings, but it seems that some new compilers can see through that... llvm-svn: 374341
* [lldb] Make sure import-std-module/sysroot actually passes for the right reasonsRaphael Isemann2019-10-106-9/+16
| | | | | | | | | | | | This test was previously passing because myabs was actually emitted into the debug information and we called that. The test itself was broken as it didn't use the libc++ directory structure (the /v1/ directory was just called /include/). This patch gives myabs a default argument which we can't get from debug information and inlines the function to make sure we can't call it from LLDB without loading the C++ module. llvm-svn: 374335
* File: Handle more cases in GetOptionsFromModePavel Labath2019-10-101-9/+11
| | | | | | | | | | The "b" (binary) flag is meaningless most of the time, but the relevant standars allow it. The standards permit one to spell it both as "r+b" and "rb+", so handle both cases. This fixes TestFileHandle.test_binary_inout with python2. llvm-svn: 374331
* [Windows] Introduce a switch for the `lldb-server` mode on WindowsAleksandr Urakov2019-10-101-6/+17
| | | | | | | | | | | | | | | | | | | Summary: This patch introduces a switch, based on the environment variable `LLDB_USE_LLDB_SERVER`, to determine whether to use the `ProcessWindows` plugin (the old way) or the `lldb-server` way for debugging on Windows. Reviewers: labath, amccarth, asmith, stella.stamenova Reviewed By: labath, amccarth Subscribers: mstorsjo, abidh, JDevlieghere, lldb-commits, leonid.mashinskiy Tags: #lldb Differential Revision: https://reviews.llvm.org/D68258 llvm-svn: 374325
* TestFileHandle.py: relax exception type checksPavel Labath2019-10-101-3/+3
| | | | | | | | | | | | the exceptions returned differ between swig4 (TypeError) and swig<=3 (NotImplementedError). Just check for the base Exception class instead. Theoretically we could switch on the swig version and expect the precise type directly, but checking the exact type does not seem that important. Thanks to Raphael for helping me figure this out. llvm-svn: 374322
* [lldb][NFC] Remove strange bool parameter from Searcher::SearchCallbackRaphael Isemann2019-10-1023-80/+60
| | | | | | | | | | | | | | | | | | | Summary: The SearchCallback has a bool parameter that we always set to false, we never use in any callback implementation and that also changes its name from one file to the other (either `containing` and `complete`). It was added in the original LLDB check in, so there isn't any history what this was supposed to be, so let's just remove it. Reviewers: jingham, JDevlieghere, labath Reviewed By: jingham, labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68696 llvm-svn: 374313
* [lldb] Fix out of bounds read in DataExtractor::GetCStr and add unit test ↵Raphael Isemann2019-10-102-19/+63
| | | | | | | | | | | | | | | | | | | | | | | | that function. Summary: The `if (*cstr_end == '\0')` in the previous code checked if the previous loop terminated because it found a null terminator or because it reached the end of the data. However, in the case that we hit the end of the data before finding a null terminator, `cstr_end` points behind the last byte in our data and `*cstr_end` reads the memory behind the array (which may be uninitialised) This patch just rewrites that function use `std::find` and adds the relevant unit tests. Reviewers: labath Reviewed By: labath Subscribers: abidh, JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68773 llvm-svn: 374311
* [lldb][NFC] Use llvm::all_of instead of std::all_of in CppModuleConfigurationRaphael Isemann2019-10-101-3/+3
| | | | llvm-svn: 374307
* s/@expectedFailure/@expectedFailureAll in TestFileHandlePavel Labath2019-10-101-12/+11
| | | | | | | | | The test isn't using @expectedFailure correctly, which causes weird errors, at least with python2, at least with linux. Possibly that function shouldn't even be public as it's main use is as a backed for other decorators. llvm-svn: 374299
* [lldb][NFC] Use unique_ptr in DiagnosticManager to express ownershipRaphael Isemann2019-10-104-52/+61
| | | | llvm-svn: 374289
* Change debugserver to use the brk #0 for breakpoints.Jason Molenda2019-10-101-3/+1
| | | | | | | | | | debugserver had been using an instruction that would work for armv7 or aarch64 processes, but we don't have armv7 code running on arm64 devices any more so this is unnecessary. <rdar://problem/56133118> llvm-svn: 374264
* TestMTCSimple.py: allow the test to run on Darwin embedded platformsFrederic Riss2019-10-093-13/+20
| | | | | | | The test needed some updates to run using a different UI toolkit and with a different libMTC, but it should run fine on a device. llvm-svn: 374262
* TestIndirectSymbols: Modernize the MakefileFrederic Riss2019-10-092-36/+14
| | | | | | | | This old test used a completely hand-rolled Makefile. Modernize so that it's able to cross-compile. And XFAIL the test as it fails on embedded targets... llvm-svn: 374256
* Makefile.rules: add missing CODESIGN callFrederic Riss2019-10-091-0/+3
| | | | | | | When building an executable and a shared library at the same time (yes, Makefile.rules is setup to do this!) the executable was not codesigned. llvm-svn: 374251
* [lldb] Put site-packages into a sub dir of CMAKE_CFG_INTDIRHaibo Huang2019-10-091-1/+2
| | | | | | | | | | | | | | Summary: Fixes issue like D68719 Reviewers: tatyana-krasnukha Subscribers: mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68728 llvm-svn: 374250
* Set eRegisterKindEHFrame register numbers for 32 bit ARM register contexts ↵Greg Clayton2019-10-093-11/+88
| | | | | | | | | | in minidumps Stack unwinding was sometimes failing when trying to unwind stacks in 32 bit ARM. I discovered this was because the EH frame register numbers were not set. This patch fixes this issue and adds a unit test to verify this doesn't regress. Differential Revision: https://reviews.llvm.org/D68088 llvm-svn: 374246
* [CMake] Use the correct lit.cfg.pyJonas Devlieghere2019-10-091-1/+1
| | | | llvm-svn: 374244
* Fix a crasher due to an assert when two files have the same UUID but ↵Greg Clayton2019-10-093-24/+81
| | | | | | | | | | | | | | | | different paths. Summary: The PlaceholderObjectFile has an assert in SetLoadAddress that fires if "m_base == value" is not true. To avoid this, we create check that the base address matches, and if it doesn't we clear the module that was found using the UUID so that we create a new PlaceholderObjectFile. Added a test to cover this issue. Reviewers: labath, aadsm, dvlahovski Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68106 llvm-svn: 374242
* remove a smattering of isolated, unnecessary uses of FILE*Lawrence D'Anna2019-10-093-13/+11
| | | | | | | | | | | | | | | | | | Summary: There a a few call sites that use FILE* which are easy to fix without disrupting anything else. Reviewers: JDevlieghere, jasonmolenda, labath Reviewed By: JDevlieghere, labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68444 llvm-svn: 374239
* SBFile support in SBCommandReturnObjectLawrence D'Anna2019-10-0911-40/+144
| | | | | | | | | | | | | | | | | | Summary: This patch add SBFile interfaces to SBCommandReturnObject, and removes the internal callers of its FILE* interfaces. Reviewers: JDevlieghere, jasonmolenda, labath Reviewed By: JDevlieghere Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68434 llvm-svn: 374238
* SBFile: add a bunch of tests that should eventually work.Lawrence D'Anna2019-10-092-15/+291
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: It's really annoying and confusing to have to keep referring back to earlier versions of this SBFile work to find the tests that need to be added for each patch, and not duplicate them with new tests. This patch just imports all my tests. A bunch of them don't work yet, so they are marked to be skipped. They'll be unmarked as I fix them. One of these tests will actually trip an assert in the SWIG code now instead of just failing, so I'm fixing that here too. Reviewers: JDevlieghere, jasonmolenda, labath Reviewed By: JDevlieghere, labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68433 llvm-svn: 374237
* [Reproducer] Add convenience methods IsCapturing and IsReplaying.Jonas Devlieghere2019-10-092-3/+6
| | | | | | | Add convenience methods to the Reproducer class for when you don't need access to the generator and the loader. llvm-svn: 374236
* TestHelloWorld: Make compatible with remote testingFrederic Riss2019-10-091-10/+14
| | | | | | The synchronization token handling was not remote-friendly. llvm-svn: 374234
* [LLDB] Fix for regression of test 'TestDataFormatterInvalidStdUniquePtr.py' ↵Cameron Desrochers2019-10-093-5/+7
| | | | | | | | introduced in r374195 Differential Revision: https://reviews.llvm.org/D68641 llvm-svn: 374231
* [LLDB] Remove standalone build dep on llvm-stripJonas Devlieghere2019-10-091-1/+6
| | | | | | | | | | | | When building standalone, since llvm-strip is a symlink, it is created using add_custom_command/add_custom_target which cannot be exported, and thus cannot be depended on by lldb. Patch by: Gwen Mittertreiner Differential revision: https://reviews.llvm.org/D68614 llvm-svn: 374229
* Revert "[lldb] Calculate relative path for symbol links"Jim Ingham2019-10-091-4/+19
| | | | | | | | | | | | | | | | | | | | | | | This reverts commit 958091c209d0a92e38b9cb27fb77a0ff7da11853. This commit incorrectly sets the _lldb.so symlink (at least it does when building in Stefans' two build directory mode, where you build llvm with cmake/ninja and lldb with cmake/Xcode, using a cmake generated project. The _lldb.so link is SUPPOSED to point to: bin/LLDB.framework/Versions/A/LLDB but instead it points to bin/LLDB which is where LLDB was staged to before constructing the framework. This causes all sorts of problems when we then build the lldb driver into bin - remember that MacOS is a case-preserving but case insensitive filesystem - so when we later go to dlopen _lldb.so, we dlopen the main executable instead. llvm-svn: 374226
* allow arbitrary python streams to be converted to SBFileLawrence D'Anna2019-10-096-33/+813
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds SWIG typemaps that can convert arbitrary python file objects into lldb_private::File. A SBFile may be initialized from a python file using the constructor. There are also alternate, tagged constructors that allow python files to be borrowed, and for the caller to control whether or not the python I/O methods will be called even when a file descriptor is available.I Reviewers: JDevlieghere, jasonmolenda, labath Reviewed By: labath Subscribers: zturner, amccarth, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68188 llvm-svn: 374225
* Skip Apple simulator test for all remote testing scenarios.Frederic Riss2019-10-091-3/+3
| | | | | | | The test makes no sense to run remotely, period. The architecture of the target is not the discriminant here. llvm-svn: 374217
* [CMake] Fix add_lldb_test_dependencyJonas Devlieghere2019-10-092-10/+12
| | | | | | | This function would ignore all but the first argument. Now it correctly adds every dependency by iterating over its arguments. llvm-svn: 374216
* [utils] Update lldb-dotest for new test layoutJonas Devlieghere2019-10-091-1/+1
| | | | | | The path to dotest.py changed after the test directory reorganization. llvm-svn: 374215
* [test] Skip entry value test when clang < 10.0.0Vedant Kumar2019-10-091-0/+1
| | | | | | | | clang-9 emitted the wrong opcode for entry values on Darwin. rdar://56119661 llvm-svn: 374212
* Re-land "[test] Split LLDB tests into API, Shell & Unit"Jonas Devlieghere2019-10-09450-258/+331
| | | | | | | The original patch got reverted because it broke `check-lldb` on a clean build. This fixes that. llvm-svn: 374201
* protect libedit and LLDB gui from receiving null FILE* streamsLawrence D'Anna2019-10-092-2/+5
| | | | | | | | | | | | | | | | | | | | | | Summary: We now have valid files that will return NULL from GetStream(). libedit and the LLDB gui are the only places left that need FILE* streams. Both are doing curses-like user interaction that only make sense with a real terminal anyway, so there is no need to convert them off of their use of FILE*. But we should check for null streams before enabling these features. Reviewers: JDevlieghere, jasonmolenda, labath Reviewed By: JDevlieghere, labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68677 llvm-svn: 374197
OpenPOWER on IntegriCloud