[Lldb-commits] [PATCH] Close terminal after LaunchInTerminalTestCase test

Ilia K ki.stfu at gmail.com
Tue Feb 10 02:57:33 PST 2015


Remove close-after-exit debugger's option (use eLaunchFlagCLoseTTYOnExit instead); Update test


http://reviews.llvm.org/D7468

Files:
  include/lldb/lldb-enumerations.h
  source/Host/macosx/Host.mm
  test/functionalities/tty/TestTerminal.py

Index: include/lldb/lldb-enumerations.h
===================================================================
--- include/lldb/lldb-enumerations.h
+++ include/lldb/lldb-enumerations.h
@@ -52,6 +52,7 @@
         eLaunchFlagDetachOnError = (1u << 9),     ///< If set, then the client stub should detach rather than killing the debugee
                                                    ///< if it loses connection with lldb.
         eLaunchFlagGlobArguments  = (1u << 10),       ///< Glob arguments without going through a shell
+        eLaunchFlagCloseTTYOnExit = (1u << 11),    ///< Close the open TTY on exit
     } LaunchFlags;
         
     //----------------------------------------------------------------------
Index: source/Host/macosx/Host.mm
===================================================================
--- source/Host/macosx/Host.mm
+++ source/Host/macosx/Host.mm
@@ -471,6 +471,8 @@
         command.Printf(" '%s'", exe_path);
     }
     command.PutCString (" ; echo Process exited with status $?");
+    if (launch_info.GetFlags().Test(lldb::eLaunchFlagCloseTTYOnExit))
+        command.PutCString (" ; exit");
     
     StreamString applescript_source;
 
Index: test/functionalities/tty/TestTerminal.py
===================================================================
--- test/functionalities/tty/TestTerminal.py
+++ test/functionalities/tty/TestTerminal.py
@@ -30,7 +30,7 @@
         exe = "/bin/ls"
         target = self.dbg.CreateTarget(exe)
         launch_info = lldb.SBLaunchInfo(["-lAF", "/tmp/"])
-        launch_info.SetLaunchFlags(lldb.eLaunchFlagLaunchInTTY)
+        launch_info.SetLaunchFlags(lldb.eLaunchFlagLaunchInTTY | lldb.eLaunchFlagCloseTTYOnExit)
         error = lldb.SBError()
         process = target.Launch (launch_info, error)
         self.assertTrue(error.Success(), "Make sure launch happened successfully in a terminal window")

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7468.19656.patch
Type: text/x-patch
Size: 1887 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150210/15cba2d2/attachment.bin>


More information about the lldb-commits mailing list