aboutsummaryrefslogtreecommitdiff
path: root/lldb
AgeCommit message (Collapse)AuthorFilesLines
2018-01-02[Core/Debugger] Remove some code that doesn't compile anymore.Davide Italiano1-69/+0
llvm-svn: 321654
2018-01-02[MacOSX-Kernel] Remove broken KDP_IMAGEPATH support.Davide Italiano1-37/+0
llvm-svn: 321652
2018-01-02[ARM64] Remove unused function. NFCI.Davide Italiano1-13/+0
llvm-svn: 321651
2017-12-28Remove duplicate declaration from D41550; NFC Aaron Smith1-4/+0
llvm-svn: 321514
2017-12-28Update failing PDB unit tests that are searching for symbols by regexAaron Smith2-12/+12
Summary: D41086 fixed an exception in FindTypes()/FindTypesByRegex() and caused two lldb unit test to fail. This change updates the unit tests to pass again. Reviewers: zturner, lldb-commits, labath, clayborg, asmith Reviewed By: asmith Differential Revision: https://reviews.llvm.org/D41550 llvm-svn: 321511
2017-12-22debugserver: Propagate environment in launch-mode (pr35671)Pavel Labath7-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
2017-12-22Enable TestReadMemCString on non-darwin targetsPavel Labath2-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
2017-12-22[lldb] Stop searching for a symbol in a pdb by regexAaron Smith4-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
2017-12-22Change SBProcess::ReadCStringFromMemory() back to returningJason Molenda5-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
2017-12-22Change the default Aarch64 ISA to be v8.2 to correctly decode newerJason Molenda1-0/+5
instructions (e.g. on the new iphones). <rdar://problem/30585124> llvm-svn: 321328
2017-12-22Enable more abilities in SymbolFilePDBAaron Smith2-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
2017-12-21Bring clang options in error messages up to date.Adrian Prantl1-4/+4
llvm-svn: 321322
2017-12-21Make one more test redhat-compatiblePavel Labath1-11/+11
This test was also using "a" in an expression. llvm-svn: 321277
2017-12-21Work around test failures on red-hat linuxPavel Labath3-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
2017-12-21Make sure DataBufferLLVM contents are writablePavel Labath12-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
2017-12-19Replace an accidentally added "break" with an LLVM_FALLTHROUGH.Adrian Prantl1-1/+1
Thanks to Greg Clayton for catchting this! llvm-svn: 321123
2017-12-19Fix a couple of warnings (NFC)Adrian Prantl4-3/+7
llvm-svn: 321120
2017-12-19Temporarily XFAIL test/functionalities/exec while investiagting bot breakage.Adrian Prantl1-0/+2
When building with cmake on green gragon or on ci.swift.org, this test fails. rdar://problem/36134350 llvm-svn: 321095
2017-12-19Tweak to the debugserver entitlements setup in the xcode projectJason Molenda1-22/+12
file. For macos builds specifically, use the macosx entitlements files; for all other builds, use the ios etc entitlements. llvm-svn: 321051
2017-12-18Fix more inconsistent line endings. NFC.Dimitry Andric2-102/+102
llvm-svn: 321016
2017-12-18Fix regression in jModulesInfo packet handlingPavel Labath2-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
2017-12-18llgs: Propagate the environment when launching the inferior from command linePavel Labath8-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
2017-12-18Fix FreeBSD build broken by r320966Pavel Labath1-25/+22
llvm-svn: 320969
2017-12-18Add LLVMObject dependency to our ObjectFileELF pluginPavel Labath1-0/+1
llvm-svn: 320967
2017-12-18Reduce x86 register context boilerplate.Pavel Labath5-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
2017-12-18NPL: Clean up handling of inferior exitPavel Labath3-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
2017-12-17[testsuite] Un-XFAIL the global variables tests.Davide Italiano1-6/+0
<rdar://problem/28725399> Differential Revision: https://reviews.llvm.org/D41312 llvm-svn: 320952
2017-12-15[CMake] darwin-debug is an hard dependency for tests on macOS.Davide Italiano1-0/+5
Fixes a few failured on the testsuite with CMake. llvm-svn: 320891
2017-12-15[MacOSX/Queues] Relax an overly aggressive assertion in a test.Davide Italiano1-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
2017-12-15llgs-tests: Add support for "exit" stop-reply packetsPavel Labath6-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
2017-12-15Fix 32-bit builds broken by 320813Pavel Labath1-2/+2
cast to size_t to avoid narrowing error. llvm-svn: 320816
2017-12-15ObjectFileELF: Add support for compressed sectionsPavel Labath10-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
2017-12-15llgs-tests: Make addition of new tests easierPavel Labath8-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
2017-12-15[ExpressionParser] Fix evaluation failures due to mismatch in C++ versions.Davide Italiano1-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
2017-12-15[ExpressionParser] Rollback C++98 as the standard for evaluating.Davide Italiano1-8/+0
Some ubuntu bots are failing with this patch in, let me unblock while I investigate. llvm-svn: 320769
2017-12-14[ExpressionParser] Fix evaluation failures due to mismatch in C++ versions.Davide Italiano1-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
2017-12-14[ClangASTContext] Remove dead stuff found fixing something else.Davide Italiano1-75/+0
llvm-svn: 320759
2017-12-14ObjectFile: remove ReadSectionData/MemoryMapSectionData mutual recursionPavel Labath3-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
2017-12-14Remove stderr message from GDBRemoteCommunicationServerLLGSPavel Labath1-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
2017-12-13[IRExecutionUnit] Initialize uninititialized member variable.Davide Italiano1-2/+2
Found by the ubsan build. <rdar://problem/31106358> llvm-svn: 320541
2017-12-13[DataEncoder] Replace buggy versions of write functions.Davide Italiano1-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
2017-12-13[lldb] Set component when invoking add_llvm_install_targetsPetr Hosek1-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
2017-12-12Add an #include to appease an older clang, NFCVedant Kumar1-0/+1
Add in a missing #include that AppleClang-900 complains about when building with -DLLVM_ENABLE_MODULES. llvm-svn: 320522
2017-12-12Avoid module import in a textual header, NFCVedant Kumar1-5/+2
This unbreaks the lldb modules build (-DLLVM_ENABLE_MODULES=On). llvm-svn: 320456
2017-12-12[TestModulesInlineFunctions] This test now passes.Davide Italiano1-1/+0
Remove yet another spurious unexpected success. Ack'ed by Jim Ingham. Fixes PR25743. llvm-svn: 320454
2017-12-12[TestCppScope] This test now passes on Darwin.Davide Italiano1-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
2017-12-12[testsuite] Remove even more testing vestiges.Davide Italiano1-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
2017-12-12Rollback [Testsuite] Rename this file from *m -> *mm.Davide Italiano1-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
2017-12-12[testsuite] Remove testing failures vestiges.Davide Italiano1-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
2017-12-12[lldb] Switch to add_llvm_install_targetsShoaib Meenai1-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