| #
a69bbe02 |
| 29-Oct-2019 |
Lawrence D'Anna <[email protected]> |
[LLDB][breakpoints] ArgInfo::count -> ArgInfo::max_positional_args
Summary: Move breakpoints from the old, bad ArgInfo::count to the new, better ArgInfo::max_positional_args. Soon ArgInfo::count w
[LLDB][breakpoints] ArgInfo::count -> ArgInfo::max_positional_args
Summary: Move breakpoints from the old, bad ArgInfo::count to the new, better ArgInfo::max_positional_args. Soon ArgInfo::count will be no more.
It looks like this functionality is already well tested by `TestBreakpointCommandsFromPython.py`, so there's no need to write additional tests for it.
Reviewers: labath, jingham, JDevlieghere
Reviewed By: labath
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D69468
show more ...
|
| #
5e307808 |
| 26-Oct-2019 |
Shu-Chun Weng <[email protected]> |
Correct size_t format specifier
Differential Revision: https://reviews.llvm.org/D69455
|
| #
738af7a6 |
| 25-Oct-2019 |
Jim Ingham <[email protected]> |
Add the ability to pass extra args to a Python breakpoint callback.
For example, it is pretty easy to write a breakpoint command that implements "stop when my caller is Foo", and it is prett
Add the ability to pass extra args to a Python breakpoint callback.
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
show more ...
|
| #
04edd189 |
| 22-Oct-2019 |
Lawrence D'Anna <[email protected]> |
remove multi-argument form of PythonObject::Reset()
Summary: With this patch, only the no-argument form of `Reset()` remains in PythonDataObjects. It also deletes PythonExceptionState in favor of
remove multi-argument form of PythonObject::Reset()
Summary: With this patch, only the no-argument form of `Reset()` remains in PythonDataObjects. It also deletes PythonExceptionState in favor of PythonException, because the only call-site of PythonExceptionState was also using Reset, so I cleaned up both while I was there.
Reviewers: JDevlieghere, clayborg, labath, jingham
Reviewed By: labath
Subscribers: mgorny, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D69214
llvm-svn: 375475
show more ...
|
| #
722b6189 |
| 19-Oct-2019 |
Lawrence D'Anna <[email protected]> |
eliminate nontrivial Reset(...) from TypedPythonObject
Summary: This deletes `Reset(...)`, except for the no-argument form `Reset()` from `TypedPythonObject`, and therefore from `PythonString`, `Pyt
eliminate nontrivial Reset(...) from TypedPythonObject
Summary: This deletes `Reset(...)`, except for the no-argument form `Reset()` from `TypedPythonObject`, and therefore from `PythonString`, `PythonList`, etc.
It updates the various callers to use assignment, `As<>`, `Take<>`, and `Retain<>`, as appropriate.
followon to https://reviews.llvm.org/D69080
Reviewers: JDevlieghere, clayborg, labath, jingham
Reviewed By: labath
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D69133
llvm-svn: 375350
show more ...
|
| #
0f783599 |
| 17-Oct-2019 |
Lawrence D'Anna <[email protected]> |
delete SWIG typemaps for FILE*
Summary: The SWIG typemaps for FILE* are no longer used, so this patch deletes them.
Reviewers: JDevlieghere, jasonmolenda, labath
Reviewed By: labath
Subscribers:
delete SWIG typemaps for FILE*
Summary: The SWIG typemaps for FILE* are no longer used, so this patch deletes them.
Reviewers: JDevlieghere, jasonmolenda, labath
Reviewed By: labath
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D68963
llvm-svn: 375073
show more ...
|
| #
b07823f3 |
| 16-Oct-2019 |
Lawrence D'Anna <[email protected]> |
update ScriptInterpreterPython to use File, not FILE*
Summary: ScriptInterpreterPython needs to save and restore sys.stdout and friends when LLDB runs a python script.
It currently does this using
update ScriptInterpreterPython to use File, not FILE*
Summary: ScriptInterpreterPython needs to save and restore sys.stdout and friends when LLDB runs a python script.
It currently does this using FILE*, which is not optimal. If whatever was in sys.stdout can not be represented as a FILE*, then it will not be restored correctly when the script is finished.
It also means that if the debugger's own output stream is not representable as a file, ScriptInterpreterPython will not be able to redirect python's output correctly.
This patch updates ScriptInterpreterPython to represent files with lldb_private::File, and to represent whatever the user had in sys.stdout as simply a PythonObject.
This will make lldb interoperate better with other scripts or programs that need to manipulate sys.stdout.
Reviewers: JDevlieghere, jasonmolenda, labath
Reviewed By: labath
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D68962
llvm-svn: 374964
show more ...
|
| #
9eb13719 |
| 09-Oct-2019 |
Lawrence D'Anna <[email protected]> |
SBFile support in SBCommandReturnObject
Summary: This patch add SBFile interfaces to SBCommandReturnObject, and removes the internal callers of its FILE* interfaces.
Reviewers: JDevlieghere, jasonm
SBFile support in SBCommandReturnObject
Summary: This patch add SBFile interfaces to SBCommandReturnObject, and removes the internal callers of its FILE* interfaces.
Reviewers: JDevlieghere, jasonmolenda, labath
Reviewed By: JDevlieghere
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D68434
llvm-svn: 374238
show more ...
|
| #
0016b450 |
| 08-Oct-2019 |
Haibo Huang <[email protected]> |
[lldb] Reverts part of 61f471a
Seems I wrongly merged an old patch.
Reverts the change related to python dir for windows.
FileSpec should always contain normalized path. I.e. using '/' even in win
[lldb] Reverts part of 61f471a
Seems I wrongly merged an old patch.
Reverts the change related to python dir for windows.
FileSpec should always contain normalized path. I.e. using '/' even in windows.
llvm-svn: 373998
show more ...
|
| #
61f471a7 |
| 07-Oct-2019 |
Haibo Huang <[email protected]> |
[lldb] Unifying lldb python path
Based on mgorny@'s D67890
There are 3 places where python site-package path is calculated independently:
1. finishSwigPythonLLDB.py where files are written to site
[lldb] Unifying lldb python path
Based on mgorny@'s D67890
There are 3 places where python site-package path is calculated independently:
1. finishSwigPythonLLDB.py where files are written to site-packages.
2. lldb/scripts/CMakeLists.txt where site-packages are installed.
3. ScriptInterpreterPython.cpp where site-packages are added to PYTHONPATH.
This change creates the path once and use it everywhere. So that they will not go out of sync.
Also it provides a chance for cross compiling users to specify the right path for site-packages.
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D68442
llvm-svn: 373991
show more ...
|
| #
27a14f19 |
| 03-Oct-2019 |
Jim Ingham <[email protected]> |
Pass an SBStructuredData to scripted ThreadPlans on use.
This will allow us to write reusable scripted ThreadPlans, since you can use key/value pairs with known keys in the plan to parametrize its b
Pass an SBStructuredData to scripted ThreadPlans on use.
This will allow us to write reusable scripted ThreadPlans, since you can use key/value pairs with known keys in the plan to parametrize its behavior.
Differential Revision: https://reviews.llvm.org/D68366
llvm-svn: 373675
show more ...
|
| #
f913fd6e |
| 03-Oct-2019 |
Lawrence D'Anna <[email protected]> |
factor out an abstract base class for File
Summary: This patch factors out File as an abstract base class and moves most of its actual functionality into a subclass called NativeFile. In the next
factor out an abstract base class for File
Summary: This patch factors out File as an abstract base class and moves most of its actual functionality into a subclass called NativeFile. In the next patch, I'm going to be adding subclasses of File that don't necessarily have any connection to actual OS files, so they will not inherit from NativeFile.
This patch was split out as a prerequisite for https://reviews.llvm.org/D68188
Reviewers: JDevlieghere, jasonmolenda, labath
Reviewed By: labath
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D68317
llvm-svn: 373564
show more ...
|
| #
93c98346 |
| 28-Sep-2019 |
Jim Ingham <[email protected]> |
Give an error when StepUsingScriptedThreadPlan is passed a bad classname.
Differential Revision: https://reviews.llvm.org/D68173
llvm-svn: 373135
|
| #
7ca15ba7 |
| 27-Sep-2019 |
Lawrence D'Anna <[email protected]> |
remove File::SetStream(), make new files instead.
Summary: This patch removes File::SetStream() and File::SetDescriptor(), and replaces most direct uses of File with pointers to File. Instead of cal
remove File::SetStream(), make new files instead.
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
show more ...
|
| #
2fce1137 |
| 26-Sep-2019 |
Lawrence D'Anna <[email protected]> |
Convert FileSystem::Open() to return Expected<FileUP>
Summary: This patch converts FileSystem::Open from this prototype:
Status Open(File &File, const FileSpec &file_spec, ...);
to this one:
llvm
Convert FileSystem::Open() to return Expected<FileUP>
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
show more ...
|
| #
4d4a8eed |
| 25-Sep-2019 |
Jonas Devlieghere <[email protected]> |
remove unused method ResetOutputFileHandle()
ResetOutputFileHandle() isn't being used by anything. Also it's using FILE*, which is something we should be doing less of. Remove it.
Patch by: Lawrenc
remove unused method ResetOutputFileHandle()
ResetOutputFileHandle() isn't being used by anything. Also it's using FILE*, which is something we should be doing less of. Remove it.
Patch by: Lawrence D'Anna
Differential revision: https://reviews.llvm.org/D68001
llvm-svn: 372800
show more ...
|
| #
20b52c33 |
| 18-Sep-2019 |
Jonas Devlieghere <[email protected]> |
[ScriptInterpreter] Limit LLDB's globals to interactive mode.
Jim pointed out that the LLDB global variables should only be available in interactive mode. When used from a command for example, their
[ScriptInterpreter] Limit LLDB's globals to interactive mode.
Jim pointed out that the LLDB global variables should only be available in interactive mode. When used from a command for example, their values might be stale or not at all what the user expects. Therefore we want to explicitly make these variables unavailable.
Differential revision: https://reviews.llvm.org/D67685
llvm-svn: 372192
show more ...
|
| #
abb3d137 |
| 18-Sep-2019 |
Jonas Devlieghere <[email protected]> |
[ScriptInterpreter] Remove ScriptInterpreterPythonImpl::Clear() (NFC)
This method is never called.
llvm-svn: 372190
|
|
Revision tags: llvmorg-9.0.0, llvmorg-9.0.0-rc6 |
|
| #
a879f40b |
| 17-Sep-2019 |
Jonas Devlieghere <[email protected]> |
[ScriptInterpreter] Initialize globals when loading a scripting module.
The LoadScriptingModule used by command script import wasn't initializing the LLDB global variables (things like `lldb.frame`
[ScriptInterpreter] Initialize globals when loading a scripting module.
The LoadScriptingModule used by command script import wasn't initializing the LLDB global variables (things like `lldb.frame` and `lldb.debugger`). They would get initialized however when running the interactive script interpreter or running a single script line (e.g. `script print(lldb.frame)`). This patch fixes that by properly initializing the globals when loading a Python module.
Differential revision: https://reviews.llvm.org/D67644
llvm-svn: 372060
show more ...
|
|
Revision tags: llvmorg-9.0.0-rc5, llvmorg-9.0.0-rc4, llvmorg-9.0.0-rc3 |
|
| #
a8f3ae7c |
| 14-Aug-2019 |
Jonas Devlieghere <[email protected]> |
[LLDB] Migrate llvm::make_unique to std::make_unique
Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of
[LLDB] Migrate llvm::make_unique to std::make_unique
Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo.
Differential revision: https://reviews.llvm.org/D66259
llvm-svn: 368933
show more ...
|
|
Revision tags: llvmorg-9.0.0-rc2 |
|
| #
ea1752a7 |
| 06-Aug-2019 |
Jonas Devlieghere <[email protected]> |
[Gardening] Remove dead code from ScriptInterpreterPython (NFC)
The terminal state is never saved or restored.
llvm-svn: 367977
|
|
Revision tags: llvmorg-9.0.0-rc1 |
|
| #
63e5fb76 |
| 24-Jul-2019 |
Jonas Devlieghere <[email protected]> |
[Logging] Replace Log::Printf with LLDB_LOG macro (NFC)
This patch replaces explicit calls to log::Printf with the new LLDB_LOGF macro. The macro is similar to LLDB_LOG but supports printf-style for
[Logging] Replace Log::Printf with LLDB_LOG macro (NFC)
This patch replaces explicit calls to log::Printf with the new LLDB_LOGF macro. The macro is similar to LLDB_LOG but supports printf-style format strings, instead of formatv-style format strings.
So instead of writing:
if (log) log->Printf("%s\n", str);
You'd write:
LLDB_LOG(log, "%s\n", str);
This change was done mechanically with the command below. I replaced the spurious if-checks with vim, since I know how to do multi-line replacements with it.
find . -type f -name '*.cpp' -exec \ sed -i '' -E 's/log->Printf\(/LLDB_LOGF\(log, /g' "{}" +
Differential revision: https://reviews.llvm.org/D65128
llvm-svn: 366936
show more ...
|
|
Revision tags: llvmorg-10-init, llvmorg-8.0.1, llvmorg-8.0.1-rc4, llvmorg-8.0.1-rc3, llvmorg-8.0.1-rc2 |
|
| #
248a1305 |
| 23-May-2019 |
Konrad Kleine <[email protected]> |
[lldb] NFC modernize codebase with modernize-use-nullptr
Summary: NFC = [[ https://llvm.org/docs/Lexicon.html#nfc | Non functional change ]]
This commit is the result of modernizing the LLDB codeba
[lldb] NFC modernize codebase with modernize-use-nullptr
Summary: NFC = [[ https://llvm.org/docs/Lexicon.html#nfc | Non functional change ]]
This commit is the result of modernizing the LLDB codebase by using `nullptr` instread of `0` or `NULL`. See https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-nullptr.html for more information.
This is the command I ran and I to fix and format the code base:
``` run-clang-tidy.py \ -header-filter='.*' \ -checks='-*,modernize-use-nullptr' \ -fix ~/dev/llvm-project/lldb/.* \ -format \ -style LLVM \ -p ~/llvm-builds/debug-ninja-gcc ```
NOTE: There were also changes to `llvm/utils/unittest` but I did not include them because I felt that maybe this library shall be updated in isolation somehow.
NOTE: I know this is a rather large commit but it is a nobrainer in most parts.
Reviewers: martong, espindola, shafik, #lldb, JDevlieghere
Reviewed By: JDevlieghere
Subscribers: arsenm, jvesely, nhaehnle, hiraditya, JDevlieghere, teemperor, rnkovacs, emaste, kubamracek, nemanjai, ki.stfu, javed.absar, arichardson, kbarton, jrtc27, MaskRay, atanasyan, dexonsmith, arphaman, jfb, jsji, jdoerfert, lldb-commits, llvm-commits
Tags: #lldb, #llvm
Differential Revision: https://reviews.llvm.org/D61847
llvm-svn: 361484
show more ...
|
|
Revision tags: llvmorg-8.0.1-rc1 |
|
| #
2b29b432 |
| 26-Apr-2019 |
Jonas Devlieghere <[email protected]> |
[ScriptInterpreter] Move ownership into debugger (NFC)
This is part two of the change started in r359330. This patch moves the ownership of the script interpreter from the command interpreter into t
[ScriptInterpreter] Move ownership into debugger (NFC)
This is part two of the change started in r359330. This patch moves the ownership of the script interpreter from the command interpreter into the debugger. I would've preferred to remove the lazy initialization, however the fact that the scripting language is set after the debugger is created makes that tricky. So for now this does exactly the same thing as when it was under the command interpreter. The result is that this patch is fully NFC.
Differential revision: https://reviews.llvm.org/D61211
llvm-svn: 359354
show more ...
|
| #
8d1fb843 |
| 26-Apr-2019 |
Jonas Devlieghere <[email protected]> |
[ScriptInterpreter] Pass the debugger instead of the command interpreter
As discussed in D61090, there's no good reason for the script interpreter to depend on the command interpreter. When looking
[ScriptInterpreter] Pass the debugger instead of the command interpreter
As discussed in D61090, there's no good reason for the script interpreter to depend on the command interpreter. When looking at the code, it becomes clear that we mostly use the command interpreter as a way to access the debugger. Hence, it makes more sense to just pass that to the script interpreter directly.
This is part 1 out of 2. I have another patch in the pipeline that changes the ownership of the script interpreter to the debugger as well, but I didn't get around to finish that today.
Differential revision: https://reviews.llvm.org/D61172
llvm-svn: 359330
show more ...
|