mib added a comment.

In D148395#4287673 <https://reviews.llvm.org/D148395#4287673>, @bulbazord wrote:

> In D148395#4285017 <https://reviews.llvm.org/D148395#4285017>, @mib wrote:
>
>> In D148395#4270508 <https://reviews.llvm.org/D148395#4270508>, @bulbazord 
>> wrote:
>>
>>> Creating a ProcessAttachInfo from a ProcessLaunchInfo with this change 
>>> means they'll have different listeners. Is that ProcessLaunchInfo kept 
>>> around for any other reason? Or is it just made to create the 
>>> ProcessAttachInfo? This seems like a reasonable move to me, but I'm not 
>>> sure how LaunchInfo and AttachInfo might interact.
>>
>> @bulbazord Not sure what you mean ... We need to convert to the 
>> `ProcessLaunchInfo` into a `ProcessAttachInfo` when the user ask use to 
>> launch a process but we end up asking the platform to do the launch after 
>> which we attach to the process. In both cases, we use the default listener 
>> (the debugger listener if the user didn't provide a custom listener).
>
> What I'm not sure about is that the `ProcessAttachInfo` constructor we're 
> using takes a `ProcessLaunchInfo` as an argument and fills in its fields with 
> it. It used to be that `ProcessAttachInfo` would get its Listener and 
> HijackListener from the `ProcessLaunchInfo` passed in. Now, they could have 
> different Listeners and HijackListeners. When we create a `ProcessAttachInfo` 
> from a `ProcessLaunchInfo`, is it expected that these 2 things will diverge 
> in that way? Do we use the `ProcessLaunchInfo` that we build the 
> `ProcessAttachInfo` with in any other way?

We had to do that previously because `ProcessLaunchInfo` and 
`ProcessAttachInfo` were not related (they were not derived from the same base 
class). With this patch, I hoisted the the `m_listener_sp` and 
`m_hijack_listener_sp` with their getters and setters into the `ProcessInfo` 
class from which both the `ProcessAttachInfo` and `ProcessLaunchInfo` are 
derived. So by calling the copy constructor for ProcessInfo (see inline 
comment), that should also copy the listener and hijack listener from the 
process launch info into the process attach info.



================
Comment at: lldb/include/lldb/Target/Process.h:122
         m_async(false) {
     ProcessInfo::operator=(launch_info);
     SetProcessPluginName(launch_info.GetProcessPluginName());
----------------
Because we moved `m_listener_sp` and `m_hijack_listener_sp` to `ProcessInfo` 
and since both `Process{Attach,Launch}Info` are derived from that class, this 
should also copy the listeners.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148395/new/

https://reviews.llvm.org/D148395

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to