mib created this revision.
mib added a reviewer: jingham.
mib requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.
This patch fixes process event handling when the events are broadcasted
at launch. To do so, the patch introduces a new listener to ensure the
event ordering.
Signed-off-by: Med Ismail Bennani <[email protected]>
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D105698
Files:
lldb/source/Target/Process.cpp
Index: lldb/source/Target/Process.cpp
===================================================================
--- lldb/source/Target/Process.cpp
+++ lldb/source/Target/Process.cpp
@@ -10,6 +10,7 @@
#include <memory>
#include <mutex>
+#include "llvm/ADT/ScopeExit.h"
#include "llvm/Support/ScopedPrinter.h"
#include "llvm/Support/Threading.h"
@@ -2470,6 +2471,11 @@
if (error.Fail())
return error;
+ // Listen and queue events that are broadcasted during the process launch.
+ ListenerSP listener_sp(Listener::MakeListener("LaunchEventHijack"));
+ HijackProcessEvents(listener_sp);
+ auto on_exit = llvm::make_scope_exit([this]() { RestoreProcessEvents(); });
+
if (PrivateStateThreadIsValid())
PausePrivateStateThread();
Index: lldb/source/Target/Process.cpp
===================================================================
--- lldb/source/Target/Process.cpp
+++ lldb/source/Target/Process.cpp
@@ -10,6 +10,7 @@
#include <memory>
#include <mutex>
+#include "llvm/ADT/ScopeExit.h"
#include "llvm/Support/ScopedPrinter.h"
#include "llvm/Support/Threading.h"
@@ -2470,6 +2471,11 @@
if (error.Fail())
return error;
+ // Listen and queue events that are broadcasted during the process launch.
+ ListenerSP listener_sp(Listener::MakeListener("LaunchEventHijack"));
+ HijackProcessEvents(listener_sp);
+ auto on_exit = llvm::make_scope_exit([this]() { RestoreProcessEvents(); });
+
if (PrivateStateThreadIsValid())
PausePrivateStateThread();
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits