summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
...
* Update the Core file loading instructions so they keep the process stopped ↵Greg Clayton2018-08-161-0/+1
| | | | | | after attaching to a core file. llvm-svn: 339954
* [dotest] Make --test-subdir work with --no-multiprocessVedant Kumar2018-08-163-18/+49
| | | | | | | | | | | | | | | | | | | The single-process test runner is invoked in a number of different scenarios, including when multiple test dirs are specified or (afaict) when lit is used to drive the test suite. Unfortunately the --test-subdir option did not work with the single process test runner, breaking an important use case (using lit to run swift-lldb Linux tests): Failure URL: https://ci.swift.org/job/swift-PR-Linux/6841 We won't be able to run lldb tests within swift PR testing without filtering down the set of tests. This change makes --test-subdir work with the single-process runner. llvm-svn: 339929
* Fix lldb-vscode build on WindowsReid Kleckner2018-08-164-11/+12
| | | | | | | | Include PosixAPI.h to get a PATH_MAX definition and replace CreateEvent with CreateEventObject to avoid conflicts with the windows.h definition of CreateEvent to CreateEventW. llvm-svn: 339920
* Disable two flaky pexpect-backed tests on DarwinVedant Kumar2018-08-162-0/+10
| | | | | | | | These tests are sporadically timing out on our bots, e.g here: https://ci.swift.org/job/swift-PR-Linux/6841 llvm-svn: 339914
* Add a new tool named "lldb-vscode" that implements the Visual Studio Code ↵Greg Clayton2018-08-1648-6/+8761
| | | | | | | | | | | | Debug Adaptor Protocol This patch adds a new lldb-vscode tool that speaks the Microsoft Visual Studio Code debug adaptor protocol. It has full unit tests that test all packets. This tool can be easily packaged up into a native extension and used with Visual Studio Code, and it can also be used by Nuclide Differential Revision: https://reviews.llvm.org/D50365 llvm-svn: 339911
* Update LLDB for LLVM CodeView API change in r339907Reid Kleckner2018-08-161-329/+329
| | | | llvm-svn: 339910
* Fix a little thinko in generating ___lldb_unnamed_symbol symbols Jim Ingham2018-08-154-1/+114
| | | | | | | | | | | when we have only an in-memory copy of the binary. Also added a test for the generation of these symbols in the in-memory and regular cases. <rdar://problem/43160401> llvm-svn: 339833
* Add libc++ data formatters for std::optional.Adrian Prantl2018-08-159-7/+260
| | | | | | | | | | Patch by Shafik Yaghmour! This reapplies an earlier version after addressing some post-commit feedback. Differential Revision: https://reviews.llvm.org/D49271 llvm-svn: 339828
* Revert "[ASTImporter] Add test for IfStmt"Raphael Isemann2018-08-152-68/+0
| | | | | | That's actually a clang patch, sorry. llvm-svn: 339826
* [ASTImporter] Add test for IfStmtRaphael Isemann2018-08-152-0/+68
| | | | | | | | | | | | Reviewers: a.sidorin, hiraditya Reviewed By: hiraditya Subscribers: hiraditya, martong, cfe-commits Differential Revision: https://reviews.llvm.org/D50796 llvm-svn: 339825
* Fix doc string variable name to quiet a compiler warning.Greg Clayton2018-08-151-1/+1
| | | | llvm-svn: 339817
* Remove asseration from ↵Stefan Granitz2018-08-141-5/+0
| | | | | | ConstString::GetConstCStringAndSetMangledCounterPart() to fix more tests first llvm-svn: 339716
* Stability improvements for CompletionTestRaphael Isemann2018-08-141-41/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: CompletionTest.DirCompletionAbsolute had a random failure on a CI node (in the failure, the completion count was 0, while we expected it to be 1), but there seems no good reason for it to fail. The sanitizers don't complain about the test when it's run, so I think we don't have some uninitialized memory that we access here. My best bet is that the unique directory selection randomly failed on the CI node because maybe the FS there doesn't actually guarantee the atomic fopen assumptions we make in the LLVM code (or some other funny race condition). In this case a different test run could get the same directory and clean its contents which would lead to 0 results. The other possible explanation is that someone changed the CI configuration on the node and changed the working dir to something very long, which would make our PATH_MAX test fail (which also leads to 0 results), but I think that case is unlikely. This patch is just a stab in the dark that (hopefully) fixes this random failure by giving each test a (more) unique working directory by appending the unique test name to the temp-dir prefix. Also adds one more ASSERT_NO_ERROR to one of our chdir calls just in case that is the reason for failing. The good thing is that this refactor gets rid of most of the static variables and files that we previously had as shared state between the different tests. Potentially fixes rdar://problem/43150260 Reviewers: aprantl Reviewed By: aprantl Subscribers: jfb, lldb-commits Differential Revision: https://reviews.llvm.org/D50722 llvm-svn: 339715
* Remove manual byte counting from Highlighter code.Raphael Isemann2018-08-145-45/+25
| | | | | | | | | | | | | | | | | | | | Summary: This removes the manual byte counting mechanism from the syntax highlighting code. This is no longer necessary as the Stream class now has built-in support for automatically counting the bytes that were written to it so far. The advantage of automatic byte counting via Stream is that it is less error-prone than the manual version and we need to write less boilerplate code. Reviewers: labath Reviewed By: labath Subscribers: labath, lldb-commits Differential Revision: https://reviews.llvm.org/D50676 llvm-svn: 339695
* Remove unused FastDemangle sourcesStefan Granitz2018-08-145-2427/+1
| | | | llvm-svn: 339671
* Fix: ConstString::GetConstCStringAndSetMangledCounterPart() should update ↵Stefan Granitz2018-08-142-18/+43
| | | | | | | | | | | | | | | | | | | | | | | | | the value if the key exists already Summary: This issue came up because it caused problems in our unit tests. The StringPool did connect counterparts only once and silently ignored the values passed in subsequent calls. The simplest solution for the unit tests would be silent overwrite. In practice, however, it seems useful to assert that we never overwrite a different mangled counterpart. If we ever have mangled counterparts for other languages than C++, this makes it more likely to notice collisions. I added an assertion that allows the following cases: * inserting a new value * overwriting the empty string * overwriting with an identical value I fixed the unit tests, which used "random" strings and thus produced collisions. It would be even better if there was a way to reset or isolate the StringPool, but that's a different story. Reviewers: jingham, friss, labath Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D50536 llvm-svn: 339669
* [PDB] Parse UDT symbols and pointers to members (combined patch)Aleksandr Urakov2018-08-1413-117/+926
| | | | | | | | | | | | | | | | | | | | | | Summary: In this patch I've tried to combine the best ideas from D49368 and D49410, so it implements following: - Completion of UDTs from a PDB with a filling of a layout info; - Pointers to members; - Fixes the bug relating to a virtual base offset reading from `vbtable`. The offset was treated as an unsigned, but it can be a negative sometimes. - Support of MSInheritance attribute Reviewers: asmith, zturner, rnk, labath, clayborg, lldb-commits Reviewed By: zturner Subscribers: aleksandr.urakov, stella.stamenova, JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D49980 llvm-svn: 339649
* Update TestTargetXMLArch.py test for llvm triple change with unspecifiedJason Molenda2018-08-131-1/+1
| | | | | | components in r339294. llvm-svn: 339615
* Added test for Core/Range class.Raphael Isemann2018-08-132-0/+331
| | | | | | | | | | | | | | | | | | | | Summary: We can optimize and refactor some of the classes in RangeMap.h, but first we should have some tests for all the data structures in there. This adds a first batch of tests for the Range class itself. There are some unexpected results happening when mixing invalid and valid ranges, so I added some FIXME's for that in the tests. Reviewers: vsk Reviewed By: vsk Subscribers: mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D50620 llvm-svn: 339611
* Straight forward FastDemangle replacement in SubsPrimitiveParmItaniumStefan Granitz2018-08-132-38/+58
| | | | | | | | | | | | | | | | | | | Summary: Removing FastDemangle will greatly reduce maintenance efforts. This patch replaces the last point of use in LLDB. Semantics should be kept intact. Once this is agreed upon, we can: * Remove the FastDemangle sources * Add more features e.g. substitutions in template parameters, considering all variations, etc. Depends on LLVM patch https://reviews.llvm.org/D50586 Reviewers: erik.pilkington, friss, jingham, JDevlieghere Subscribers: kristof.beyls, chrib, lldb-commits Differential Revision: https://reviews.llvm.org/D50587 llvm-svn: 339583
* Use a DenseMap for looking up functions by UID in CompileUnit::FindFunctionByUIDRaphael Isemann2018-08-113-49/+46
| | | | | | | | | | | | | | | | | | Summary: Instead of iterating over our vector of functions, we might as well use a map here to directly get the function we need. Thanks to Vedant for pointing this out. Reviewers: vsk Reviewed By: vsk Subscribers: mgrang, lldb-commits Differential Revision: https://reviews.llvm.org/D50225 llvm-svn: 339504
* Remove copy-pasted and unrelated comment [NFC]Raphael Isemann2018-08-101-2/+0
| | | | | | | | | That comment was copied from the CombineConsecutiveEntriesWithEqualData() implementation below, and doesn't actually describe what's happening in the current function. llvm-svn: 339473
* [tests, libstdcxx] Add missing test category on the ↵Stella Stamenova2018-08-101-0/+1
| | | | | | | | TestDataFormatterStdUniquePtr tests Each test needs to be marked with the add_test_categories decorator individually. llvm-svn: 339457
* RichManglingContext: Make m_ipd_str_len a local variable and simplify ↵Stefan Granitz2018-08-104-42/+39
| | | | | | processIPDStrResult + polishing in test and Mangled llvm-svn: 339440
* Amend "Remove unused type Either from Utility library".Tatyana Krasnukha2018-08-101-72/+0
| | | | llvm-svn: 339430
* Added missing null checks to fix r339351Raphael Isemann2018-08-091-1/+5
| | | | llvm-svn: 339353
* Also display the output and error output of a failed commandRaphael Isemann2018-08-091-1/+6
| | | | | | | | | | | | | | | | | Summary: Instead of just printing the current "False is not True, ..." message when we fail to run a certain command, this patch also adds the actual command output or error output that we received to the assertion message. Reviewers: davide Reviewed By: davide Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D50492 llvm-svn: 339351
* Darwin: mark test unsupported while we sort out how to make it generic.Tim Northover2018-08-091-1/+1
| | | | | | | | This test relies on communicating with debugserver via an unnamed (pre-opened) pipe, but macOS's version of debugserver doesn't seem to support that mode of operation. So disable the test for now. llvm-svn: 339343
* Remove unused type Either from Utility library.Tatyana Krasnukha2018-08-092-110/+54
| | | | llvm-svn: 339328
* Add ConstString test FromMidOfBufferStringRefStefan Granitz2018-08-081-0/+20
| | | | | | | | | | | | Summary: It was not immediately clear to me whether or not non-null-terminated StringRef's are supported in ConstString and/or the counterpart mechanism. From this test it seems to be fine. Maybe useful to keep? Reviewers: labath Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D50334 llvm-svn: 339292
* Use rich mangling information in Symtab::InitNameIndexes()Stefan Granitz2018-08-0811-147/+730
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: I set up a new review, because not all the code I touched was marked as a change in old one anymore. In preparation for this review, there were two earlier ones: * https://reviews.llvm.org/D49612 introduced the ItaniumPartialDemangler to LLDB demangling without conceptual changes * https://reviews.llvm.org/D49909 added a unit test that covers all relevant code paths in the InitNameIndexes() function Primary goals for this patch are: (1) Use ItaniumPartialDemangler's rich mangling info for building LLDB's name index. (2) Provide a uniform interface. (3) Improve indexing performance. The central implementation in this patch is our new function for explicit demangling: ``` const RichManglingInfo * Mangled::DemangleWithRichManglingInfo(RichManglingContext &, SkipMangledNameFn *) ``` It takes a context object and a filter function and provides read-only access to the rich mangling info on success, or otherwise returns null. The two new classes are: * `RichManglingInfo` offers a uniform interface to query symbol properties like `getFunctionDeclContextName()` or `isCtorOrDtor()` that are forwarded to the respective provider internally (`llvm::ItaniumPartialDemangler` or `lldb_private::CPlusPlusLanguage::MethodName`). * `RichManglingContext` works a bit like `LLVMContext`, it the actual `RichManglingInfo` returned from `DemangleWithRichManglingInfo()` and handles lifetime and configuration. It is likely stack-allocated and can be reused for multiple queries during batch processing. The idea here is that `DemangleWithRichManglingInfo()` acts like a gate keeper. It only provides access to `RichManglingInfo` on success, which in turn avoids the need to handle a `NoInfo` state in every single one of its getters. Having it stored within the context, avoids extra heap allocations and aids (3). As instantiations of the IPD the are considered expensive, the context is the ideal place to store it too. An efficient filtering function `SkipMangledNameFn` is another piece in the performance puzzle and it helps to mimic the original behavior of `InitNameIndexes`. Future potential: * `DemangleWithRichManglingInfo()` is thread-safe, IFF using different contexts in different threads. This may be exploited in the future. (It's another thing that it has in common with `LLVMContext`.) * The old implementation only parsed and indexed Itanium mangled names. The new `RichManglingInfo` can be extended for various mangling schemes and languages. One problem with the implementation of RichManglingInfo is the inaccessibility of class `CPlusPlusLanguage::MethodName` (defined in source/Plugins/Language/..), from within any header in the Core components of LLDB. The rather hacky solution is to store a type erased reference and cast it to the correct type on access in the cpp - see `RichManglingInfo::get<ParserT>()`. At the moment there seems to be no better way to do it. IMHO `CPlusPlusLanguage::MethodName` should be a top-level class in order to enable forward delcarations (but that is a rather big change I guess). First simple profiling shows a good speedup. `target create clang` now takes 0.64s on average. Before the change I observed runtimes between 0.76s an 1.01s. This is still no bulletproof data (I only ran it on one machine!), but it's a promising indicator I think. Reviewers: labath, jingham, JDevlieghere, erik.pilkington Subscribers: zturner, clayborg, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D50071 llvm-svn: 339291
* [IRMemoryMap] Shrink Allocation and make it move-only (NFC)Vedant Kumar2018-08-082-19/+20
| | | | | | | | | | | | | | | | | Profiling data show that Allocation::operator= is hot (see the data attached to the Phab review). Reorder a few fields within Allocation to avoid implicit structure padding and shrink the structure. This should make copies a bit cheaper. Also, given that an Allocation contains a std::vector (by way of DataBufferHeap), it's preferable to make it move-only instead of permitting expensive copies. As an added benefit this allows us to have a single Allocation constructor instead of two. Differential Revision: https://reviews.llvm.org/D50271 llvm-svn: 339290
* Delete a dead Function constructor (NFC)Vedant Kumar2018-08-072-45/+0
| | | | llvm-svn: 339206
* [StackFrame] Add more clarifying comments to StackFrameList (NFC)Vedant Kumar2018-08-071-3/+3
| | | | llvm-svn: 339205
* Removed doxygen comment that doesn't fit to function signatureRaphael Isemann2018-08-071-6/+0
| | | | llvm-svn: 339204
* Removed duplicated commented-out code [NFC]Raphael Isemann2018-08-071-2/+0
| | | | llvm-svn: 339202
* Add documentation for SBTarget::AppendImageSearchPathAlexander Polyakov2018-08-072-0/+4
| | | | llvm-svn: 339189
* If a function starts with line number 0, don't try to check if a breakpoint ↵Jim Ingham2018-08-073-2/+12
| | | | | | | | | | crossed function boundaries. clang doesn't use line number 0 (to mean artifically generated code) very often, but swift does it quite often. We were rejecting all by line breakpoints in functions that started at line 0. But that's a special marker so we can just not do this test in that case. llvm-svn: 339182
* Fix the Xcode project for the Core -> Utility moves.Jim Ingham2018-08-071-22/+20
| | | | | | Scalar.{h,cpp}, RegisterValue.{h,cpp}, State.{h,cpp} were moved. llvm-svn: 339181
* [lit, python] Change the order of the quotes in the lit cfg fileStella Stamenova2018-08-071-1/+1
| | | | | | Double quotes are always correct in paths on windows while single quotes only work sometimes. By swapping the order of the quotes in the subsitution we guarantee that the quotes will be correct on Windows. Both sets work correctly on Linux in the test environment. llvm-svn: 339180
* [lldb-mi] Re-implement target-select commandAlexander Polyakov2018-08-076-43/+95
| | | | | | | | | | Now target-select uses SB API instead of HandleCommand. This patch has been reviewed along with the r339175. Differential Revision: https://reviews.llvm.org/D49739 llvm-svn: 339178
* Add new API to SBTarget classAlexander Polyakov2018-08-073-0/+28
| | | | | | | | | | | | | | | | Summary: The new API appends an image search path to the target's path mapping list. Reviewers: aprantl, clayborg, labath Reviewed By: aprantl Subscribers: ki.stfu, lldb-commits Differential Revision: https://reviews.llvm.org/D49739 llvm-svn: 339175
* Misc module/dwarf logging improvementsLeonard Mosescu2018-08-075-19/+33
| | | | | | | | | | | | | | This change improves the logging for the lldb.module category to note a few interesting cases: 1. Local object file found, but specs not matching 2. Local object file not found, using a placeholder module The handling and logging for the cases wehre we fail to load compressed dwarf symbols is also improved. Differential Revision: https://reviews.llvm.org/D50274 llvm-svn: 339161
* [lldb-mi] Re-implement MI HandleProcessEventStateSuspended.Alexander Polyakov2018-08-071-9/+11
| | | | | | | | | | | | | | Summary: Now this function uses SB API instead of HandleCommand. Reviewers: aprantl, clayborg, labath Reviewed By: aprantl Subscribers: ki.stfu, lldb-commits Differential Revision: https://reviews.llvm.org/D49632 llvm-svn: 339160
* Add instructions for building LLDB on Mac OS X with CMakeAlex Langford2018-08-071-2/+23
| | | | | | | | | | | | | | | | | Summary: There were previously no instructions for building LLDB on Mac OS X with CMake. It's sufficiently close to building on Linux/FreeBSD/NetBSD that a well-motivated developer could figure out the steps themselves. However, having an explicit guide is better and can provide Mac OS X specific configurations (e.g. LLDB_BUILD_FRAMEWORK). Reviewers: labath, clayborg Subscribers: emaste, krytarowski Differential Revision: https://reviews.llvm.org/D50362 llvm-svn: 339155
* Check result after setting PC value.Tatyana Krasnukha2018-08-071-3/+8
| | | | llvm-svn: 339153
* Move ScalarTest to follow the class being testedPavel Labath2018-08-073-2/+2
| | | | | | This should have been a part of r339127, but I missed it somehow. llvm-svn: 339136
* Fix a couple of extended-offsetof warnings that had slipped throughPavel Labath2018-08-071-3/+3
| | | | llvm-svn: 339130
* Move RegisterValue,Scalar,State from Core to UtilityPavel Labath2018-08-07175-253/+262
| | | | | | | | | | | | | These three classes have no external dependencies, but they are used from various low-level APIs. Moving them down to Utility improves overall code layering (although it still does not break any particular dependency completely). The XCode project will need to be updated after this change. Differential Revision: https://reviews.llvm.org/D49740 llvm-svn: 339127
* [lit, python] Always add quotes around the python path in litStella Stamenova2018-08-061-1/+1
| | | | | | | | | | | | | Summary: The issue with the python path is that the path to python on Windows can contain spaces. To make the tests always work, the path to python needs to be surrounded by quotes. This is a companion change to: https://reviews.llvm.org/D50206 Reviewers: asmith, zturner Differential Revision: https://reviews.llvm.org/D50280 llvm-svn: 339076
OpenPOWER on IntegriCloud