<div dir="ltr">Sorry, this must have slipped in by accident with clang-format or with my IDE's auto formatter.</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 12, 2014 at 4:00 PM,  <span dir="ltr"><<a href="mailto:jingham@apple.com" target="_blank">jingham@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hey Zachary,<br>
<br>
at some point I'll finish up the "lldb coding conventions" document, but till I get around to the full thing, one of the bullet items it will have is not to use this form of listing the initializations:<br>
<span class=""><br>
> +    : ProcessInfo()<br>
> +    , m_working_dir()<br>
> +    , m_plugin_name()<br>
> +    , m_shell()<br>
> +    , m_flags(launch_flags)<br>
> +    , m_file_actions()<br>
> +    , m_pty(new lldb_utility::PseudoTerminal)<br>
<br>
</span>Please use the form that you find pretty much everywhere in lldb, like this code was prior to this change.<br>
<br>
Thanks,<br>
<br>
Jim<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
> On Sep 12, 2014, at 3:38 PM, Zachary Turner <<a href="mailto:zturner@google.com">zturner@google.com</a>> wrote:<br>
><br>
> Author: zturner<br>
> Date: Fri Sep 12 17:38:39 2014<br>
> New Revision: 217714<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=217714&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=217714&view=rev</a><br>
> Log:<br>
> Make ProcessLaunchInfo copyable.<br>
><br>
> Modified:<br>
>    lldb/trunk/include/lldb/Target/ProcessLaunchInfo.h<br>
>    lldb/trunk/source/Target/ProcessLaunchInfo.cpp<br>
><br>
> Modified: lldb/trunk/include/lldb/Target/ProcessLaunchInfo.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ProcessLaunchInfo.h?rev=217714&r1=217713&r2=217714&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ProcessLaunchInfo.h?rev=217714&r1=217713&r2=217714&view=diff</a><br>
> ==============================================================================<br>
> --- lldb/trunk/include/lldb/Target/ProcessLaunchInfo.h (original)<br>
> +++ lldb/trunk/include/lldb/Target/ProcessLaunchInfo.h Fri Sep 12 17:38:39 2014<br>
> @@ -169,7 +169,7 @@ namespace lldb_private<br>
>         lldb_utility::PseudoTerminal &<br>
>         GetPTY ()<br>
>         {<br>
> -            return m_pty;<br>
> +            return *m_pty;<br>
>         }<br>
><br>
>         lldb::ListenerSP<br>
> @@ -212,7 +212,7 @@ namespace lldb_private<br>
>         std::string m_shell;<br>
>         Flags m_flags;       // Bitwise OR of bits from lldb::LaunchFlags<br>
>         std::vector<FileAction> m_file_actions; // File actions for any other files<br>
> -        lldb_utility::PseudoTerminal m_pty;<br>
> +        std::shared_ptr<lldb_utility::PseudoTerminal> m_pty;<br>
>         uint32_t m_resume_count; // How many times do we resume after launching<br>
>         Host::MonitorChildProcessCallback m_monitor_callback;<br>
>         void *m_monitor_callback_baton;<br>
><br>
> Modified: lldb/trunk/source/Target/ProcessLaunchInfo.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ProcessLaunchInfo.cpp?rev=217714&r1=217713&r2=217714&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ProcessLaunchInfo.cpp?rev=217714&r1=217713&r2=217714&view=diff</a><br>
> ==============================================================================<br>
> --- lldb/trunk/source/Target/ProcessLaunchInfo.cpp (original)<br>
> +++ lldb/trunk/source/Target/ProcessLaunchInfo.cpp Fri Sep 12 17:38:39 2014<br>
> @@ -31,7 +31,7 @@ ProcessLaunchInfo::ProcessLaunchInfo ()<br>
>     m_shell (),<br>
>     m_flags (0),<br>
>     m_file_actions (),<br>
> -    m_pty (),<br>
> +    m_pty (new lldb_utility::PseudoTerminal),<br>
>     m_resume_count (0),<br>
>     m_monitor_callback (NULL),<br>
>     m_monitor_callback_baton (NULL),<br>
> @@ -41,19 +41,19 @@ ProcessLaunchInfo::ProcessLaunchInfo ()<br>
> }<br>
><br>
> ProcessLaunchInfo::ProcessLaunchInfo(const char *stdin_path, const char *stdout_path, const char *stderr_path,<br>
> -                                     const char *working_directory, uint32_t launch_flags) :<br>
> -    ProcessInfo(),<br>
> -    m_working_dir(),<br>
> -    m_plugin_name(),<br>
> -    m_shell(),<br>
> -    m_flags(launch_flags),<br>
> -    m_file_actions(),<br>
> -    m_pty(),<br>
> -    m_resume_count(0),<br>
> -    m_monitor_callback(NULL),<br>
> -    m_monitor_callback_baton(NULL),<br>
> -    m_monitor_signals(false),<br>
> -    m_hijack_listener_sp()<br>
> +                                     const char *working_directory, uint32_t launch_flags)<br>
> +    : ProcessInfo()<br>
> +    , m_working_dir()<br>
> +    , m_plugin_name()<br>
> +    , m_shell()<br>
> +    , m_flags(launch_flags)<br>
> +    , m_file_actions()<br>
> +    , m_pty(new lldb_utility::PseudoTerminal)<br>
> +    , m_resume_count(0)<br>
> +    , m_monitor_callback(NULL)<br>
> +    , m_monitor_callback_baton(NULL)<br>
> +    , m_monitor_signals(false)<br>
> +    , m_hijack_listener_sp()<br>
> {<br>
>     if (stdin_path)<br>
>     {<br>
> @@ -304,8 +304,8 @@ ProcessLaunchInfo::FinalizeFileActions (<br>
>                 AppendOpenFileAction(STDERR_FILENO, path, false, true);<br>
><br>
>             if (default_to_use_pty && (!in_path || !out_path || !err_path)) {<br>
> -                if (m_pty.OpenFirstAvailableMaster(O_RDWR| O_NOCTTY, NULL, 0)) {<br>
> -                    const char *slave_path = m_pty.GetSlaveName(NULL, 0);<br>
> +                if (m_pty->OpenFirstAvailableMaster(O_RDWR| O_NOCTTY, NULL, 0)) {<br>
> +                    const char *slave_path = m_pty->GetSlaveName(NULL, 0);<br>
><br>
>                     if (!in_path) {<br>
>                         AppendOpenFileAction(STDIN_FILENO, slave_path, true, false);<br>
><br>
><br>
> _______________________________________________<br>
> lldb-commits mailing list<br>
> <a href="mailto:lldb-commits@cs.uiuc.edu">lldb-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits</a><br>
<br>
</div></div></blockquote></div><br></div>