When detaching from a debugged process any breakpoint sites need to be
cleared before detaching so that they don't generate uncaught SIGTRAPs.
Target::CleanupProcess() seems to do the necessary cleanup so call this
from the ProcessLinux::WillDetach() method.
If this is the right fix and if it applies to other OSes as well maybe the
cleanup call should be moved into an earlier Process class in the hierarchy.
Thanks,
Andrew
diff --git a/source/Plugins/Process/Linux/ProcessLinux.cpp b/source/Plugins/Process/Linux/ProcessLinux.cpp
index dae14d1..37934dd 100644
--- a/source/Plugins/Process/Linux/ProcessLinux.cpp
+++ b/source/Plugins/Process/Linux/ProcessLinux.cpp
@@ -137,6 +137,13 @@ ProcessLinux::EnablePluginLogging(Stream *strm, Args &command)
}
Error
+ProcessLinux::WillDetach()
+{
+ GetTarget().CleanupProcess();
+ return Error();
+}
+
+Error
ProcessLinux::DoDetach(bool keep_stopped)
{
Error error;
diff --git a/source/Plugins/Process/Linux/ProcessLinux.h b/source/Plugins/Process/Linux/ProcessLinux.h
index 9f39ccc..94941e0 100644
--- a/source/Plugins/Process/Linux/ProcessLinux.h
+++ b/source/Plugins/Process/Linux/ProcessLinux.h
@@ -55,6 +55,9 @@ public:
lldb_private::FileSpec *core_file);
virtual lldb_private::Error
+ WillDetach ();
+
+ virtual lldb_private::Error
DoDetach(bool keep_stopped);
virtual bool
_______________________________________________
lldb-dev mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev