summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove Platform references from the Host modulePavel Labath2018-01-195-57/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: These were used by Host::LaunchProcess to "resolve" the executable it was about to launch. The only parts of Platform::ResolveExecutable, which seem to be relevant here are the FileSpec::ResolvePath and ResolveExecutableLocation calls. The rest (most) of that function deals with selecting an architecture out of a fat binary and making sure we are able to create a Module with that slice. These are reasonable actions when selecting a binary to debug, but not for a generic process launching framework (it's technically even wrong because we should be able to launch a binary with execute permissions only, but trying to parse such file will obviously fail). I remove the platform call by inlining the relevant FileSpec calls and ignoring the rest of the Platform::ResolveExecutable code. The architecture found by the slice-searching code is being ignored already anyway, as we use the one specified in the LaunchInfo, so the only effect of this should be a different error message in case the executable does not contain the requested architecture -- before we would get an error message from the Platform class, but now we will get an error from the actual posix_spawn syscall (this is only relevant on mac, as it's the only target supporting fat binaries). Launching targets for debugging should not be affected as here the executable is pre-resolved at the point when the Target is created. Reviewers: jingham, clayborg Subscribers: lldb-commits, emaste Differential Revision: https://reviews.llvm.org/D41902 llvm-svn: 322935
* Fix logging test on windowsPavel Labath2018-01-181-2/+2
| | | | | | | | | | | | | Refactor in r322653 broke the logging test on windows because MSVC uses a fully qualified name as the value of __FUNCTION__, which is not what we were expecting. I'm changing the code to use the more portable __func__, which behaves the same as on clang/gcc. The standard still says that the value of __func__ is implementation defined, so if we run into problems with this test again we may just need to drop it. llvm-svn: 322834
* [CMake] Make check-lldb work with LLDB_CODESIGN_IDENTITY=''Vedant Kumar2018-01-182-5/+23
| | | | | | | | | | | | On Darwin, if a test machine isn't set up for code-signing (see docs/code-signing.txt), running check-lldb should use the system debugserver instead of the unsigned one built in-tree. This makes it possible to run lldb's test suite without having code-signing set up, which is really convenient. Differential Revision: https://reviews.llvm.org/D42215 llvm-svn: 322803
* A third attempt to mark TestRdar12408181.py as skippedVedant Kumar2018-01-171-1/+3
| | | | | | | | | | | | | Due to an unfortunate difference between the open source test harness and our internal harness, applying two @skip... decorators to this test works in the internal build but not in the open source build. I've tried another approach to skipping this test and tested it out with the open source harness. Hopefully this sticks! rdar://36417163 llvm-svn: 322756
* Try again to mark TestRdar12408181.py as skippedVedant Kumar2018-01-171-3/+7
| | | | | | rdar://36417163 llvm-svn: 322740
* Skip a flaky test (TestRdar12408181.py)Vedant Kumar2018-01-171-1/+3
| | | | | | | | | | This test frequently times out on our bots. While we're investigating the issue, mark the test as skipped so the builds aren't impacted as much. rdar://36417163 llvm-svn: 322728
* [lldb][PPC64] Fixed long double variables dumpPavel Labath2018-01-171-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: LLDB's DumpDataExtractor was not prepared to handle PowerPC's long double type: PPCDoubleDouble. As it is somewhat special, treating it as other regular float types resulted in getting wrong information about it. In this particular case, llvm::APFloat::getSizeInBits(PPCDoubleDouble) was returning 0. This caused the TestSetValues.py test to fail, because lldb would abort on an assertion failure on APInt(), because of the invalid size. Since in the PPC case the value of item_byte_size was correct and the getSizeInBits call was only added to support x87DoubleExtended semantics, this restricts the usage of getSizeInBits to the x87 semantics. Reviewers: labath, clayborg Reviewed By: labath Subscribers: llvm-commits, anajuliapc, alexandreyy, lbianc, lldb-commits Differential Revision: https://reviews.llvm.org/D42083 Author: Leandro Lupori <leandro.lupori@gmail.com> llvm-svn: 322666
* Fix assertion in ObjectFileELFPavel Labath2018-01-171-0/+2
| | | | | | | | | | In D40616 I (mistakenly) assumed that logging an llvm::Error would clear it. This of course is only true if logging is actually enabled. This fixes the assertion by manually clearing the error, but it raises the point of whether we need a special error-clearing logging primitive. llvm-svn: 322664
* Simplify some LogTest testsPavel Labath2018-01-171-78/+90
| | | | | | | | | | | This removes boilerplate for setting up a log channel and capturing the output from some of the tests. I do this by moving the setup code into a test fixture and adding a logAndTakeOutput utility function to log some string and then retrieve it from the log. I also use some googlemock goodies to simplify a couple of assertions. llvm-svn: 322653
* Remove the hardcoded macos deployment targets altogetherJason Molenda2018-01-172-25/+0
| | | | | | | from the xcode project files. We'll build for the current OS only, by default. llvm-svn: 322603
* One more attempt to fix NetBSD buildPavel Labath2018-01-151-1/+1
| | | | llvm-svn: 322477
* Fix NetBSD build for llvm r322475Pavel Labath2018-01-151-3/+3
| | | | llvm-svn: 322476
* Fix HostInfoBase::ComputeSharedLibraryDirectory commentPavel Labath2018-01-151-4/+2
| | | | | | | | The comment seems to indicate that this function would return the "bin" directory on linux. I've verified that this is not the case, so I'm updating the comment to match. llvm-svn: 322472
* [lldb] Add support to cache a PDB's global scope and fix a bug in getting ↵Aaron Smith2018-01-136-72/+227
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the source file name for a compiland Summary: This commit is a combination of the following changes: - Cache PDB's global scope (executable) in SymbolFilePDB - Change naming of `cu` to `compiland` which is PDB specific - Change ParseCompileUnitForSymIndex to ParseCompileUnitForUID. Prefer using a common name `UID` instead of PDB's `System Index` Adding one more argument `index` to this method, which is used to specify the index of the compile unit in a cached compile unit array - Add GetPDBCompilandByUID method to simply code - Fix a bug in getting the source file name for a PDB compiland. For some reason, PDBSymbolCompiland::getSourceFileName() could return an empty name, so if that is true, we have to walk through all source files of this compiland and determine the right source file used to generate this compiland based on language indicated. The previous implementation called PDBSession::findOneSourceFile method to get its name for the compiland. This is not accurate since the `one source file` found could be a header other than source file. Reviewers: zturner, lldb-commits Reviewed By: zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D41428 llvm-svn: 322433
* We have two sources for path remapping information that we get outJason Molenda2018-01-122-37/+47
| | | | | | | | | | | | | | | | | of a dSYM per-uuid plist that may be present (dsymutil does not create this plist, it is only added after the fact by additional tools) -- either the DBGBuildSourcePath + DBGSourcePath pair of k-v entries which give us the build-time and debug-time remapping, or the newer DBGSourcePathRemapping dictionary which may give us multiple remappings. I'm changing the order that we process these & add them to the list of source remappings. If the DBGSourcePathRemapping dict is present, it should be the first entries we will try. <rdar://problem/36481989> llvm-svn: 322418
* Fix Breakpoint::RemoveInvalidLocations to fix the exec testcase.Jim Ingham2018-01-124-11/+40
| | | | | | | | | | | | | | | | | RemoveInvalidLocations was clearing out the m_locations in the breakpoint by hand, and it wasn't also clearing the locations from the address->location map, which confused us when we went to update breakpoint locations. I also made Breakpoint::ModulesChanged check the Location's Section to make sure it hadn't been deleted. This shouldn't strictly be necessary, but if the DynamicLoaderPlugin doesn't do it's job right (I'm looking at you new Darwin DynamicLoader...) then it can end up leaving stale locations on rerun. It doesn't hurt to clean them up here as a backstop. <rdar://problem/36134350> llvm-svn: 322348
* Fix the Makefile - this version should work on the botJim Ingham2018-01-121-4/+3
| | | | llvm-svn: 322341
* Skip TestFunctionTemplateParameterPack.py, which unexpectedly asserts (PR35920)Vedant Kumar2018-01-121-1/+7
| | | | | | | | | | This test stresses expression evaluation support for template functions. Currently the support is rudimentary, and running this test causes assertion failures in clang. This test cannot be XFAIL'ed because the test harness treats assertion failures as unexpected events. For now, the test must be skipped. llvm-svn: 322340
* When parsing the target.xml register file, if no architecture hasJason Molenda2018-01-122-0/+20
| | | | | | | | | | | | | | | | | been specified yet (either by the user, or by one of the lldb extensions like qHostInfo or qProcessInfo), and the target.xml includes a <architecture> tag specifying x86_64, set the architecture appropriately. I'm not sure what we can expect to see in the <architecture> tag, so I'm only doing this for x86_64 right now where I've seen "i386:x86_64" used. I've seen a target.xml from a jtag board that sends just "arm" because it doesn't know more specifically what type of board it is connected to... <rdar://problem/29908970> llvm-svn: 322339
* Print the SBDebugger.CreateTarget error message.Jim Ingham2018-01-121-1/+3
| | | | | | | This is failing on the bot but not locally. Maybe the error message will tell us why. llvm-svn: 322338
* Fix the same thinko in another place...Jim Ingham2018-01-111-1/+1
| | | | | | Thanks Jason. llvm-svn: 322329
* Fix a tiny thinko in this test and re-add.Jim Ingham2018-01-114-0/+120
| | | | | | target.IsValid() not target... llvm-svn: 322328
* [testsuite] Remove a broken test which tried to find App in bundles.Davide Italiano2018-01-115-119/+0
| | | | | | | That never really worked, and the change associated isn't yet committed, so, let's try to make the bots green for now. llvm-svn: 322322
* 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
OpenPOWER on IntegriCloud