[Lldb-commits] [lldb] r144918 - in /lldb/trunk/source/Host: common/Host.cpp macosx/Host.mm
Greg Clayton
gclayton at apple.com
Thu Nov 17 11:41:57 PST 2011
Author: gclayton
Date: Thu Nov 17 13:41:57 2011
New Revision: 144918
URL: http://llvm.org/viewvc/llvm-project?rev=144918&view=rev
Log:
Now that I fixed the uninitialized callback problem, I can enable GCD pid
monitoring on darwin in the host layer.
Modified:
lldb/trunk/source/Host/common/Host.cpp
lldb/trunk/source/Host/macosx/Host.mm
Modified: lldb/trunk/source/Host/common/Host.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Host.cpp?rev=144918&r1=144917&r2=144918&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/Host.cpp (original)
+++ lldb/trunk/source/Host/common/Host.cpp Thu Nov 17 13:41:57 2011
@@ -57,7 +57,7 @@
using namespace lldb_private;
-#if 1 // !defined (__APPLE__)
+#if !defined (__APPLE__)
struct MonitorInfo
{
lldb::pid_t pid; // The process ID to monitor
Modified: lldb/trunk/source/Host/macosx/Host.mm
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/Host.mm?rev=144918&r1=144917&r2=144918&view=diff
==============================================================================
--- lldb/trunk/source/Host/macosx/Host.mm (original)
+++ lldb/trunk/source/Host/macosx/Host.mm Thu Nov 17 13:41:57 2011
@@ -1421,8 +1421,6 @@
return error;
}
-#if 0
-
lldb::thread_t
Host::StartMonitoringChildProcess (Host::MonitorChildProcessCallback callback,
void *callback_baton,
@@ -1434,29 +1432,29 @@
if (monitor_signals)
mask |= DISPATCH_PROC_SIGNAL;
+ LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_HOST | LIBLLDB_LOG_PROCESS));
+
dispatch_source_t source = ::dispatch_source_create (DISPATCH_SOURCE_TYPE_PROC,
pid,
mask,
::dispatch_get_global_queue (DISPATCH_QUEUE_PRIORITY_DEFAULT,0));
- printf ("Host::StartMonitoringChildProcess (callback=%p, baton=%p, pid=%i, monitor_signals=%i) source = %p\n",
- callback,
- callback_baton,
- (int)pid,
- monitor_signals,
- source);
+ if (log)
+ log->Printf ("Host::StartMonitoringChildProcess (callback=%p, baton=%p, pid=%i, monitor_signals=%i) source = %p\n",
+ callback,
+ callback_baton,
+ (int)pid,
+ monitor_signals,
+ source);
if (source)
{
::dispatch_source_set_cancel_handler (source, ^{
- printf ("::dispatch_source_set_cancel_handler (source=%p, ^{...\n", source);
::dispatch_release (source);
});
::dispatch_source_set_event_handler (source, ^{
- printf ("::dispatch_source_set_event_handler (source=%p, ^{...\n", source);
-
int status= 0;
int wait_pid = 0;
bool cancel = false;
@@ -1494,7 +1492,6 @@
status_cstr = "???";
}
- LogSP log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS));
if (log)
log->Printf ("::waitpid (pid = %i, &status, 0) => pid = %i, status = 0x%8.8x (%s), signal = %i, exit_status = %i",
pid,
@@ -1509,7 +1506,6 @@
if (exited)
{
- printf ("::dispatch_source_set_event_handler (source=%p, ^{... dispatch_source_cancel(source);\n", source);
::dispatch_source_cancel(source);
}
}
@@ -1519,6 +1515,3 @@
}
return thread;
}
-
-
-#endif
More information about the lldb-commits
mailing list