[Lldb-commits] [PATCH] D148400: [lldb] Fix bug to update process public run lock with process state
Med Ismail Bennani via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Wed Apr 19 16:54:16 PDT 2023
mib updated this revision to Diff 515137.
mib edited the summary of this revision.
mib added a comment.
Fix condition typo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D148400/new/
https://reviews.llvm.org/D148400
Files:
lldb/include/lldb/Target/Process.h
lldb/source/Target/Process.cpp
lldb/source/Target/Target.cpp
Index: lldb/source/Target/Target.cpp
===================================================================
--- lldb/source/Target/Target.cpp
+++ lldb/source/Target/Target.cpp
@@ -3157,8 +3157,8 @@
// its own hijacking listener or if the process is created by the target
// manually, without the platform).
if (!launch_info.GetHijackListener())
- launch_info.SetHijackListener(
- Listener::MakeListener("lldb.Target.Launch.hijack"));
+ launch_info.SetHijackListener(Listener::MakeListener(
+ Process::LaunchSynchronousHijackListenerName.data()));
// If we're not already connected to the process, and if we have a platform
// that can launch a process for debugging, go ahead and do that here.
@@ -3334,8 +3334,8 @@
ListenerSP hijack_listener_sp;
const bool async = attach_info.GetAsync();
if (!async) {
- hijack_listener_sp =
- Listener::MakeListener("lldb.Target.Attach.attach.hijack");
+ hijack_listener_sp = Listener::MakeListener(
+ Process::AttachSynchronousHijackListenerName.data());
attach_info.SetHijackListener(hijack_listener_sp);
}
Index: lldb/source/Target/Process.cpp
===================================================================
--- lldb/source/Target/Process.cpp
+++ lldb/source/Target/Process.cpp
@@ -1355,8 +1355,6 @@
return error;
}
-static const char *g_resume_sync_name = "lldb.Process.ResumeSynchronous.hijack";
-
Status Process::ResumeSynchronous(Stream *stream) {
Log *log(GetLog(LLDBLog::State | LLDBLog::Process));
LLDB_LOGF(log, "Process::ResumeSynchronous -- locking run lock");
@@ -1367,7 +1365,7 @@
}
ListenerSP listener_sp(
- Listener::MakeListener(g_resume_sync_name));
+ Listener::MakeListener(ResumeSynchronousHijackListenerName.data()));
HijackProcessEvents(listener_sp);
Status error = PrivateResume();
@@ -1393,9 +1391,8 @@
bool Process::StateChangedIsExternallyHijacked() {
if (IsHijackedForEvent(eBroadcastBitStateChanged)) {
- const char *hijacking_name = GetHijackingListenerName();
- if (hijacking_name &&
- strcmp(hijacking_name, g_resume_sync_name))
+ llvm::StringRef hijacking_name = GetHijackingListenerName();
+ if (!hijacking_name.starts_with("lldb.internal"))
return true;
}
return false;
@@ -1403,9 +1400,8 @@
bool Process::StateChangedIsHijackedForSynchronousResume() {
if (IsHijackedForEvent(eBroadcastBitStateChanged)) {
- const char *hijacking_name = GetHijackingListenerName();
- if (hijacking_name &&
- strcmp(hijacking_name, g_resume_sync_name) == 0)
+ llvm::StringRef hijacking_name = GetHijackingListenerName();
+ if (hijacking_name == ResumeSynchronousHijackListenerName)
return true;
}
return false;
Index: lldb/include/lldb/Target/Process.h
===================================================================
--- lldb/include/lldb/Target/Process.h
+++ lldb/include/lldb/Target/Process.h
@@ -386,6 +386,13 @@
static ConstString &GetStaticBroadcasterClass();
+ static constexpr llvm::StringRef AttachSynchronousHijackListenerName =
+ "lldb.internal.Process.AttachSynchronous.hijack";
+ static constexpr llvm::StringRef LaunchSynchronousHijackListenerName =
+ "lldb.internal.Process.LaunchSynchronous.hijack";
+ static constexpr llvm::StringRef ResumeSynchronousHijackListenerName =
+ "lldb.internal.Process.ResumeSynchronous.hijack";
+
ConstString &GetBroadcasterClass() const override {
return GetStaticBroadcasterClass();
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148400.515137.patch
Type: text/x-patch
Size: 3517 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230419/957d4f81/attachment-0001.bin>
More information about the lldb-commits
mailing list