LLDB sets process arch to *-apple-macosx in doubt

Hello again,

LLDB says I need a disassembler plugin to get disassembly. Since PowerPC is a supported LLVM target, I figured DisassemblerLLVMC would do it for me. However, it turns out that LLDB thinks I'm a powerpc-apple-macosx target, even though I'm not pretending that (I'm saying I'm a powerpc-unknown-unknown); and LLVM won't produce a Target for that triple.

This seems to happen because GDBRemoteCommunicationClient::GetCurrentProcessInfo() will eventually do `m_process_arch.SetArchitecture(eArchTypeMachO, cpu, sub)`, and ArchSpec will set the OS to Mac OS X and the vendor to Apple if it sees that the arch type is Mach-O. Interestingly, m_host_arch stays untouched.

I suppose the triple is kind of a big deal to get the right plugins, but I already have an ABI plugin and I wouldn't really mind throwing in the disassembler I already have, and I'm not sure which other plugins I'll find myself missing.

What's the suggested course of action? Fix the process triple and hope LLVM likes powerpc-unknown-unknown better? Bring in my disassembler? Fix the process triple and bring in my disassembler anyways?

Félix

I don't believe we enable the PowerPC targets in LLDB. You will need to add it in the following file:

http://llvm.org/svn/llvm-project/lldb/trunk/scripts/build-llvm.pl

I think the only line you will need to change is:

            my $lldb_configuration_options = "--enable-targets=x86_64,arm $common_configure_options $llvm_config_href->{configure_options}";

Note only "x86_64" and "arm" targets are enabled.

This should be enough to compile in PowerPC support.

Greg

Heh, just as I was done porting my disassembler over. :slight_smile:

Do I need to do anything about the target triple, or will it be happy simply to see the PowerPC part?

Félix

Heh, just as I was done porting my disassembler over. :slight_smile:

Do I need to do anything about the target triple, or will it be happy simply to see the PowerPC part?

I believe it will be happy with any vendor and os.