summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
...
* debugserver: Propagate environment in launch-mode (pr35671)Pavel Labath2017-12-227-22/+77
| | | | | | | | | | | | | | | | | | Summary: Make sure we propagate environment when starting debugserver with a pre-loaded inferior. AFAIK, RNBRunLoopLaunchInferior is only called in pre-loaded inferior scenario, so we can just pick up the debugserver environment instead of trying to construct an envp from the (empty) context. This makes debugserver pass an test added for an equivalent lldb-server fix. Reviewers: jasonmolenda, clayborg Subscribers: JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D41352 llvm-svn: 321355
* Enable TestReadMemCString on non-darwin targetsPavel Labath2017-12-222-11/+4
| | | | | | | | | | | | | | The test works fine on linux, and I believe other targets should not have an issue with as well. If they do, we can start blacklisting instead of whitelisting. The idea of using "-1" as the value of the pointer on non-apple targets backfired, as it fails the "address != LLDB_INVALID_ADDRESS" test (-1 is the value of LLDB_INVALID_ADDRESS). However, it should be safe to use 0x100 for other targets as well. The first page of memory is generally kept unreadable to catch null pointer dereferences. llvm-svn: 321353
* [lldb] Stop searching for a symbol in a pdb by regexAaron Smith2017-12-224-15/+24
| | | | | | | | | | | | | | | | | Summary: It was possible when searching for a symbol by regex in a pdb that an invalid regex would cause an exception on Windows. This updates the code to avoid throwing an exception. When fixing the exception it was decided there is no reason to search for a symbol in a pdb by regex. To support this, SymbolFilePDB::FindTypes() now only searches for types by name and no longer calls FindTypesByRegEx(). Reviewers: zturner, lldb-commits Reviewed By: zturner Subscribers: clayborg Differential Revision: https://reviews.llvm.org/D41086 llvm-svn: 321344
* Change SBProcess::ReadCStringFromMemory() back to returningJason Molenda2017-12-225-2/+84
| | | | | | | | | an empty Python string object when it reads a 0-length string out of memory (and a successful SBError object). <rdar://problem/26186692> llvm-svn: 321338
* Change the default Aarch64 ISA to be v8.2 to correctly decode newerJason Molenda2017-12-221-0/+5
| | | | | | | instructions (e.g. on the new iphones). <rdar://problem/30585124> llvm-svn: 321328
* Enable more abilities in SymbolFilePDBAaron Smith2017-12-222-4/+46
| | | | | | | | | | | | | | | | Summary: 1) Finding symbols through --symfile 2) More abilities: Functions, Blocks, GlobalVariables, LocalVariables, VariableTypes Reviewers: zturner, lldb-commits Reviewed By: zturner Subscribers: clayborg Differential Revision: https://reviews.llvm.org/D41092 llvm-svn: 321327
* Bring clang options in error messages up to date.Adrian Prantl2017-12-211-4/+4
| | | | llvm-svn: 321322
* Make one more test redhat-compatiblePavel Labath2017-12-211-11/+11
| | | | | | This test was also using "a" in an expression. llvm-svn: 321277
* Work around test failures on red-hat linuxPavel Labath2017-12-213-8/+41
| | | | | | | | | | | | | | | | Two tests were failing because the debugger was picking up multiply defined internal symbols from the system libraries. This is a bug, as there should be no ambiguity because the tests are defining variables with should shadow these symbols, but lldb is not smart enough to figure that out. I work around the issue by renaming the variables in these tests, and in exchange I create a self-contained test which reproduces the issue without depending on the system libraries. This increases the predictability of our test suite. llvm-svn: 321271
* Make sure DataBufferLLVM contents are writablePavel Labath2017-12-2112-79/+61
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: We sometimes need to write to the object file we've mapped into memory, generally to apply relocations to debug info sections. We've had that ability before, but with the introduction of DataBufferLLVM, we have lost it, as the underlying llvm class (MemoryBuffer) only supports read-only mappings. This switches DataBufferLLVM to use the new llvm::WritableMemoryBuffer class as a back-end, as this one guarantees to return a writable buffer. This removes the need for the "Private" flag to the DataBufferLLVM creation functions, as it was really used to mean "writable". The LLVM function also does not have the NullTerminate flag, so I've modified our clients to not require this feature and removed that flag as well. Reviewers: zturner, clayborg, jingham Subscribers: emaste, aprantl, arichardson, krytarowski, lldb-commits Differential Revision: https://reviews.llvm.org/D40079 llvm-svn: 321255
* Replace an accidentally added "break" with an LLVM_FALLTHROUGH.Adrian Prantl2017-12-191-1/+1
| | | | | | Thanks to Greg Clayton for catchting this! llvm-svn: 321123
* Fix a couple of warnings (NFC)Adrian Prantl2017-12-194-3/+7
| | | | llvm-svn: 321120
* Temporarily XFAIL test/functionalities/exec while investiagting bot breakage.Adrian Prantl2017-12-191-0/+2
| | | | | | | | When building with cmake on green gragon or on ci.swift.org, this test fails. rdar://problem/36134350 llvm-svn: 321095
* Tweak to the debugserver entitlements setup in the xcode projectJason Molenda2017-12-191-22/+12
| | | | | | | file. For macos builds specifically, use the macosx entitlements files; for all other builds, use the ios etc entitlements. llvm-svn: 321051
* Fix more inconsistent line endings. NFC.Dimitry Andric2017-12-182-102/+102
| | | | llvm-svn: 321016
* Fix regression in jModulesInfo packet handlingPavel Labath2017-12-182-8/+38
| | | | | | | | | | | | | | | | | | | | | | | The recent UUID cleanups exposed a bug in the parsing code for the jModulesInfo response, which was passing wrong value for the second argument to UUID::SetFromStringRef (it passed the length of the string, whereas the correct value should be the number of decoded bytes we expect to receive). This was not picked up by tests, because they test with 16-byte uuids, for which the function happens to do the right thing even if the length does not match (if the length does not match, the function does not update m_num_uuid_bytes member, but that member is already 16 to begin with). I fix that and add a test with 20-byte uuid to catch if this regresses. I have also added more safeguards into the parsing code to fail if we cannot parse the entire uuid field we recieve. While testing the latter part, I noticed that the "negative" jModulesInfo tests were succeeding because we were sending malformed json (and not because the json contents was invalid), so I make those tests a bit more robuts as well. llvm-svn: 320985
* llgs: Propagate the environment when launching the inferior from command linePavel Labath2017-12-188-58/+91
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: We were failing to propagate the environment when lldb-server was started with a pre-loaded process (e.g.: lldb-server gdbserver -- inferior --inferior_args) This patch makes sure the environment is propagated. Instead of adding a new GDBRemoteCommunicationServerLLGS::SetLaunchEnvironment function to complement SetLaunchArgs and SetLaunchFlags, I replace these with a more generic SetLaunchInfo, which can be used to set any launch-related property. The accompanying test also verifies that the server correctly terminates the connection after sending the exit packet (specifically, that it does not send the exit packet twice). Reviewers: clayborg, eugene Subscribers: lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D41070 llvm-svn: 320984
* Fix FreeBSD build broken by r320966Pavel Labath2017-12-181-25/+22
| | | | llvm-svn: 320969
* Add LLVMObject dependency to our ObjectFileELF pluginPavel Labath2017-12-181-0/+1
| | | | llvm-svn: 320967
* Reduce x86 register context boilerplate.Pavel Labath2017-12-185-82/+71
| | | | | | | | | | | | | | | | | | | | | | Summary: The x86 FPR struct was defined as a struct containing a union between two members: XSAVE and FXSAVE. This patch makes FPR a union directly to remove one layer of indirection when trying to access the members. The initial layout of these two structs is identical, which is recognised by the fact that XSAVE has FXSAVE as its first member, so we also considered removing one more layer and leave FPR identical to XSAVE struct, but stopped short of doing that, as the FPR may be used to store different layouts in the future (e.g., ones generated by the FSAVE instruction). Reviewers: clayborg, krytarowski Subscribers: emaste, lldb-commits Differential Revision: https://reviews.llvm.org/D41245 llvm-svn: 320966
* NPL: Clean up handling of inferior exitPavel Labath2017-12-183-47/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: lldb-server was sending the "exit" packet (W??) twice. This happened because it was handling both the pre-exit (PTRACE_EVENT_EXIT) and post-exit (WIFEXITED) as exit events. We had some code which was trying to detect when we've already sent the exit packet, but this stopped working quite a while ago. This never really caused any problems in practice because the client automatically closes the connection after receiving the first packet, so the only effect of this was some warning messages about extra packets from the lldb-server test suite, which were ignored because they didn't fail the test. The new test suite will be stricter about this, so I fix this issue ignoring the first event. I think this is the correct behavior, as the inferior is not really dead at that point, so it's premature to send the exit packet. There isn't an actual test yet which would verify the exit behavior, but in my next patch I will add a test which will also test this functionality. Reviewers: eugene Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D41069 llvm-svn: 320961
* [testsuite] Un-XFAIL the global variables tests.Davide Italiano2017-12-171-6/+0
| | | | | | | | <rdar://problem/28725399> Differential Revision: https://reviews.llvm.org/D41312 llvm-svn: 320952
* [CMake] darwin-debug is an hard dependency for tests on macOS.Davide Italiano2017-12-151-0/+5
| | | | | | Fixes a few failured on the testsuite with CMake. llvm-svn: 320891
* [MacOSX/Queues] Relax an overly aggressive assertion in a test.Davide Italiano2017-12-151-1/+2
| | | | | | | | | | "Default" is a valid QoS for a thread on older versions of macOS, like the one installed in the bot. Thanks to Jason Molenda for helping me figuring out the problem. <rdar://problem/28346273> llvm-svn: 320883
* llgs-tests: Add support for "exit" stop-reply packetsPavel Labath2017-12-156-62/+149
| | | | | | | | | | | | | | | | | | Summary: This makes StopReply class abstract, so that we can represent different types of stop replies such as StopReplyStop and StopReplyExit (there should also be a StopReplySignal, but I don't need that right now so I haven't implemented it yet). This prepares the ground for a new test I'm writing. Reviewers: eugene, zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D41067 llvm-svn: 320820
* Fix 32-bit builds broken by 320813Pavel Labath2017-12-151-2/+2
| | | | | | cast to size_t to avoid narrowing error. llvm-svn: 320816
* ObjectFileELF: Add support for compressed sectionsPavel Labath2017-12-1510-3/+116
| | | | | | | | | | | | | | | | Summary: We use the llvm decompressor to decompress SHF_COMPRESSED sections. This enables us to read data from debug info sections, which are sometimes compressed, particuarly in the split-dwarf case. This functionality is only available if llvm is compiled with zlib support. Reviewers: clayborg, zturner Subscribers: emaste, mgorny, aprantl, lldb-commits Differential Revision: https://reviews.llvm.org/D40616 llvm-svn: 320813
* llgs-tests: Make addition of new tests easierPavel Labath2017-12-158-100/+189
| | | | | | | | | | | | | | | | | | | Summary: Adding a new test would require one to duplicate a significant part of the existing test that we have. This attempts to reduce that by moving some part of that code to the test fixture. The StandardStartupTest fixture automatically starts up the server and connects it to the client. I also add a more low-level TestBase fixture, which allows one to start up the client and server in a custom way (I am going to need this for the test I am writing). Reviewers: eugene, zturner Subscribers: lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D41066 llvm-svn: 320809
* [ExpressionParser] Fix evaluation failures due to mismatch in C++ versions.Davide Italiano2017-12-151-0/+8
| | | | | | | | | | | | | | | | | | | | | | | Clang recently switched to C++14 (with GNU extensions) as the default dialect, but LLDB didn't catch up. This causes failures as LLDB still evaluates ObjectiveC expressions as Objective C++ using C++98 as standard. There are things not available in C++98, including, e.g. nullptr. In some cases Objective-C `nil` is defined as `nullptr` so this causes an evaluation failure. Switch the default to overcome this issue (actually, currently lldb evaluates both C++11 and C++14 as C++11, but that seems a larger change and definitely could be re-evaluated in the future). No test as this is currently failing on the LLDB bots after the clang switch (so, de facto, there's a test already for it). This is a recommit, with a thinko fixed (the code was previously placed incorrectly). <rdar://problem/36011995> llvm-svn: 320778
* [ExpressionParser] Rollback C++98 as the standard for evaluating.Davide Italiano2017-12-151-8/+0
| | | | | | | Some ubuntu bots are failing with this patch in, let me unblock while I investigate. llvm-svn: 320769
* [ExpressionParser] Fix evaluation failures due to mismatch in C++ versions.Davide Italiano2017-12-141-0/+8
| | | | | | | | | | | | | | | | | | | | Clang recently switched to C++14 (with GNU extensions) as the default dialect, but LLDB didn't catch up. This causes failures as LLDB still evaluates ObjectiveC expressions as Objective C++ using C++98 as standard. There are things not available in C++98, including, e.g. nullptr. In some cases Objective-C `nil` is defined as `nullptr` so this causes an evaluation failure. Switch the default to overcome this issue (actually, currently lldb evaluates both C++11 and C++14 as C++11, but that seems a larger change and definitely could be re-evaluated in the future). No test as this is currently failing on the LLDB bots after the clang switch (so, de facto, there's a test already for it). <rdar://problem/36011995> llvm-svn: 320761
* [ClangASTContext] Remove dead stuff found fixing something else.Davide Italiano2017-12-141-75/+0
| | | | llvm-svn: 320759
* ObjectFile: remove ReadSectionData/MemoryMapSectionData mutual recursionPavel Labath2017-12-143-22/+1
| | | | | | | | | | | | | | | | | | | | | | | | Summary: These two functions were calling each other, while handling different branches of the if(IsInMemory()). This had a reason at some point in the past, but right now it's just confusing. I resolve this by removing the MemoryMapSectionData function and inlining the !IsInMemory branch into ReadSectionData. There isn't anything mmap-related in this function anyway, as the decision whether to mmap is handled at a higher level. This is a preparatory step to make ObjectFileELF be able to decompress compressed sections (I want to make sure that all calls reading section data are routed through a single piece of code). Reviewers: clayborg Subscribers: emaste, JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D41169 llvm-svn: 320705
* Remove stderr message from GDBRemoteCommunicationServerLLGSPavel Labath2017-12-141-7/+2
| | | | | | | | A similar error message is printed again in lldb-gdbserver.cpp, so the user will see the message twice. Also, this is generic library code, we shouldn't really be using stderr here. llvm-svn: 320704
* [IRExecutionUnit] Initialize uninititialized member variable.Davide Italiano2017-12-131-2/+2
| | | | | | | | Found by the ubsan build. <rdar://problem/31106358> llvm-svn: 320541
* [DataEncoder] Replace buggy versions of write functions.Davide Italiano2017-12-131-36/+8
| | | | | | | | | This fixes a previously introduced thinko, now that I have a better idea of what's going on :) <rdar://problem/35941757> llvm-svn: 320540
* [lldb] Set component when invoking add_llvm_install_targetsPetr Hosek2017-12-131-2/+4
| | | | | | | | | This is needed to ensure that the distribution and install-distribution targets work properly. Differential Revision: https://reviews.llvm.org/D41144 llvm-svn: 320537
* Add an #include to appease an older clang, NFCVedant Kumar2017-12-121-0/+1
| | | | | | | Add in a missing #include that AppleClang-900 complains about when building with -DLLVM_ENABLE_MODULES. llvm-svn: 320522
* Avoid module import in a textual header, NFCVedant Kumar2017-12-121-5/+2
| | | | | | This unbreaks the lldb modules build (-DLLVM_ENABLE_MODULES=On). llvm-svn: 320456
* [TestModulesInlineFunctions] This test now passes.Davide Italiano2017-12-121-1/+0
| | | | | | | | | Remove yet another spurious unexpected success. Ack'ed by Jim Ingham. Fixes PR25743. llvm-svn: 320454
* [TestCppScope] This test now passes on Darwin.Davide Italiano2017-12-121-5/+0
| | | | | | | | | I tested on x86-64 and Jason on embedded architectures. This cleans up another couple of reported unexpected successes. <rdar://problem/28623427> llvm-svn: 320452
* [testsuite] Remove even more testing vestiges.Davide Italiano2017-12-121-3/+0
| | | | | | | With this one, the number of unexpected successes for the LLDB test suite when building with clang ToT goes down to 18. llvm-svn: 320450
* Rollback [Testsuite] Rename this file from *m -> *mm.Davide Italiano2017-12-121-0/+0
| | | | | | | | After discussing this with Jim and Jason, I think my commit was actually sweeping the issue under the carpet rather than fixing it. I'll take a closer look between tonight and tomorrow. llvm-svn: 320447
* [testsuite] Remove testing failures vestiges.Davide Italiano2017-12-121-60/+0
| | | | | | | | | | | | | | | | | Some tests are failing on macOS when building with the in-tree clang, and this is because they're conditional on the version released. Apple releases using a different versioning number, but as these are conditional on clang < 7, they fail for clang ToT (which is 6.0). As a general solution, we actually need either a mapping between Apple internal release version and public ones. That said, I discussed this with Fred , and Apple Clang 6.0 seems to be old enough that we can remove this altogether (which means I can delay implementing the general purpose solution for a bit). Differential Revision: https://reviews.llvm.org/D41101 llvm-svn: 320444
* [lldb] Switch to add_llvm_install_targetsShoaib Meenai2017-12-121-10/+6
| | | | | | | | | | | This adds the install-*-stripped targets to LLDB, which are required for the install-distribution-stripped option. We also need to create some install-*-stripped targets manually, which are modeled after their corresponding install-* targets. Differential Revision: https://reviews.llvm.org/D41099 llvm-svn: 320443
* [test-suite] Un'XFAIL a test that's not failing anymore.Davide Italiano2017-12-111-1/+0
| | | | | | | | | | This is the first of a series of commits aiming to improve overall LLDB's hygiene. Feel free to shout at me in case I break something. <rdar://problem/30915340> llvm-svn: 320425
* [Testsuite] Rename this file from *m -> *mm.Davide Italiano2017-12-111-0/+0
| | | | | | | | Should hopefully bring the bots back. <rdar://problem/35976115> llvm-svn: 320422
* dotest.py: Correctly annotate lldbinline tests with debug info categoriesPavel Labath2017-12-111-1/+4
| | | | | | | This enables one to run all dwo tests with dotest.py --category dwo, or skip them with --skip-category. llvm-svn: 320377
* Add a StringList constructor to Args classPavel Labath2017-12-114-1/+18
| | | | | | | | | Host::GetEnvironment returns a StringList, but the interface for launching a process takes Args. The fact that we use two classes for representing an environment is not ideal, but for now we should at least have an easy way to convert between the two. llvm-svn: 320366
* Fix osx build broken in r320346Pavel Labath2017-12-111-1/+0
| | | | llvm-svn: 320349
OpenPOWER on IntegriCloud