Make lldb (lldb-server or debugserver) to get architecture information using getProcessTriple instead of getDefaultTargetTriple.
It seems getProcessTriple produces more accurate results - when cross-compiling for Android x86 (LLVM_TARGET_ARCH=X86) getDefaultTargetTriple yields 'x86_64--linux-android' whereas getProcessTriple() returns a valid 'i386--linux-android' which is compatible with inferiors' architecture.
Details
- Reviewers
vharron clayborg tberghammer
Diff Detail
Event Timeline
Maybe I'm confusing what you're trying to do, but HostInfoBase::GetArchitecture() is supposed to return the triple of the host, by definition. If you want something that is compatible with a remote, you need a different function, maybe in Platform?
I think i get it, when you said inferior it made me think you were trying
to return the triple of the remote.
Anyway, this change looks correct to me, getProcessTriple() returns
LLVM_HOST_TRIPLE which is defined as "The triple of the process that LLVM
will run in", which matches what GetArchitecture should return
Sorry for confusion - I mentioned inferior here as rather a test case that allowed me to verify this change works properly on Android.
Anyway, this change looks correct to me, getProcessTriple() returns
LLVM_HOST_TRIPLE which is defined as "The triple of the process that LLVM
will run in", which matches what GetArchitecture should return
AFFECTED FILES
/lldb/trunk/source/Host/common/HostInfoBase.cpp
USERS
ovyalov (Author)