Revision tags: llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5 |
|
#
c1dff715 |
| 28-Nov-2024 |
Pavel Labath <pavel@labath.sk> |
[lldb] Remove child_process_inherit from the socket classes (#117699)
It's never set to true. Also, using inheritable FDs in a multithreaded
process pretty much guarantees descriptor leaks. It's be
[lldb] Remove child_process_inherit from the socket classes (#117699)
It's never set to true. Also, using inheritable FDs in a multithreaded
process pretty much guarantees descriptor leaks. It's better to
explicitly pass a specific FD to a specific subprocess, which we already
mostly can do using the ProcessLaunchInfo FileActions.
show more ...
|
#
07238704 |
| 27-Nov-2024 |
Pavel Labath <pavel@labath.sk> |
[lldb] Add timeout argument to Socket::Accept (#117691)
Allows us to stop waiting for a connection if it doesn't come in a
certain amount of time. Right now, I'm keeping the status quo (infitnite
[lldb] Add timeout argument to Socket::Accept (#117691)
Allows us to stop waiting for a connection if it doesn't come in a
certain amount of time. Right now, I'm keeping the status quo (infitnite
wait) in the "production" code, but using smaller (finite) values in
tests. (A lot of these tests create "loopback" connections, where a
really short wait is sufficient: on linux at least even a poll (0s wait)
is sufficient if the other end has connect()ed already, but this doesn't
seem to be the case on Windows, so I'm using a 1s wait in these cases).
show more ...
|
Revision tags: llvmorg-19.1.4 |
|
#
55068dc3 |
| 19-Nov-2024 |
Pavel Labath <pavel@labath.sk> |
[lldb] Add timed callbacks to the MainLoop class (#112895)
The motivating use case is being able to "time out" certain operations
(by adding a timed callback which will force the termination of the
[lldb] Add timed callbacks to the MainLoop class (#112895)
The motivating use case is being able to "time out" certain operations
(by adding a timed callback which will force the termination of the
loop), but the design is flexible enough to accomodate other use cases
as well (e.g. running a periodic task in the background).
The implementation builds on the existing "pending callback" mechanism,
by associating a time point with each callback -- every time the loop
wakes up, it runs all of the callbacks which are past their point, and
it also makes sure to sleep only until the next callback is scheduled to
run.
I've done some renaming as names like "TriggerPendingCallbacks" were no
longer accurate -- the function may no longer cause any callbacks to be
called (it may just cause the main loop thread to recalculate the time
it wants to sleep).
show more ...
|
#
c25c6c32 |
| 18-Nov-2024 |
Pavel Labath <pavel@labath.sk> |
[lldb] Unify/improve MainLoop signal handling (#115197)
Change the signal handler to use a pipe to notify about incoming
signals. This has two benefits:
- the signal no longer has to happen on the
[lldb] Unify/improve MainLoop signal handling (#115197)
Change the signal handler to use a pipe to notify about incoming
signals. This has two benefits:
- the signal no longer has to happen on the MainLoop thread. With the
previous implementation, this had to be the case as that was the only
way to ensure that ppoll gets interrupted correctly. In a multithreaded
process, this would mean that all other threads have to have the signal
blocked at all times.
- we don't need the android-specific workaround, which was necessary due
to the syscall being implemented in a non-atomic way
When the MainLoop class was first implemented, we did not have the
interrupt self-pipe, so syscall interruption was the most
straight-forward implementation. Over time, the class gained new
abilities (the pipe being one of them), so we can now piggy-back on
those.
This patch also changes the kevent-based implementation to use the pipe
for signal notification as well. The motivation there is slightly
different:
- it makes the implementations more uniform
- it makes sure we handle all kinds of signals, like we do with the
linux version (EVFILT_SIGNAL only catches process-directed signals)
show more ...
|
Revision tags: llvmorg-19.1.3 |
|
#
98b419ca |
| 17-Oct-2024 |
Pavel Labath <pavel@labath.sk> |
[lldb] Don't exit the main loop when in runs out of things to listen on (#112565)
This behavior made sense in the beginning as the class was completely
single threaded, so if the source count ever
[lldb] Don't exit the main loop when in runs out of things to listen on (#112565)
This behavior made sense in the beginning as the class was completely
single threaded, so if the source count ever reached zero, there was no
way to add new ones. In https://reviews.llvm.org/D131160, the class
gained the ability to add events (callbacks) from other threads, which
means that is no longer the case (and indeed, one possible use case for
this class -- acting as a sort of arbiter for multiple threads wanting
to run code while making sure it runs serially -- has this class sit in
an empty Run call most of the time). I'm not aware of us having a use
for such a thing right now, but one of my tests in another patch turned
into something similar by accident.
Another problem with the current approach is that, in a
distributed/dynamic setup (multiple things using the main loop without a
clear coordinator), one can never be sure whether unregistering a
specific event will terminate the loop (it depends on whether there are
other listeners). We had this problem in lldb-platform.cpp, where we had
to add an additional layer of synchronization to avoid premature
termination. We can remove this if we can rely on the loop terminating
only when we tell it to.
show more ...
|
Revision tags: llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0 |
|
#
345cc47b |
| 09-Sep-2024 |
Daniil Fukalov <dfukalov@gmail.com> |
[NFC] Add explicit #include llvm-config.h where its macros are used, lldb part. (#107603)
(this is lldb part)
Without these explicit includes, removing other headers, who implicitly
include llvm
[NFC] Add explicit #include llvm-config.h where its macros are used, lldb part. (#107603)
(this is lldb part)
Without these explicit includes, removing other headers, who implicitly
include llvm-config.h, may have non-trivial side effects. For example,
`clangd` may report even `llvm-config.h` as "no used" in case it defines
a macro, that is explicitly used with #ifdef. It is actually amplified
with different build configs which use different set of macros.
show more ...
|
Revision tags: llvmorg-19.1.0-rc4 |
|
#
4353530a |
| 03-Sep-2024 |
Pavel Labath <pavel@labath.sk> |
[lldb/windows] Reset MainLoop events after handling them (#107061)
This prevents the callback function from being called in a busy loop.
Discovered by @slydiman on #106955.
|
Revision tags: llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init |
|
#
244fcecb |
| 16-Jun-2023 |
Pavel Labath <pavel@labath.sk> |
[lldb] Fix MainLoopTest for changes in D152712
|
Revision tags: llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3 |
|
#
e8ee0f12 |
| 08-Oct-2022 |
Michał Górny <mgorny@gentoo.org> |
[lldb] [MainLoopPosix] Fix crash upon adding lots of pending callbacks
If lots of pending callbacks are added while the main loop has exited already, the trigger pipe buffer fills in, causing the wr
[lldb] [MainLoopPosix] Fix crash upon adding lots of pending callbacks
If lots of pending callbacks are added while the main loop has exited already, the trigger pipe buffer fills in, causing the write to fail and the related assertion to fail. To avoid this, add a boolean member indicating whether the callbacks have been triggered already. If the trigger was done, avoid writing to the pipe until loops proceeds to run them and resets the variable.
Besides fixing the issue, this also avoids writing to the pipe multiple times if callbacks are added faster than the loop is able to process them. Previously, this would lead to the loop performing multiple read iterations from pipe unnecessarily.
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.llvm.org/D135516
show more ...
|
Revision tags: working, llvmorg-15.0.2, llvmorg-15.0.1 |
|
#
65596ced |
| 06-Sep-2022 |
Pavel Labath <pavel@labath.sk> |
[lldb] Go back to process-directed signals in MainLoopTest.cpp
Thread-directed signals are not caught by kqueue (used on Mac). This reverts half of D133181.
|
Revision tags: llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2 |
|
#
6a8bbd26 |
| 04-Aug-2022 |
Pavel Labath <pavel@labath.sk> |
[lldb] Enable the insertion of "pending callbacks" to MainLoops from other threads
This will be used as a replacement for selecting over a pipe fd, which does not work on windows. The posix implemen
[lldb] Enable the insertion of "pending callbacks" to MainLoops from other threads
This will be used as a replacement for selecting over a pipe fd, which does not work on windows. The posix implementation still uses a pipe under the hood, while the windows version uses windows event handles.
The idea is that, instead of writing to a pipe, one just inserts a callback, which does whatever you wanted to do after the bytes come out the read end of the pipe.
Differential Revision: https://reviews.llvm.org/D131160
show more ...
|
#
945bdb16 |
| 02-Sep-2022 |
Jordan Rupprecht <rupprecht@google.com> |
[test] Remove problematic thread from MainLoopTest to fix flakiness
This test, specifically `TwoSignalCallbacks`, can be a little bit flaky, failing in around 5/2000 runs.
POSIX says:
> If the val
[test] Remove problematic thread from MainLoopTest to fix flakiness
This test, specifically `TwoSignalCallbacks`, can be a little bit flaky, failing in around 5/2000 runs.
POSIX says:
> If the value of pid causes sig to be generated for the sending process, and if sig is not blocked for the calling thread and if no other thread has sig unblocked or is waiting in a sigwait() function for sig, either sig or at least one pending unblocked signal shall be delivered to the sending thread before kill() returns.
The problem is that in test setup, we create a new thread with `std::async` and that is occasionally not cleaned up. This leaves that thread available to eat the signal we're polling for.
The need for this to be async does not apply anymore, so we can just make it synchronous.
This makes the test passes in 10000 runs.
Reviewed By: labath
Differential Revision: https://reviews.llvm.org/D133181
show more ...
|
Revision tags: llvmorg-15.0.0-rc1, llvmorg-16-init, llvmorg-14.0.6 |
|
#
5b04eb23 |
| 21-Jun-2022 |
Michał Górny <mgorny@moritz.systems> |
[lldb] [MainLoop] Support "pending callbacks", to be called once
Support adding a "pending callback" to the main loop, that will be called once after all the pending events are processed. This can
[lldb] [MainLoop] Support "pending callbacks", to be called once
Support adding a "pending callback" to the main loop, that will be called once after all the pending events are processed. This can be e.g. to defer destroying the process instance until its exit is fully processed, as suggested in D127500.
Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.llvm.org/D128253
show more ...
|
Revision tags: llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1, llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2, llvmorg-13.0.1-rc1, llvmorg-13.0.0, llvmorg-13.0.0-rc4, llvmorg-13.0.0-rc3, llvmorg-13.0.0-rc2, llvmorg-13.0.0-rc1, llvmorg-14-init, llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3, llvmorg-12.0.1-rc2, llvmorg-12.0.1-rc1 |
|
#
034c73d4 |
| 22-Apr-2021 |
Raphael Isemann <teemperor@gmail.com> |
[lldb][NFC] Fix unsigned/signed cmp warning in MainLoopTest
The gtest checks compare all against unsigned int constants so this also needs to be unsigned.
|
#
08ce2ba5 |
| 13-Apr-2021 |
Michał Górny <mgorny@moritz.systems> |
[lldb] [MainLoop] Support multiple callbacks per signal
Support registering multiple callbacks for a single signal. This is necessary to support multiple co-existing native process instances, with
[lldb] [MainLoop] Support multiple callbacks per signal
Support registering multiple callbacks for a single signal. This is necessary to support multiple co-existing native process instances, with separate SIGCHLD handlers.
The system signal handler is registered on first request, additional callback are added on subsequent requests. The system signal handler is removed when last callback is unregistered.
Differential Revision: https://reviews.llvm.org/D100418
show more ...
|
Revision tags: llvmorg-12.0.0, llvmorg-12.0.0-rc5, llvmorg-12.0.0-rc4, llvmorg-12.0.0-rc3, llvmorg-12.0.0-rc2, llvmorg-11.1.0, llvmorg-11.1.0-rc3, llvmorg-12.0.0-rc1, llvmorg-13-init, llvmorg-11.1.0-rc2, llvmorg-11.1.0-rc1, llvmorg-11.0.1, llvmorg-11.0.1-rc2, llvmorg-11.0.1-rc1 |
|
#
daae4a84 |
| 07-Oct-2020 |
Pavel Labath <pavel@labath.sk> |
[lldb] Modernize PseudoTerminal::OpenSecondary
|
#
6bb123b8 |
| 07-Oct-2020 |
Pavel Labath <pavel@labath.sk> |
[lldb] Modernize PseudoTerminal::OpenFirstAvailablePrimary
replace char*+length combo with llvm::Error
|
Revision tags: llvmorg-11.0.0, llvmorg-11.0.0-rc6, llvmorg-11.0.0-rc5, llvmorg-11.0.0-rc4, llvmorg-11.0.0-rc3, llvmorg-11.0.0-rc2, llvmorg-11.0.0-rc1, llvmorg-12-init, llvmorg-10.0.1, llvmorg-10.0.1-rc4, llvmorg-10.0.1-rc3, llvmorg-10.0.1-rc2 |
|
#
64ec505d |
| 15-Jun-2020 |
Jonas Devlieghere <jonas@devlieghere.com> |
[lldb] Rename Master/Slave to Primary/Secondary (NFC)
|
Revision tags: llvmorg-10.0.1-rc1, llvmorg-10.0.0, llvmorg-10.0.0-rc6, llvmorg-10.0.0-rc5, llvmorg-10.0.0-rc4, llvmorg-10.0.0-rc3, llvmorg-10.0.0-rc2, llvmorg-10.0.0-rc1 |
|
#
80814287 |
| 24-Jan-2020 |
Raphael Isemann <teemperor@gmail.com> |
[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 ----------------------------------------
[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
show more ...
|
Revision tags: llvmorg-11-init |
|
#
5dca0596 |
| 23-Dec-2019 |
Raphael Isemann <teemperor@gmail.com> |
[lldb] Add a SubsystemRAII that takes care of calling Initialize and Terminate in the unit tests
Summary: Many of our tests need to initialize certain subsystems/plugins of LLDB such as `FileSystem`
[lldb] Add a SubsystemRAII that takes care of calling Initialize and Terminate in the unit tests
Summary: Many of our tests need to initialize certain subsystems/plugins of LLDB such as `FileSystem` or `HostInfo` by calling their static `Initialize` functions before the test starts and then calling `::Terminate` after the test is done (in reverse order). This adds a lot of error-prone boilerplate code to our testing code.
This patch adds a RAII called SubsystemRAII that ensures that we always call ::Initialize and then call ::Terminate after the test is done (and that the Terminate calls are always in the reverse order of the ::Initialize calls). It also gets rid of all of the boilerplate that we had for these calls.
Per-fixture initialization is still not very nice with this approach as it would require some kind of static unique_ptr that gets manually assigned/reseted from the gtest SetUpTestCase/TearDownTestCase functions. Because of that I changed all per-fixture setup to now do per-test setup which can be done by just having the SubsystemRAII as a member of the test fixture. This change doesn't influence our normal test runtime as LIT anyway runs each test case separately (and the Initialize/Terminate calls are anyway not very expensive). It will however make running all tests in a single executable slightly slower.
Reviewers: labath, JDevlieghere, martong, espindola, shafik
Reviewed By: labath
Subscribers: mgorny, rnkovacs, emaste, MaskRay, abidh, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D71630
show more ...
|
Revision tags: llvmorg-9.0.1, llvmorg-9.0.1-rc3, llvmorg-9.0.1-rc2, llvmorg-9.0.1-rc1 |
|
#
d82dd6ac |
| 18-Nov-2019 |
Michał Górny <mgorny@gentoo.org> |
[lldb] [unittest] Reenable MainLoopTest.DetectsEOF on NetBSD
The underlying issue is already fixed in the NetBSD kernel for some time, so we can finally reenable the test.
|
Revision tags: llvmorg-9.0.0, llvmorg-9.0.0-rc6, llvmorg-9.0.0-rc5, llvmorg-9.0.0-rc4, llvmorg-9.0.0-rc3 |
|
#
a8f3ae7c |
| 14-Aug-2019 |
Jonas Devlieghere <jonas@devlieghere.com> |
[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, llvmorg-9.0.0-rc1, llvmorg-10-init, llvmorg-8.0.1, llvmorg-8.0.1-rc4, llvmorg-8.0.1-rc3, llvmorg-8.0.1-rc2, llvmorg-8.0.1-rc1 |
|
#
f8a74c18 |
| 10-Apr-2019 |
Aaron Smith <aaron.smith@microsoft.com> |
[lldb-server] Introduce Socket::Initialize and Terminate to simply WSASocket setup
Reviewers: zturner, labath
Reviewed By: labath
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: htt
[lldb-server] Introduce Socket::Initialize and Terminate to simply WSASocket setup
Reviewers: zturner, labath
Reviewed By: labath
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D60440
llvm-svn: 358044
show more ...
|
Revision tags: llvmorg-8.0.0, llvmorg-8.0.0-rc5, llvmorg-8.0.0-rc4, llvmorg-8.0.0-rc3 |
|
#
53eabaab |
| 15-Feb-2019 |
Michal Gorny <mgorny@gentoo.org> |
[lldb] [MainLoop] Add kevent() EINTR handling
Add missing EINTR handling for kevent() calls. If the call is interrupted, return from Poll() as if zero events were returned and let the polling resum
[lldb] [MainLoop] Add kevent() EINTR handling
Add missing EINTR handling for kevent() calls. If the call is interrupted, return from Poll() as if zero events were returned and let the polling resume on next iteration. This fixes test flakiness on NetBSD.
Includes a test case suggested by Pavel Labath on D42206.
Differential Revision: https://reviews.llvm.org/D58230
llvm-svn: 354122
show more ...
|
Revision tags: llvmorg-7.1.0, llvmorg-7.1.0-rc1 |
|
#
01486b22 |
| 08-Feb-2019 |
Michal Gorny <mgorny@gentoo.org> |
[lldb] [unittests] Disable MainLoopTest::DetectsEOF on NetBSD
The NetBSD kernel currently does not support detecting closed slave pty via kevent on master pty. This causes the test to hang forever.
[lldb] [unittests] Disable MainLoopTest::DetectsEOF on NetBSD
The NetBSD kernel currently does not support detecting closed slave pty via kevent on master pty. This causes the test to hang forever. To avoid that, disable the test until the kernel is fixed.
Differential Revision: https://reviews.llvm.org/D57912
llvm-svn: 353545
show more ...
|