summaryrefslogtreecommitdiffstats
path: root/lldb/test/functionalities
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2015-05-28 10:28:34 +0000
committerPavel Labath <labath@google.com>2015-05-28 10:28:34 +0000
commitb9d6e8993133994d7f1462b0caec10da77b4c974 (patch)
treeb9331c2180e893da66b3a37bb87af1a3ef473a39 /lldb/test/functionalities
parent73570f43234281e34ed0330c981444daecefb992 (diff)
downloadbcm5719-llvm-b9d6e8993133994d7f1462b0caec10da77b4c974.tar.gz
bcm5719-llvm-b9d6e8993133994d7f1462b0caec10da77b4c974.zip
Move prctl call in TestChangeProcessGroup to the child
I was hoping the enable-tracing flag will be inherited from the parent. It is not. llvm-svn: 238408
Diffstat (limited to 'lldb/test/functionalities')
-rw-r--r--lldb/test/functionalities/process_group/main.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/lldb/test/functionalities/process_group/main.c b/lldb/test/functionalities/process_group/main.c
index 5de63db50df..c730c629e8b 100644
--- a/lldb/test/functionalities/process_group/main.c
+++ b/lldb/test/functionalities/process_group/main.c
@@ -10,19 +10,6 @@ volatile int release_child_flag = 0;
int main(int argc, char const *argv[])
{
-#if defined(__linux__)
- // Immediately enable any ptracer so that we can allow the stub attach
- // operation to succeed. Some Linux kernels are locked down so that
- // only an ancestor process can be a ptracer of a process. This disables that
- // restriction. Without it, attach-related stub tests will fail.
-#if defined(PR_SET_PTRACER) && defined(PR_SET_PTRACER_ANY)
- // For now we execute on best effort basis. If this fails for
- // some reason, so be it.
- const int prctl_result = prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY, 0, 0, 0);
- (void) prctl_result;
-#endif
-#endif
-
pid_t child = fork();
if (child == -1)
{
@@ -74,6 +61,19 @@ int main(int argc, char const *argv[])
}
else
{ // child
+#if defined(__linux__)
+ // Immediately enable any ptracer so that we can allow the stub attach
+ // operation to succeed. Some Linux kernels are locked down so that
+ // only an ancestor process can be a ptracer of a process. This disables that
+ // restriction. Without it, attach-related stub tests will fail.
+#if defined(PR_SET_PTRACER) && defined(PR_SET_PTRACER_ANY)
+ // For now we execute on best effort basis. If this fails for
+ // some reason, so be it.
+ const int prctl_result = prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY, 0, 0, 0);
+ (void) prctl_result;
+#endif
+#endif
+
while (! release_child_flag) // Wait for debugger to attach
sleep(1);
OpenPOWER on IntegriCloud