summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter
Commit message (Collapse)AuthorAgeFilesLines
* [LLDB] Fix compilation with GCC 5Martin Storsjö2020-02-062-3/+4
| | | | | | Differential Revision: https://reviews.llvm.org/D74084 (cherry picked from commit 5bbaf543585c54868f8a2bdd9e74edcf395b24b3)
* [lldb/CommandInterpreter] Remove flag that's always true (NFC)Jonas Devlieghere2020-01-141-12/+4
| | | | | | | The 'asynchronously' argument to both GetLLDBCommandsFromIOHandler and GetPythonCommandsFromIOHandler is true for all call sites. This commit simplifies the API by dropping it and giving the baton a default argument.
* [lldb] Modernize OptionValue::SetValueChangedCallbackPavel Labath2020-01-092-5/+4
| | | | | instead of a function pointer + void*, take a std::function. This removes a bunch of repetitive, unsafe void* casts.
* [lldb/CMake] Fix variable naming in FindLibEditJonas Devlieghere2020-01-021-1/+1
| | | | | | | | | | | | The current FOUND_VAR for FindLibEdit is libedit_FOUND but wasn't set by find_package_handle_standard_args. However this isn't valid for the package name. The argument for FOUND_VAR is "libedit_FOUND", but only "LibEdit_FOUND" and "LIBEDIT_FOUND" are valid names. This fixes all the variables set by FindLibEdit to match the desired naming scheme.
* [lldb] Fix a -Wreturn-type gcc warning in ScriptInterpreter.cppPavel Labath2019-12-231-0/+1
|
* [lldb/ScriptInterpreter] Remove can_reload which is always true (NFC)Jonas Devlieghere2019-12-221-2/+2
| | | | | | The `-r` option for `command script import` is there for legacy compatibility, however the can_reload flag is always set to true. This patch removes the flag and any code that relies on it being false.
* [lldb/ScriptInterpreter] Unify error message for command script importJonas Devlieghere2019-12-221-0/+8
| | | | | Rather than checking for Python explicitly, let the script interpreter handle things and print an error if the functionality is not supported.
* [lldb/ScriptInterpreter] Fix stale/bogus error messagesJonas Devlieghere2019-12-211-2/+2
| | | | | Fix the nonsensical error messages for when breakpoint and watchpoint callbacks are not supported.
* [lldb/Lua] Add missing boiler plate to ScriptInterpreter.Jonas Devlieghere2019-12-211-14/+10
| | | | | | - Fix enum entry order. - Fix missing enum case in CommandObjectBreakpointCommand. - Add Lua entry to swtich in LanguageToString and simplify the code.
* [lldb/Lua] Add Boilerplate for a Lua Script InterpreterJonas Devlieghere2019-12-191-0/+2
| | | | | | | | | | | This adds the boilerplate necessary to support the Lua script interpreter. The interpreter is not functional yet and just reports that it's not implemented. Discussion on the mailing list: http://lists.llvm.org/pipermail/lldb-dev/2019-December/015812.html Differential revision: https://reviews.llvm.org/D71232
* [lldb/Scripting] Simplify code by removing the #if.Jonas Devlieghere2019-12-181-11/+3
| | | | | | | | | The "none" script interpreter does not depend on Python so it doesn't make sense to have it withing the if-block. The only goal seems to be to have a slightly different error for when there's no script interpreter, but as per the comment this doesn't make sense for more than one scripting language. I think the existing error is perfectly clear, so I just removed this altogether.
* [lldb/CMake] Rename LLDB_DISABLE_PYTHON to LLDB_ENABLE_PYTHONJonas Devlieghere2019-12-131-7/+7
| | | | | | | This matches the naming scheme used by LLVM and all the other optional dependencies in LLDB. Differential revision: https://reviews.llvm.org/D71482
* [lldb/CMake] Rename LLDB_DISABLE_LIBEDIT to LLDB_ENABLE_LIBEDITJonas Devlieghere2019-12-122-2/+2
| | | | | | This matches the naming scheme used by LLVM. Differential revision: https://reviews.llvm.org/D71380
* [lldb/Host] Use Host/Config.h entries instead of a global define.Jonas Devlieghere2019-12-102-6/+4
| | | | | | | | | | | As suggested by Pavel in a code review: > Can we replace this (and maybe python too, while at it) with a > Host/Config.h entry? A global definition means that one has to > recompile everything when these change in any way, whereas in > practice only a handful of files need this.. Differential revision: https://reviews.llvm.org/D71280
* [lldb][NFC] Migrate FileSpec::Dump to raw_ostreamRaphael Isemann2019-12-061-1/+1
|
* Clear out the python class name in OptionParsingStarted for the ↵Jim Ingham2019-12-041-0/+1
| | | | | | | | OptionGroupPythonClassWithDict options class. This value was hanging around so for instance if you made a scripted breakpoint resolver, then went to set another breakpoint, it would still think you had passed in a class name and the breakpoint wouldn't do what you expected.
* Add help text for parray and poarray aliases.Jason Molenda2019-12-041-4/+17
|
* [lldb][NFC] Give some parameters in CommandInterpreter more descriptive namesRaphael Isemann2019-11-051-6/+6
|
* [ValueObjectDisplay] Generalize the description of an option.Davide Italiano2019-10-291-1/+1
|
* Add the ability to pass extra args to a Python breakpoint callback.Jim Ingham2019-10-252-24/+49
| | | | | | | | | | | | | | | | | For example, it is pretty easy to write a breakpoint command that implements "stop when my caller is Foo", and it is pretty easy to write a breakpoint command that implements "stop when my caller is Bar". But there's no way to write a generic "stop when my caller is..." function, and then specify the caller when you add the command to a breakpoint. With this patch, you can pass this data in a SBStructuredData dictionary. That will get stored in the PythonCommandBaton for the breakpoint, and passed to the implementation function (if it has the right signature) when the breakpoint is hit. Then in lldb, you can say: (lldb) break com add -F caller_is -k caller_name -v Foo More generally this will allow us to write reusable Python breakpoint commands. Differential Revision: https://reviews.llvm.org/D68671
* Replace static const StringRef with StringRef (NFC)Adrian Prantl2019-10-081-3/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D68597 llvm-svn: 374081
* Python3 doesn't seem to allow you to tell whether an object is a classJim Ingham2019-10-031-2/+1
| | | | | | | | | PyClass_Check and everything it relied on seems gone from Python3.7. So I won't check whether it is a class first... Also cleaned up a couple of warnings. llvm-svn: 373679
* Forgot to change the header guards on OptionGroupPythonClassWithDict.Jim Ingham2019-10-031-1/+1
| | | | | | I think that's what is confusing the modules build on the bots. llvm-svn: 373677
* Break out the Python class & key/value options into a separate OptionGroup.Jim Ingham2019-10-033-0/+129
| | | | | | | | | | Use this in the scripted breakpoint command. Added some tests for parsing the key/value options. This uncovered a bug in handling parsing errors mid-line. I also fixed that bug. Differential Revision: https://reviews.llvm.org/D68363 llvm-svn: 373673
* remove File::SetStream(), make new files instead.Lawrence D'Anna2019-09-271-13/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch removes File::SetStream() and File::SetDescriptor(), and replaces most direct uses of File with pointers to File. Instead of calling SetStream() on a file, we make a new file and replace it. My ultimate goal here is to introduce a new API class SBFile, which has full support for python io.IOStream file objects. These can redirect read() and write() to python code, so lldb::Files will need a way to dispatch those methods. Additionally it will need some form of sharing and assigning files, as a SBFile will be passed in and assigned to the main IO streams of the debugger. In my prototype patch queue, I make File itself copyable and add a secondary class FileOps to manage the sharing and dispatch. In that case SBFile was a unique_ptr<File>. (here: https://github.com/smoofra/llvm-project/tree/files) However in review, Pavel Labath suggested that it be shared_ptr instead. (here: https://reviews.llvm.org/D67793) In order for SBFile to use shared_ptr<File>, everything else should as well. If this patch is accepted, I will make SBFile use a shared_ptr I will remove FileOps from future patches and use subclasses of File instead. Reviewers: JDevlieghere, jasonmolenda, zturner, jingham, labath Reviewed By: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D67891 llvm-svn: 373090
* Convert FileSystem::Open() to return Expected<FileUP>Lawrence D'Anna2019-09-261-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch converts FileSystem::Open from this prototype: Status Open(File &File, const FileSpec &file_spec, ...); to this one: llvm::Expected<std::unique_ptr<File>> Open(const FileSpec &file_spec, ...); This is beneficial on its own, as llvm::Expected is a more modern and recommended error type than Status. It is also a necessary step towards https://reviews.llvm.org/D67891, and further developments for lldb_private::File. Reviewers: JDevlieghere, jasonmolenda, labath Reviewed By: labath Subscribers: mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D67996 llvm-svn: 373003
* Don't stop execution in batch mode when process stops with SIGINT or SIGSTOPTatyana Krasnukha2019-09-262-53/+60
| | | | | | | | Summary: Usually, SIGINT and SIGSTOP don't imply a crash, e.g. SIGSTOP is sent on process launch and attach on some platforms. Differential Revision: https://reviews.llvm.org/D67776 llvm-svn: 372961
* [lldb][NFC] Remove CompletionRequest::GetCursorArgument and ↵Raphael Isemann2019-09-251-1/+1
| | | | | | | | | | GetRawLineUntilCursor They both return the same result as another function (GetCursorArgumentPrefix and GetRawLine). They were only added because the old API allowed to look (in theory) behind the cursor position which is no longer possible. llvm-svn: 372861
* [lldb][NFC] Add CompletionRequest::AppendEmptyArgumentRaphael Isemann2019-09-251-3/+1
| | | | | | | | | This is the only legitimate use we currently have for modifying a CompletionRequest. Add a utility function for this purpose and remove the remaining setters which go against the idea of having an immutable CompletionRequest. llvm-svn: 372858
* [lldb][NFC] Remove useless cursor shifting in Options::HandleOptionCompletionRaphael Isemann2019-09-251-4/+1
| | | | | | | | The cursor position is always at the end of the current argument (as the argument cut off after the cursor position). So this code is a no-op and can be removed. llvm-svn: 372851
* [lldb] Remove redundant argument lists in CompletionRequestRaphael Isemann2019-09-241-1/+1
| | | | | | | | | | | We currently have two lists in the CompletionRequest that we inherited from the old API: The complete list of arguments ignoring where the user requested completion and the list of arguments that stops at the cursor. Having two lists of arguments is confusing and can lead to subtle errors, so let's remove the complete list until we actually need it. llvm-svn: 372692
* [lldb][NFC] Remove unused variable in Options::HandleOptionArgumentCompletionRaphael Isemann2019-09-231-1/+0
| | | | llvm-svn: 372574
* [lldb][NFC] Remove dead code in Options::HandleOptionArgumentCompletionRaphael Isemann2019-09-231-9/+2
| | | | llvm-svn: 372572
* [lldb] Make cursor index in CompletionRequest unsignedRaphael Isemann2019-09-232-4/+4
| | | | | | | | | | | | The fact that index==-1 means "no arguments" is not obvious and only used in one place from what I can tell. Also fixes several warnings about using the cursor index as if it was a size_t when comparing. Not fully NFC as we now also correctly update the partial argument list when injecting the fake empty argument in the CompletionRequest constructor. llvm-svn: 372566
* [lldb][NFC] Remove argument prefix checking boilerplate when adding completionsRaphael Isemann2019-09-234-15/+5
| | | | llvm-svn: 372561
* [lldb] Reduce some dangerous boilerplate with CompletionRequest::ShiftArgumentsRaphael Isemann2019-09-231-2/+1
| | | | | | | | | | | | | We should in general not allow external code to fiddle with the internals of CompletionRequest, but until this is gone let's at least provide a utility function that makes this less dangerous. This also now correct updates the partially parsed argument list, but it doesn't seem to be used by anything that is behind one of the current shift/SetCursorIndex calls, so this doesn't seeem to fix any currently used completion. llvm-svn: 372556
* [lldb][NFC] Remove ArgEntry::ref memberRaphael Isemann2019-09-135-14/+14
| | | | | | | | | | | The StringRef should always be identical to the C string, so we might as well just create the StringRef from the C-string. This might be slightly slower until we implement the storage of ArgEntry with a string instead of a std::unique_ptr<char[]>. Until then we have to do the additional strlen on the C string to construct the StringRef. llvm-svn: 371842
* [lldb][NFC] Make ArgEntry::quote private and provide a getterRaphael Isemann2019-09-131-1/+1
| | | | llvm-svn: 371823
* Remove `bugreport` commandJonas Devlieghere2019-09-051-3/+0
| | | | | | | | | | | | The bugreport command exists to create domain-specific bug reports. Currently it has one implementation for filing bugs on the unwinder. As far as we can tell, it has never been of use. Although not exactly the same as the reproducers, it's a bit confusing to have two parallel command trees for (kind of) the same thing. Differential revision: https://reviews.llvm.org/D65469 llvm-svn: 371132
* [lldb] Add description to option completions.Raphael Isemann2019-09-021-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Right now our argument completions are rather cryptic for command options as they only list the letters: ``` (lldb) breakpoint set - Available completions: -G -C -c -d -i -o -q -t -x [...] ``` With the new completion API we can easily extend this with the flag description so that it looks like this now: ``` (lldb) breakpoint set - Available completions: -G -- The breakpoint will auto-continue after running its commands. -C -- A command to run when the breakpoint is hit, can be provided more than once, the commands will get run in order left to right. -c -- The breakpoint stops only if this condition expression evaluates to true. -d -- Disable the breakpoint. -i -- Set the number of times this breakpoint is skipped before stopping. -o -- The breakpoint is deleted the first time it stop causes a stop. -q -- The breakpoint stops only for threads in the queue whose name is given by this argument. -t -- The breakpoint stops only for the thread whose TID matches this argument. -x -- The breakpoint stops only for the thread whose index matches this argument. ``` The same happens with --long-options now. Reviewers: #lldb, labath Reviewed By: labath Subscribers: labath, JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D67063 llvm-svn: 370628
* [lldb] Unify target checking in CommandObjectRaphael Isemann2019-08-311-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: We currently have several CommandObjects that manually reimplement the checking for a selected target or a target in the execution context (which is the selected target when they are invoked). This patch removes all these checks and replaces them by setting the eCommandRequiresTarget flag that Pavel suggested. With this flag we are doing the same check but without having to duplicate this code in all these CommandObjects. I also added a `GetSelectedTarget()` variant of the `GetSelectedOrDummyTarget()` function to the CommandObject that checks that the flag is set and then returns a reference to the target. I didn't rewrite all the `target` variables from `Target *` to `Target &` in this patch as last time this change caused a lot of merge conflicts in Swift and I would prefer having that in a separate NFC commit. Reviewers: labath, clayborg Reviewed By: labath, clayborg Subscribers: clayborg, JDevlieghere, jingham, amccarth, abidh, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D66863 llvm-svn: 370571
* [lldb] Fix and test completion for ambiguous long optionsRaphael Isemann2019-08-281-10/+4
| | | | | | | | | | The refactoring patch for the option completion broke the completion for ambiguous long options. As this feature was also untested (as testing ambiguous options with the current test methods is impossible), I just noticed now. This patch restores the old behavior and adds a test for this feature. llvm-svn: 370185
* [lldb][NFC] Get rid of C-strings in HandleOptionCompletionRaphael Isemann2019-08-281-17/+11
| | | | llvm-svn: 370179
* [lldb][NFC] Remove dead code that handles situations where LLDB has no dummy ↵Raphael Isemann2019-08-261-4/+4
| | | | | | | | | | | | | | | | | | | | | | target Summary: We always have a dummy target, so any error handling regarding a missing dummy target is dead code now. Also makes the CommandObject methods that return Target& to express this fact in the API. This patch just for the CommandObject part of LLDB. I'll migrate the rest of LLDB in a follow-up patch that's WIP. Reviewers: labath Reviewed By: labath Subscribers: abidh, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D66737 llvm-svn: 369939
* Extend FindTypes with CompilerContext to allow filtering by language.Adrian Prantl2019-08-221-9/+7
| | | | | | | | | | | | | | | | | | | This patch is also motivated by the Swift branch and is effectively NFC for the single-TypeSystem llvm.org branch. In multi-language projects it is extremely common to have, e.g., a Clang type and a similarly-named rendition of that same type in another language. When searching for a type It is much cheaper to pass a set of supported languages to the SymbolFile than having it materialize every result and then rejecting the materialized types that have the wrong language. Differential Revision: https://reviews.llvm.org/D66546 <rdar://problem/54471165> This reapplies r369690 with a previously missing constructor for LanguageSet. llvm-svn: 369710
* Revert Extend FindTypes with CompilerContext to allow filtering by language.Adrian Prantl2019-08-221-7/+9
| | | | | | This reverts r369690 (git commit aa3a564efa6b5fff2129f81a4041069a0233168f) llvm-svn: 369702
* Rename lldb/source/Interpreter/OptionValueFileSpecListTmp.cpp toAdrian Prantl2019-08-222-1/+1
| | | | | | lldb/source/Interpreter/OptionValueFileSpecList.cpp (NFC) llvm-svn: 369699
* Rename lldb/source/Interpreter/OptionValueFileSpecLIst.cpp toAdrian Prantl2019-08-222-2/+2
| | | | | | lldb/source/Interpreter/OptionValueFileSpecListTmp.cpp (NFC) llvm-svn: 369698
* Extend FindTypes with CompilerContext to allow filtering by language.Adrian Prantl2019-08-221-9/+7
| | | | | | | | | | | | | | | | | This patch is also motivated by the Swift branch and is effectively NFC for the single-TypeSystem llvm.org branch. In multi-language projects it is extremely common to have, e.g., a Clang type and a similarly-named rendition of that same type in another language. When searching for a type It is much cheaper to pass a set of supported languages to the SymbolFile than having it materialize every result and then rejecting the materialized types that have the wrong language. Differential Revision: https://reviews.llvm.org/D66546 <rdar://problem/54471165> llvm-svn: 369690
* [lldb][NFC] Remove unused return value from HandleOptionArgumentCompletionRaphael Isemann2019-08-221-5/+2
| | | | llvm-svn: 369635
OpenPOWER on IntegriCloud