[lldb-dev] porting lldb for a VLIW architecture

Greg Clayton gclayton at apple.com
Wed Sep 12 14:35:02 PDT 2012

> I fixed this. Actually there was a problem with the e_machine name
> with my elf file.
> And now on running the lldb,
> lldb --arch vliw /home/chandra/app01/workplace/app.elf
> Current executable set to '/home/chandra/app01/workplace/app.elf' (vliw).
> (lldb) target list
> Current targets:
> * target #0: /home/chandra/app01/workplace/app.elf (
> arch=vliw-pc-linux-gnu, platform=localhost )
> I see the platform selected is being shown as "localhost". I hope the
> platform selected should be "PlatformLinux".

> And I face error on connecting the lldb with the simulator.
> (lldb) process connect connect://localhost:51000
> error: remote connections are not supported

This is probably because you have the PlatformLinux selected and it is trying to connect to the current host linux in order to debug your program.

If you don't have any specific platform needs (no special needs in locating files, executables, upload/download files, etc) then you probably want no platform plug-in selected, or make one up for VLIW. You are having trouble launching because the local linux platform is selected and it is trying to debug your program on the current linux host. 

When you create a target TargetList::CreateTarget() is called. It will try and find an platform that goes with your executable and the triple you specified. You want to step through this code and make sure that when "PlatformLinux::CreateInstance()" is called, that it doesn't claim it is the appropriate platform for your executable.

To work around the issues above, first you want to launch lldb (or "target create") with a full triple:

lldb --arch vliw-unknown-unknown /home/chandra/app01/workplace/app.elf

Then you can specify the process plug-in to use:

(lldb) process connect --plugin gdb-remote connect://localhost:51000

If you specify the "gdb-remote" plug-in by name, you won't end up trying to launch with the "ProcessLinux" plug-in which doesn't support remote connections. It will use the ProcessGDBRemote plugin.

Let me know if this help/works.

Greg Clayton

More information about the lldb-dev mailing list