[lldb] [gdb-remote] Try using <architecture/> for remote arch unconditionally
authorMichał Górny <mgorny@moritz.systems>
Sat, 4 Sep 2021 13:19:39 +0000 (15:19 +0200)
committerMichał Górny <mgorny@moritz.systems>
Thu, 16 Sep 2021 08:23:31 +0000 (10:23 +0200)
commit66249323d25f6db1dc76bd9fb3b9eebe436519a6
tree99ae19c18aef893b86be358ec1b66c506a78eb0a
parenta4e437e3c959ac0cb2edb733d081edc95a4fff22
[lldb] [gdb-remote] Try using <architecture/> for remote arch unconditionally

Try determining the process architecture from <architecture/> tag
unconditionally, rather than for very specific cases.  Generic gdbserver
implementations do not support LLDB-specific packets used to determine
the process architecture, therefore this fallback is necessary to
support architecture-specific behavior on these targets.  Rather than
maintaining a mapping of all known architectures, just try mapping
the GDB values into triplets, as that is going to work most of the time.

This change is confirmed to fix LLDB against gdbserver when debugging
i386 and aarch64 executables.

Differential Revision: https://reviews.llvm.org/D109272
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/test/API/functionalities/gdb_remote_client/TestGDBServerTargetXML.py
lldb/test/API/functionalities/gdb_remote_client/basic_eh_frame-i386.yaml [new file with mode: 0644]