[Lldb-commits] [lldb] r180830 - Add an option to resume a suspended task.
Jim Ingham
jingham at apple.com
Tue Apr 30 16:43:52 PDT 2013
Author: jingham
Date: Tue Apr 30 18:43:52 2013
New Revision: 180830
URL: http://llvm.org/viewvc/llvm-project?rev=180830&view=rev
Log:
Add an option to resume a suspended task.
Modified:
lldb/trunk/tools/darwin-threads/examine-threads.c
Modified: lldb/trunk/tools/darwin-threads/examine-threads.c
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/darwin-threads/examine-threads.c?rev=180830&r1=180829&r2=180830&view=diff
==============================================================================
--- lldb/trunk/tools/darwin-threads/examine-threads.c (original)
+++ lldb/trunk/tools/darwin-threads/examine-threads.c Tue Apr 30 18:43:52 2013
@@ -274,11 +274,12 @@ main (int argc, char **argv)
int arg_is_procname = 0;
int do_loop = 0;
int verbose = 0;
+ int resume_when_done = 0;
mach_port_t mytask = mach_task_self ();
- if (argc != 2 && argc != 3 && argc != 4)
+ if (argc != 2 && argc != 3 && argc != 4 && argc != 5)
{
- printf ("Usage: tdump [-l] [-v] pid/procname\n");
+ printf ("Usage: tdump [-l] [-v] [-r] pid/procname\n");
exit (1);
}
@@ -291,6 +292,8 @@ main (int argc, char **argv)
do_loop = 1;
if (strcmp (argv[i], "-v") == 0)
verbose = 1;
+ if (strcmp (argv[i], "-r") == 0)
+ resume_when_done = 1;
i++;
}
}
@@ -467,6 +470,10 @@ main (int argc, char **argv)
nanosleep (rqtp, NULL);
} while (do_loop);
+ kern_return_t err = task_resume (task);
+ if (err != KERN_SUCCESS)
+ printf ("Error resuming task: %d.", err);
+
vm_deallocate (mytask, (vm_address_t) task, sizeof (task_t));
free ((void *) process_name);
More information about the lldb-commits
mailing list