summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/LanguageRuntime
Commit message (Collapse)AuthorAgeFilesLines
...
* NFC: Move Searcher::Depth into lldb-enumerations as SearchDepth.Jim Ingham2018-09-071-3/+3
| | | | | | | | In a subsequent commit, I will need to expose the search depth to the SB API's, so I'm moving this define into lldb-enumerations where it will get added to the lldb module. llvm-svn: 341690
* Don't cancel the current IOHandler when we push a handler for an utility ↵Raphael Isemann2018-08-292-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function run. Summary: D48465 is currently blocked by the fact that tab-completing the first expression is deadlocking LLDB. The reason for this deadlock is that when we push the ProcessIO handler for reading the Objective-C runtime information from the executable (which is triggered when we parse the an expression for the first time), the IOHandler can't be pushed as the Editline::Cancel method is deadlocking. The deadlock in Editline is coming from the m_output_mutex, which is locked before we go into tab completion. Even without this lock, calling Cancel on Editline will mean that Editline cleans up behind itself and deletes the current user-input, which is screws up the console when we are tab-completing at the same time. I think for now the most reasonable way of fixing this is to just not call Cancel on the current IOHandler when we push the IOHandler for running an internal utility function. As we can't really write unit tests for IOHandler itself (due to the hard dependency on an initialized Debugger including all its global state) and Editline completion is currently also not really testable in an automatic fashion, the test for this has to be that the expression command completion in D48465 doesn't fail when requesting completion the first time. A more precise test plan for this is: 1. Apply D48465. 2. Start lldb and break in some function. 3. Type `expr foo` and press tab to request completion. 4. Without this patch, we deadlock and LLDB stops responding. I'll provide an actual unit test for this once I got around and made the IOHandler code testable, but for now unblocking D48465 is more critical. Thanks to Jim for helping me debugging this. Reviewers: jingham Reviewed By: jingham Subscribers: emaste, clayborg, abidh, lldb-commits Differential Revision: https://reviews.llvm.org/D50912 llvm-svn: 340988
* Move RegisterValue,Scalar,State from Core to UtilityPavel Labath2018-08-076-6/+6
| | | | | | | | | | | | | 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
* [ObjCRuntime] Add support for obfuscation in tagged pointers.Davide Italiano2018-07-094-7/+54
| | | | | | | | | | | | | This is the default in MacOS Mojave. No testcases, as basically we have a lot of coverage (and the testsuite fails quite a bit without this change in Beta 3). Thanks to Fred Riss for helping me with this patch (fixing bugs/nondeterminism). <rdar://problem/38305553> llvm-svn: 336607
* Use llvm::VersionTuple instead of manual version marshallingPavel Labath2018-06-181-4/+2
| | | | | | | | | | | | | | | | | | Summary: This has multiple advantages: - we need only one function argument/instance variable instead of three - no need to default initialize variables - no custom parsing code - VersionTuple has comparison operators, which makes version comparisons much simpler Reviewers: zturner, friss, clayborg, jingham Subscribers: emaste, lldb-commits Differential Revision: https://reviews.llvm.org/D47889 llvm-svn: 334950
* [FileSpec] Make style argument mandatory for SetFile. NFCJonas Devlieghere2018-06-131-1/+1
| | | | | | | | | | | | | | | | SetFile has an optional style argument which defaulted to the native style. This patch makes that argument mandatory so clients of the FileSpec class are forced to think about the correct syntax. At the same time this introduces a (protected) convenience method to update the file from within the FileSpec class that keeps the current style. These two changes together prevent a potential pitfall where the style might be forgotten, leading to the path being updated and the style unintentionally being changed to the host style. llvm-svn: 334663
* Fix/unify the spelling of Objective-C.Adrian Prantl2018-06-132-3/+3
| | | | llvm-svn: 334614
* Remove append parameter to FindGlobalVariablesPavel Labath2018-05-311-2/+2
| | | | | | | | | | | | | | | | | | | Summary: As discussed in https://bugs.llvm.org/show_bug.cgi?id=37317, FindGlobalVariables does not properly handle the case where append=false. As this doesn't seem to be used in the tree, this patch removes the parameter entirely. Reviewers: clayborg, jingham, labath Reviewed By: clayborg Subscribers: aprantl, lldb-commits, kubamracek, JDevlieghere Differential Revision: https://reviews.llvm.org/D46885 Patch by Tom Tromey <ttromey@mozilla.com>. llvm-svn: 333639
* Typo fixes.Bruce Mitchener2018-05-292-3/+3
| | | | | | | | | | Reviewers: javed.absar Subscribers: ki.stfu, JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D47421 llvm-svn: 333399
* Fix _NSCFBoolean data formatter.Jonas Devlieghere2018-05-181-3/+3
| | | | | | | | | | | | | In r265181 the test for the NSCFBoolean data formatter was removed. Later, in r279353 and r279446 a new implementation was provided for the formatter, which I believe never worked (and this wasn't caught because the test was never re-enabled). This commit fixes the bug and re-enables the old test case. Differential revision: https://reviews.llvm.org/D47014 llvm-svn: 332700
* [LanguageRuntime/ObjC] Turn off ISA logging once and for all.Davide Italiano2018-05-121-4/+6
| | | | | | On behalf of Jim, who's out today. llvm-svn: 332163
* Reflow paragraphs in comments.Adrian Prantl2018-04-3011-606/+544
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is intended as a clean up after the big clang-format commit (r280751), which unfortunately resulted in many of the comment paragraphs in LLDB being very hard to read. FYI, the script I used was: import textwrap import commands import os import sys import re tmp = "%s.tmp"%sys.argv[1] out = open(tmp, "w+") with open(sys.argv[1], "r") as f: header = "" text = "" comment = re.compile(r'^( *//) ([^ ].*)$') special = re.compile(r'^((([A-Z]+[: ])|([0-9]+ )).*)|(.*;)$') for line in f: match = comment.match(line) if match and not special.match(match.group(2)): # skip intentionally short comments. if not text and len(match.group(2)) < 40: out.write(line) continue if text: text += " " + match.group(2) else: header = match.group(1) text = match.group(2) continue if text: filled = textwrap.wrap(text, width=(78-len(header)), break_long_words=False) for l in filled: out.write(header+" "+l+'\n') text = "" out.write(line) os.rename(tmp, sys.argv[1]) Differential Revision: https://reviews.llvm.org/D46144 llvm-svn: 331197
* Move Args.cpp from Interpreter to UtilityPavel Labath2018-04-172-2/+2
| | | | | | | | | | | | | | | | | | | | | Summary: The Args class is used in plenty of places besides the command interpreter (e.g., anything requiring an argc+argv combo, such as when launching a process), so it needs to be in a lower layer. Now that the class has no external dependencies, it can be moved down to the Utility module. This removes the last (direct) dependency from the Host module to Interpreter, so I remove the Interpreter module from Host's dependency list. Reviewers: zturner, jingham, davide Subscribers: mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D45480 llvm-svn: 330200
* Move Args::StringTo*** functions to a new OptionArgParser classPavel Labath2018-04-101-1/+2
| | | | | | | | | | | | | | | | Summary: The idea behind this is to move the functionality which depend on other lldb classes into a separate class. This way, the Args class can be turned into a lightweight arc+argv wrapper and moved into the lower lldb layers. Reviewers: jingham, zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D44306 llvm-svn: 329677
* Fix check for verbose logging.Adrian Prantl2018-03-261-3/+2
| | | | | | Thanks to Pavel for pointing this out! llvm-svn: 328557
* Log ObjC Runtime messages only in verbose modeAdrian Prantl2018-03-231-2/+2
| | | | llvm-svn: 328365
* We were getting the wrong dynamic type if there were two classes with the ↵Jim Ingham2018-03-011-2/+7
| | | | | | | | | | | | | | same basename. There's a bug in FindTypes, it ignores the exact flag if you pass a name that doesn't begin with :: and pass eTypeClassAny for the type. In this case we always know that the name we get from the vtable name is absolute so we can work around the bug by prepending the "::". This doesn't fix the FindTypes bug. <rdar://problem/38010986> llvm-svn: 326412
* Fix some warnings found by ToT clangPavel Labath2017-11-021-2/+0
| | | | | | | | These fall into two categories: - unused variables - (uint8_t *)NULL + X -- changed to reinterpret_cast(X) llvm-svn: 317270
* Remove a stray space.Jim Ingham2017-10-301-1/+1
| | | | llvm-svn: 316954
* [Expression parser] Setting to enable use of ExternalASTMergerSean Callanan2017-09-282-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This setting can be enabled like this at the target level: (lldb) settings set target.experimental.use-modern-type-lookup true This causes several new behaviors in the Clang expression parser: - It completely disables use of ClangASTImporter. None are created at all, and all users of it are now conditionalized on its presence. - It instead constructs a per-expression ExternalASTMerger, which exists inside Clang and contains much of the type completion logic that hitherto lived in ExternalASTSource, ClangExpressionDeclMap, and ClangASTImporter. - The expression parser uses this Merger as a backend for copying and completing types. - It also constructs a persistent ExternalASTMerger which is connected to the Target's persistent AST context. This is a major chunk of LLDB functionality moved into Clang. It can be tested in two ways: 1. For an individual debug session, enable the setting before running a target. 2. For the testsuite, change the option to be default-true. This is done in Target.cpp's g_experimental_properties. The testsuite is not yet clean with this, so I have not committed that switch. I have filed a Bugzilla for extending the testsuite to allow custom settings for all tests: https://bugs.llvm.org/show_bug.cgi?id=34771 I have also filed a Bugzilla for fixing the remaining testsuite failures with this setting enabled: https://bugs.llvm.org/show_bug.cgi?id=34772 llvm-svn: 314458
* Update the Objective-C runtime interface code to handle objc objectsJason Molenda2017-09-274-12/+180
| | | | | | | | whose isa is an index instead of a pointer. Currently, this type of isa encoding is only used on watchos. <rdar://problem/34675497> llvm-svn: 314343
* [Expression Parser] Inhibit global lookups for symbols in the IR dynamic checksSean Callanan2017-09-261-78/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The IR dynamic checks are self-contained functions whose job is to - verify that pointers referenced in an expression are valid at runtime; and - verify that selectors sent to Objective-C objects by an expression are actually supported by that object. These dynamic checks forward-declare all the functions they use and should not require any external debug information. The way they ensure this is by marking all the names they use with a dollar sign ($). The expression parser recognizes such symbols and perform no lookups for them. This patch fixes three issues surrounding the use of the dollar sign: - to fix a MIPS issue, the name of the pointer checker was changed from starting with $ to starting with _$, but this was not properly ignored; and - the Objective-C object checker used a temporary variable that did not start with $. - the Objective-C object checker used an externally-defined struct (struct objc_selector) but didn't need to. The patch also implements some cleanup in the area: - it reformats the string containing the Objective-C object checker, which was mangled horribly when the code was transformed to a uniform width of 80 columns, and - it factors out the logic for ignoring global $-symbols into common code shared between ClangASTSource and ClangExpressionDeclMap. Differential Revision: https://reviews.llvm.org/D38153 llvm-svn: 314225
* Make breakpoint names real entities.Jim Ingham2017-09-141-10/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When introduced, breakpoint names were just tags that you could apply to breakpoints that would allow you to refer to a breakpoint when you couldn't capture the ID, or to refer to a collection of breakpoints. This change makes the names independent holders of breakpoint options that you can then apply to breakpoints when you add the name to the breakpoint. It adds the "breakpoint name configure" command to set up or reconfigure breakpoint names. There is also full support for then in the SB API, including a new SBBreakpointName class. The connection between the name and the breakpoints sharing the name remains live, so if you reconfigure the name, all the breakpoint options all change as well. This allows a quick way to share complex breakpoint behavior among a bunch of breakpoints, and a convenient way to iterate on the set. You can also create a name from a breakpoint, allowing a quick way to copy options from one breakpoint to another. I also added the ability to make hidden and delete/disable protected names. When applied to a breakpoint, you will only be able to list, delete or disable that breakpoint if you refer to it explicitly by ID. This feature will allow GUI's that need to use breakpoints for their own purposes to keep their breakpoints from getting accidentally disabled or deleted. <rdar://problem/22094452> llvm-svn: 313292
* Move Timer and TraceOptions from Core to UtilityPavel Labath2017-06-291-1/+1
| | | | | | | | | | | | | | Summary: The classes have no dependencies, and they are used both by lldb and lldb-server, so it makes sense for them to live in the lowest layers. Reviewers: zturner, jingham Subscribers: emaste, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D34746 llvm-svn: 306682
* Fix assorted compiler warnings. NFCPavel Labath2017-06-061-0/+1
| | | | llvm-svn: 304796
* Fix bad change in RenderScriptx86ABIFixups.cpp, forgot to change everything ↵Stephane Sezer2017-05-231-2/+2
| | | | | | | | | | | | | | necessary Summary: I didn't change all instances of i to I in this loop. I am a bad person and should feel bad. :( Reviewers: sas Differential Revision: https://reviews.llvm.org/D33456 Change by Alex Langford <apl@fb.com> llvm-svn: 303677
* hange RenderScriptx86ABIFixups.cpp to use llvm::AttributeList iteratorStephane Sezer2017-05-231-1/+2
| | | | | | | | | | LLVM::AttributeList recently had getNumSlots() removed, which broke the build. This fixes the build using functions introduced in the update to LLVM::AttributeList. Change by Alex Langford <apl@fb.com> llvm-svn: 303674
* Remove an expensive lock from TimerPavel Labath2017-05-151-1/+2
| | | | | | | | | | | | | The Timer destructor would grab a global mutex in order to update execution time. Add a class to define a category once, statically; the class adds itself to an atomic singly linked list, and thus subsequent updates only need to use an atomic rather than grab a lock and perform a hashtable lookup. Differential Revision: https://reviews.llvm.org/D32823 Patch by Scott Smith <scott.smith@purestorage.com>. llvm-svn: 303058
* Rename Error -> Status.Zachary Turner2017-05-1210-88/+88
| | | | | | | | | | | | | | | This renames the LLDB error class to Status, as discussed on the lldb-dev mailing list. A change of this magnitude cannot easily be done without find and replace, but that has potential to catch unwanted occurrences of common strings such as "Error". Every effort was made to find all the obvious things such as the word "Error" appearing in a string, etc, but it's possible there are still some lingering occurences left around. Hopefully nothing too serious. llvm-svn: 302872
* Fixed a crash when dealing with an empty method name in the ObjC runtime.Sean Callanan2017-04-261-1/+6
| | | | | | | | I've filed a bug covering better unit testing of our runtime metadata reader, which will allow this to be testable.. <rdar://problem/31793264> llvm-svn: 301461
* Teach RenderScriptRuntime about changed context representation.David Gross2017-04-191-30/+39
| | | | | | | | | | | | | | | | Summary: The runtime discovers contexts through RenderScriptRuntime::Capture*() methods. These methods see the low-level context representation. However, the runtime calls APIs that require the high-level context representation. Therefore, it needs to call yet another API to find the high-level representation associated with a given low-level representation. Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D32184 llvm-svn: 300727
* Update for alloca construction changesMatt Arsenault2017-04-101-2/+5
| | | | llvm-svn: 299898
* iwyu fixes for lldbCore.Zachary Turner2017-04-061-0/+1
| | | | | | | | | | | | | | This adjusts header file includes for headers and source files in Core. In doing so, one dependency cycle is eliminated because all the includes from Core to that project were dead includes anyway. In places where some files in other projects were only compiling due to a transitive include from another header, fixups have been made so that those files also include the header they need. Tested on Windows and Linux, and plan to address failures on OSX and FreeBSD after watching the bots. llvm-svn: 299714
* Tone down the "lldb types" log a bit.Jim Ingham2017-04-041-4/+13
| | | | | | | | | | Change the get shared class info function to only dump its results to the inferior stdout when the log is verbose. This matches the lldb side of the same process, which only logs what it found if the log is on verbose. llvm-svn: 299451
* The expression text in AppleObjCRuntimeV1::CreateObjectCheckerJason Molenda2017-03-241-2/+3
| | | | | | | | | | | was formatted into a string inside an assert() expression. Which is elided when lldb is built with asserts disabled; the result is that all expressions will fail when debugging programs using the objective-c v1 runtime. <rdar://problem/30353271> llvm-svn: 298694
* Delete some more dead includes.Zachary Turner2017-03-223-2/+2
| | | | | | | This breaks the cycle between Target and PluginLanguageC++, reducing the overall cycle count from 43 to 42. llvm-svn: 298561
* Move FileSpec from Host -> Utility.Zachary Turner2017-03-221-1/+1
| | | | llvm-svn: 298536
* Remove stray paren that got in while attempting to fix the build for ↵Reid Kleckner2017-03-211-1/+1
| | | | | | AttributeList llvm-svn: 298402
* Update for LLVM API rename of AttributeSet -> AttributeListReid Kleckner2017-03-211-5/+2
| | | | llvm-svn: 298399
* Update for LLVM API removal of Function::getArgumentList()Reid Kleckner2017-03-161-2/+1
| | | | llvm-svn: 298011
* Remove FileSpec::ReadFileContents.Zachary Turner2017-03-061-2/+3
| | | | | | | | | | | | | | | | This functionality is subsumed by DataBufferLLVM, which is also more efficient since it will try to mmap. However, we don't yet support mmaping writable private sections, and in some cases we were using ReadFileContents and then modifying the buffer. To address that I've added a flag to the DataBufferLLVM methods that allow you to map privately, which disables the mmaping path entirely. Eventually we should teach DataBufferLLVM to use mmap with writable private, but that is orthogonal to this effort. Differential Revision: https://reviews.llvm.org/D30622 llvm-svn: 297095
* Isolate Target-specific functionality of DataExtractor.Zachary Turner2017-03-031-2/+4
| | | | | | | | | | | | | | | | In an effort to move the various DataBuffer / DataExtractor classes from Core -> Utility, we have to separate the low-level functionality from the higher level functionality. Only a few functions required anything other than reading/writing raw bytes, so those functions are separated out into a more appropriate area. Specifically, Dump() and DumpHexBytes() are moved into free functions in Core/DumpDataExtractor.cpp, and GetGNUEHPointer is moved into a static function in the only file that it's referenced from. Differential Revision: https://reviews.llvm.org/D30560 llvm-svn: 296910
* Move Log from Core -> Utility.Zachary Turner2017-03-0313-13/+13
| | | | | | | | | All references to Host and Core have been removed, so this class can now safely be lowered into Utility. Differential Revision: https://reviews.llvm.org/D30559 llvm-svn: 296909
* Fix various warnings. NFCZachary Turner2017-03-021-4/+2
| | | | llvm-svn: 296717
* Clean up debug loggingPavel Labath2017-02-131-3/+2
| | | | | | | | | | | | | | | | | | | | | Summary: We've had two ways to print a "debug" log message. - Log::GetDebug() was testing a Stream flag which was never set. - Log::Debug() was checking for the presence of "log enable --debug" flag. Given that these two were used very rarely and we already have a different way to specify "I want a more verbose log", I propose to remove these two functions and migrate the callers to LLDB_LOGV. This commit does that. Reviewers: clayborg, zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D29823 llvm-svn: 294939
* Remove LIBLLDB_LOG_VERBOSE categoryPavel Labath2017-02-051-24/+13
| | | | | | | | | | | | | | | | | | | | | Summary: Per discussion in D28616, having two ways two request logging (log enable lldb XXX verbose && log enable -v lldb XXX) is confusing. This removes the first option and standardizes all code to use the second one. I've added a LLDB_LOGV macro as a shorthand for if(log && log->GetVerbose()) and switched most of the affected log statements to use that (I've only left a couple of cases that were doing complex computations in an if(log) block). Reviewers: jingham, zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D29510 llvm-svn: 294113
* Move classes from Core -> Utility.Zachary Turner2017-02-028-20/+20
| | | | | | | | | | | | | | | | | | | | | | | This moves the following classes from Core -> Utility. ConstString Error RegularExpression Stream StreamString The goal here is to get lldbUtility into a state where it has no dependendencies except on itself and LLVM, so it can be the starting point at which to start untangling LLDB's dependencies. These are all low level and very widely used classes, and previously lldbUtility had dependencies up to lldbCore in order to use these classes. So moving then down to lldbUtility makes sense from both the short term and long term perspective in solving this problem. Differential Revision: https://reviews.llvm.org/D29427 llvm-svn: 293941
* [CMake] [2/4] Update a batch of pluginsChris Bieneman2017-01-315-5/+57
| | | | | | This is extending the updates from r293696 to more LLDB plugins. llvm-svn: 293699
* Fix more unused variable warnings when asserts are disabled.Hafiz Abid Qadeer2017-01-201-0/+1
| | | | llvm-svn: 292598
* Make lldb -Werror clean for -Wstring-conversionDavid Blaikie2017-01-061-2/+2
| | | | | | | | | Also found/fixed one bug identified by this warning in RenderScriptx86ABIFixups.cpp where a string literal was being used in an effort to provide a name for an instruction/register, but was instead being passed as the bool 'isVolatile' parameter. llvm-svn: 291198
OpenPOWER on IntegriCloud