summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
...
* Make the bundle folders in the find-app-in-bundle test non-emptyPavel Labath2018-01-112-0/+0
| | | | | | | git will not create empty folders, which makes this test fail if the repo is checked out with git. llvm-svn: 322271
* Check existence of each required component during construction of ↵Tatyana Krasnukha2018-01-112-166/+174
| | | | | | | | | | | | | | | | | | | | | | | LLVMCDisassembler. Summary: Actually, fix two issues: # remove repeat creation of reg_info, use m_reg_info_ap for createMCAsmInfo instead; # remove possibility to dereference nullptr during createMCAsmInfo invocation, that could lead to undefined behavior. Placed checking of a component right after its creation to simplify the code and avoid same issues later. Reviewers: zturner, clayborg, jingham, jasonmolenda, labath Reviewed By: clayborg, labath Subscribers: labath, lldb-commits Differential Revision: https://reviews.llvm.org/D41584 llvm-svn: 322270
* Advanced guessing of rendezvous breakpoint (resubmit)Eugene Zemtsov2018-01-114-82/+146
| | | | | | | | | | | | | When rendezvous structure is not initialized we need to set up rendezvous breakpoint anyway. In this case the code will locate dynamic loader (interpreter) and look for known function names. This is r322209, but with fixed VDSO loading fixed. Bug: https://bugs.llvm.org/show_bug.cgi?id=25806 Differential Revision: https://reviews.llvm.org/D41533 llvm-svn: 322251
* Running this on other systems won't work because I don'tJim Ingham2018-01-101-0/+1
| | | | | | know how to specifically build a MachO binary on other systems. llvm-svn: 322239
* Remove Environment.h, test-dwarf.cpp, test-dwarf.exeJason Molenda2018-01-101-10/+4
| | | | | | | | | | | from being listed as a part of the desktop or desktop/desktop_no_xpc Targets - they should not be a part of any target. Having them listed as a part of desktop target results in them being added to the Copy Files build phase for desktop and I'm guessing they'd end up in the manpage directory or something. llvm-svn: 322237
* Runs the part of the test that just finds the binary on all systems.Jim Ingham2018-01-101-13/+14
| | | | | | That should work everywhere. Then only try actually running on macosx. llvm-svn: 322235
* Add a test for finding a binary in an app package.Jim Ingham2018-01-105-0/+117
| | | | llvm-svn: 322232
* Revert "Advanced guessing of rendezvous breakpoint"Eugene Zemtsov2018-01-104-140/+57
| | | | | | | This reverts commit r322209, because it broke TestNoreturnUnwind,TestInferiorAssert and TestNumThreads on i386. llvm-svn: 322229
* Advanced guessing of rendezvous breakpointEugene Zemtsov2018-01-104-57/+140
| | | | | | | | | | | When rendezvous structure is not initialized we need to set up rendezvous breakpoint anyway. In this case the code will locate dynamic loader (interpreter) and look for known function names. Bug: https://bugs.llvm.org/show_bug.cgi?id=25806 Differential Revision: https://reviews.llvm.org/D41533 llvm-svn: 322209
* [XCodebuild] Catch up with recent changes (Environment.cpp).Davide Italiano2018-01-101-2/+6
| | | | llvm-svn: 322208
* Handle O reply packets during qRcmdPavel Labath2018-01-106-3/+75
| | | | | | | | | | | | | | | | | | | | Summary: Gdb servers like openocd may send many $O reply packets for the client to output during a qRcmd command sequence. Currently, lldb interprets the first O packet as an unexpected response. Besides generating no output, this causes lldb to get out of sync with future commands because it continues reading O packets from the first command as response to subsequent commands. This patch handles any O packets during an qRcmd, treating the first non-O packet as the true response. Preliminary discussion at http://lists.llvm.org/pipermail/lldb-dev/2018-January/013078.html Reviewers: clayborg Reviewed By: clayborg Subscribers: labath, lldb-commits Differential Revision: https://reviews.llvm.org/D41745 Patch by Owen Shaw <llvm@owenpshaw.net> llvm-svn: 322190
* Add empty() function to the Environment classPavel Labath2018-01-101-0/+1
| | | | | | Needed to make the previous Freebsd fix work. llvm-svn: 322188
* Another attempt to fix FreeBsd buildPavel Labath2018-01-103-18/+13
| | | | | | | | | | the previous fix did not work because of different const qualifications on the envp pointer. This should resolve that (and remove a couple of const_casts in the process). llvm-svn: 322187
* Fix Xcode build for r322174Tim Northover2018-01-101-0/+4
| | | | llvm-svn: 322183
* Fix windows and freebsd builds for r322174 (Environment)Pavel Labath2018-01-102-9/+8
| | | | llvm-svn: 322176
* Add Utility/Environment class for handling... environmentsPavel Labath2018-01-1046-459/+429
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: There was some confusion in the code about how to represent process environment. Most of the code (ab)used the Args class for this purpose, but some of it used a more basic StringList class instead. In either case, the fact that the underlying abstraction did not provide primitive operations for the typical environment operations meant that even a simple operation like checking for an environment variable value was several lines of code. This patch adds a separate Environment class, which is essentialy a llvm::StringMap<std::string> in disguise. To standard StringMap functionality, it adds a couple of new functions, which are specific to the environment use case: - (most important) envp conversion for passing into execve() and likes. Instead of trying to maintain a constantly up-to-date envp view, it provides a function which creates a envp view on demand, with the expectation that this will be called as the very last thing before handing the value to the system function. - insert(StringRef KeyEqValue) - splits KeyEqValue into (key, value) pair and inserts it into the environment map. - compose(value_type KeyValue) - takes a map entry and converts in back into "KEY=VALUE" representation. With this interface most of the environment-manipulating code becomes one-liners. The only tricky part was maintaining compatibility in SBLaunchInfo, which expects that the environment entries are accessible by index and that the returned const char* is backed by the launch info object (random access into maps is hard and the map stores the entry in a deconstructed form, so we cannot just return a .c_str() value). To solve this, I have the SBLaunchInfo convert the environment into the "envp" form, and use it to answer the environment queries. Extra code is added to make sure the envp version is always in sync. (This also improves the layering situation as Args was in the Interpreter module whereas Environment is in Utility.) Reviewers: zturner, davide, jingham, clayborg Subscribers: emaste, lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D41359 llvm-svn: 322174
* [dotest] Remove crashinfo hookPavel Labath2018-01-105-108/+0
| | | | | | | | | | | | | | | | Summary: This used to be important when all tests were run in a single process, but that has no longer been the case for a while. Furthermore, this hook fails to build on new mac versions for several people, and it's not clear whether fixing it is worth the effort. Reviewers: jingham, clayborg, davide Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D41871 llvm-svn: 322167
* This change updates the deployment target for lldb and debugserverJason Molenda2018-01-092-68/+318
| | | | | | | | | | | | | | | | (built with Xcode) from 10.9 to 10.11. It also enables the use of libcompression in debugserver by default (these API are only present in macOS 10.11 and newer -- 10.11 was released c. Sep 2015). I don't know if we have people / bots building lldb on older mac releases; if this turns out to be a problem I will revert the change. There are some parts of lldb (e.g. debugserer's ability to report the OS version #) that only work with 10.10 and this changes the behavior of lldb (whether the older or newer dyld interfaces are used) so there is some importance to updating the min required version. llvm-svn: 322128
* [test] Fix tests to use more portable LLVM_ENABLE_ZLIBMichal Gorny2018-01-092-1/+5
| | | | | | | | | | | | | The HAVE_LIBZ variable is not exported by LLVM, and therefore is not available in stand-alone builds of other tools. Use LLVM_ENABLE_ZLIB which is the name under which the effective value is exported. Additional, use llvm_canonicalize_cmake_booleans() to make sure that a correct (Python-safe) boolean value is passed down to lit. Differential Revision: https://reviews.llvm.org/D41725 llvm-svn: 322081
* TestConflictingSymbols: simplify test by using run_break_set_by_source_regexpPavel Labath2018-01-091-14/+8
| | | | | | follow-up to r321271 based on post-commit feedback by Jim Ingham. llvm-svn: 322075
* Cut and paste error - I wasn't actually running both tests...Jim Ingham2018-01-091-1/+1
| | | | llvm-svn: 322054
* [test] Use full PATH lookup for toolsMichal Gorny2018-01-061-2/+2
| | | | | | | | | | | | | | | Use full PATH when looking up test tools rather than just llvm tools directory. r320813 has added a lookup for 'lldb-test' which is part of LLDB tools rather than LLVM, and therefore is not present in llvm_tools_dir before LLDB is installed. While technically we could introduce separate per-directory lookup logic, there is no real reason not to use the PATH formed earlier here, and this is what other tools are doing. Differential Revision: https://reviews.llvm.org/D41726 llvm-svn: 321932
* [ArchSpec] Add a unittest to complement the change in r321856.Davide Italiano2018-01-051-0/+19
| | | | | | <rdar://problem/35778442> llvm-svn: 321879
* [ArchSpec] Don't consider Unknown MachO64 as invalid.Davide Italiano2018-01-051-1/+6
| | | | | | | | Even without a proper arch we can access line tables, etc.. <rdar://problem/35778442> llvm-svn: 321856
* [IRExecutionUnit] Remove broken/dead code.Davide Italiano2018-01-041-26/+2
| | | | llvm-svn: 321833
* Look for external types in all clang modules imported by the current symbol ↵Adrian Prantl2018-01-0410-51/+137
| | | | | | | | | | | | | file. This fixes a bug in -gmodules DWARF handling when debugging without a .dSYM bundle that was particularly noticable when debugging LLVM itself. Debugging without clang modules and DWO handling should be unaffected by this patch. <rdar://problem/32436209> llvm-svn: 321802
* [Core/Debugger] Remove some code that doesn't compile anymore.Davide Italiano2018-01-021-69/+0
| | | | llvm-svn: 321654
* [MacOSX-Kernel] Remove broken KDP_IMAGEPATH support.Davide Italiano2018-01-021-37/+0
| | | | llvm-svn: 321652
* [ARM64] Remove unused function. NFCI.Davide Italiano2018-01-021-13/+0
| | | | llvm-svn: 321651
* Remove duplicate declaration from D41550; NFC Aaron Smith2017-12-281-4/+0
| | | | llvm-svn: 321514
* Update failing PDB unit tests that are searching for symbols by regexAaron Smith2017-12-282-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
* 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
OpenPOWER on IntegriCloud