Commit Graph

17 Commits

Author SHA1 Message Date
Raphael Isemann 808142876c [lldb][NFC] Fix all formatting errors in .cpp file headers
Summary:
A *.cpp file header in LLDB (and in LLDB) should like this:
```
//===-- TestUtilities.cpp -------------------------------------------------===//
```
However in LLDB most of our source files have arbitrary changes to this format and
these changes are spreading through LLDB as folks usually just use the existing
source files as templates for their new files (most notably the unnecessary
editor language indicator `-*- C++ -*-` is spreading and in every review
someone is pointing out that this is wrong, resulting in people pointing out that this
is done in the same way in other files).

This patch removes most of these inconsistencies including the editor language indicators,
all the different missing/additional '-' characters, files that center the file name, missing
trailing `===//` (mostly caused by clang-format breaking the line).

Reviewers: aprantl, espindola, jfb, shafik, JDevlieghere

Reviewed By: JDevlieghere

Subscribers: dexonsmith, wuzish, emaste, sdardis, nemanjai, kbarton, MaskRay, atanasyan, arphaman, jfb, abidh, jsji, JDevlieghere, usaxena95, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D73258
2020-01-24 08:52:55 +01:00
Alexandre Ganea 1cc0ba4cbd [LLDB] Disable MSVC warning C4190: 'LLDBSwigPythonBreakpointCallbackFunction' has C-linkage specified, but returns UDT 'llvm::Expected<bool>' which is incompatible with C
Differential Revision: https://reviews.llvm.org/D70830
2019-12-03 09:53:26 -05:00
Lawrence D'Anna fb01c01bf3 [LLDB][Python] warning fix for LLDBSwigPythonBreakpointCallbackFunction
This is a quick followup to this commit:

https://reviews.llvm.org/rGa69bbe02a2352271e8b14542073f177e24c499c1

In that, I #pragma-squelch this warning in `ScriptInterpreterPython.cpp`
but we get the same warning in `PythonTestSuite.cpp`.

This patch squelches the same warning in the same way as the
reviweed commit.   I'm submitting it without review under the
"obviously correct" rule.

At least if this is incorrect the main commit was also incorrect.

By the way, as far as I can tell, these functions are extern "C" because
SWIG does that to everything, not because they particularly need to be.
2019-10-30 09:47:27 -07:00
Lawrence D'Anna a69bbe02a2 [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
2019-10-29 15:03:02 -07:00
Jim Ingham 738af7a624 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
2019-10-25 14:05:07 -07:00
Jim Ingham 27a14f19c8 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
2019-10-03 22:50:18 +00:00
Jim Ingham 93c98346e9 Give an error when StepUsingScriptedThreadPlan is passed a bad classname.
Differential Revision: https://reviews.llvm.org/D68173

llvm-svn: 373135
2019-09-28 00:53:45 +00:00
Jonas Devlieghere 6f8251fb38 [ScriptInterpreterPython] Fix the unit test after refactor
llvm-svn: 357313
2019-03-29 20:56:52 +00:00
Jonas Devlieghere 282890d711 [Python] Define empty SWIG wrapper for unit testin"
The python plugin uses wrappers generated by swig. For the symbols to be
available, we'd need to link against liblldb, which is not an option
because the symbols could conflict with the static library we are
testing. Instead we define the symbols ourselves in the unit test.

llvm-svn: 356971
2019-03-26 01:11:15 +00:00
Jonas Devlieghere e3959de268 [PythonTestSuite] Fix usage of InitializePrivate in PythonTestSuite
llvm-svn: 356950
2019-03-25 21:07:53 +00:00
Chandler Carruth 2946cd7010 Update the file headers across all of the LLVM projects in the monorepo
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

llvm-svn: 351636
2019-01-19 08:50:56 +00:00
Jonas Devlieghere 0bca15a35a [FileSystem] Improve assert and add Terminate in unit test.
Speculative fix for the Xcode bots where we were seeing the assertion
being triggered because we would re-initialize the FileSystem without
terminating it.

llvm-svn: 345849
2018-11-01 16:43:34 +00:00
Jonas Devlieghere 46376966ea [FileSystem] Extend file system and have it use the VFS.
This patch extends the FileSystem class with a bunch of functions that
are currently implemented as methods of the FileSpec class. These
methods will be removed in future commits and replaced by calls to the
file system.

The new functions are operated in terms of the virtual file system which
was recently moved from clang into LLVM so it could be reused in lldb.
Because the VFS is stateful, we turned the FileSystem class into a
singleton.

Differential revision: https://reviews.llvm.org/D53532

llvm-svn: 345783
2018-10-31 21:49:27 +00:00
Kate Stone b9c1b51e45 *** This commit represents a complete reformatting of the LLDB source code
*** to conform to clang-format’s LLVM style.  This kind of mass change has
*** two obvious implications:

Firstly, merging this particular commit into a downstream fork may be a huge
effort.  Alternatively, it may be worth merging all changes up to this commit,
performing the same reformatting operation locally, and then discarding the
merge for this particular commit.  The commands used to accomplish this
reformatting were as follows (with current working directory as the root of
the repository):

    find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} +
    find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ;

The version of clang-format used was 3.9.0, and autopep8 was 1.2.4.

Secondly, “blame” style tools will generally point to this commit instead of
a meaningful prior commit.  There are alternatives available that will attempt
to look through this change and find the appropriate prior commit.  YMMV.

llvm-svn: 280751
2016-09-06 20:57:50 +00:00
Pavel Labath 8c68837df3 Fix unit tests on windows
Python headers need to be included before PosixApi.h

llvm-svn: 278345
2016-08-11 15:31:30 +00:00
Enrico Granata 15d1b4e2aa Initialize the Python script interpreter lazily (i.e. not at debugger startup)
This time it should also pass the gtests

llvm-svn: 266103
2016-04-12 18:23:18 +00:00
Zachary Turner c946d46283 gtest - Make a `PythonTestSuite` base class for setup / teardown.
This allows other potential unit test suites (of which one is
forthcoming in a subsequent patch) to re-use the same initialization
and teardown of the GIL.

llvm-svn: 252993
2015-11-13 01:24:35 +00:00