Based on our IRC discussion I've updated PlatformLinux::GetSupportedArchitectureAtIndex to call the PlatformRemoteGdbServer::GetSupportedArchitectureAtIndex if connected remotely. This should return the correct thing for android (to fix those failing tests), and is also working for mac to linux.
Details
- Reviewers
clayborg ted tberghammer - Commits
- rGe49b8e065ea1: Call remote platform GetSupportedArchitectureAtIndex if connected to remote.
rLLDB237128: Call remote platform GetSupportedArchitectureAtIndex if connected to remote.
rL237128: Call remote platform GetSupportedArchitectureAtIndex if connected to remote.
Diff Detail
- Repository
- rL LLVM
Event Timeline
The concept looks good, but when PlatformLinux is the host and it runs on a non Linux OS then I think it shouldn't return any supported architecture. It was always broken but it would be a good point to address it as you change the full GetSupportedArchitectureAtIndex code.
source/Plugins/Platform/Linux/PlatformLinux.cpp | ||
---|---|---|
89–117 ↗ | (On Diff #25487) | I feel that this class is a bit over-design for this size of problem but I am fine with it if you prefer this way. |
Removed class and restored to comparison to index, and ensured that the returned arch is linux, otherwise return no supported archs.
Done, checks that the host arch is Linux before returning it, else we fall back to just returning false.
source/Plugins/Platform/Linux/PlatformLinux.cpp | ||
---|---|---|
89–117 ↗ | (On Diff #25487) | Removed and restored to an index check. |
Looks fine. You will want to merge this with the other PlatformLinux::GetSupportedArchitectureAtIndex() fixes where in the non-host mode we iterate through all supported architectures.
I think we don't have to merge that as we can query the supported architectures from PlatformGdbRemote. It wouldn't make too much sense for me to advertise support for an architecture which isn't (necessarily) supported by the remote target.
The problem with querying PlatformGDBRemote is it's only valid if you're connected to the remote platform. I'm trying to set the Platform when creating a target, so there is no connection yet.
Perhaps this:
if (m_remote_platform_sp) return m_remote_platform_sp->GetSupportedArchitectureAtIndex(idx, arch); <choose from list>
In that case we have to add some logic to distinguish between PlatformLinux and PlatformAndroid. Currently PlatfromAndroid uses the same GetSupportedArchitectureAtIndex function as PlatfrormLinux what will make the selection (practically) un-deterministic.
Yes Ted, merge your other changes in after the:
if (m_remote_platform_sp) return m_remote_platform_sp->GetSupportedArchitectureAtIndex(idx, arch);
so that we can select the platform when not connected.