jasonmolenda wrote:

I'm still a little confused by why this is needed.  `BuildDynamicRegisterInfo` 
should call qProcessInfo itself; I think you're working around some bug in the 
way `BuildDynamicRegisterInfo` determines the arch by moving it to the end of 
this method.  I'm sure it works, but I'm genuinely curious why this block in 
`BuildDynamicRegisterInfo,`

```
   471    const ArchSpec &target_arch = GetTarget().GetArchitecture();
   472    const ArchSpec &remote_host_arch = m_gdb_comm.GetHostArchitecture();
   473    const ArchSpec &remote_process_arch = 
m_gdb_comm.GetProcessArchitecture();
   474  
   475    // Use the process' architecture instead of the host arch, if 
available
   476    ArchSpec arch_to_use;
   477    if (remote_process_arch.IsValid())
   478      arch_to_use = remote_process_arch;
   479    else
   480      arch_to_use = remote_host_arch;
   481  
   482    if (!arch_to_use.IsValid())
   483      arch_to_use = target_arch;
   484  
   485    llvm::Error register_info_err = GetGDBServerRegisterInfo(arch_to_use);
```

doesn't work.  On my macOS system, `m_gdb_comm.GetProcessArchitecture()` issues 
a `qProcessInfo` and gets a correct ArchSpec from that.  That must be failing 
on the Windows system, and we fall back to using the ArchSpec from `qHostInfo` 
(`m_gdb_comm.GetHostArchitecture()`) which is also incorrect?  And we don't 
have a Target arch yet, which is fine, we haven't loaded a binary yet.

https://github.com/llvm/llvm-project/pull/203498
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to