host setting?

Afternoon,

When I try to set up lldb to run via a script, I get an error: “doesn’t contain any ‘host’ platform architectures: x86_64, i386”

I’m wondering what this means and where I can find more information about it? Thanks!

- Jared

What kind of OS are you running on? On several of our platforms, if you specify a directory rather than an exe (and it doesn’t happen to be a MacOSX .app or some kind of special bundle), it will give you that message.

I’m running on OS X, but I’m confused, I can give it a script right? So in this case if I do:

lldb it should load LLDB without a target but by adding any environment or other scripting variables right? So I know I can use an .lldbinit such as:

So that ~/binutils.py takes precedence.

script sys.path[:0] = [os.path.expanduser(’~’)]
script import binutils
command script add -f binutils.itob itob
command script add -f binutils.utob utob

But I thought I could feed LLDB a script as the arg as well, no??

  • Jared

You can tell lldb to run a script with -s, or a one line command with –o.

I have a wrapper script around lldb that does two things:

  • Set PYTHONHOME to point to a python we’re distributing; python installs on different linuxes vary, and python will do anything from issue a warning to crash if the python linked into lldb and the python modules don’t match

  • Load a script with target specific commands (such as “run a simulator, connect with gdb-remote, set a breakpoint at main and continue” or “get tlb info”)

#!/bin/sh

DIR=$(dirname $0)

export PYTHONHOME=$DIR/…

export HEXAGON_LLDB_HOME=$DIR/

exec $DIR/hexagon-lldb-3.5.0 -o “command script import $DIR/hexagon_utils.py” $*

Ted

You can tell lldb to run a script with -s, or a one line command with –o.

I have a wrapper script around lldb that does two things:

  • Set PYTHONHOME to point to a python we’re distributing; python installs on different linuxes vary, and python will do anything from issue a warning to crash if the python linked into lldb and the python modules don’t match

  • Load a script with target specific commands (such as “run a simulator, connect with gdb-remote, set a breakpoint at main and continue” or “get tlb info”)

#!/bin/sh

DIR=$(dirname $0)

export PYTHONHOME=$DIR/…

export HEXAGON_LLDB_HOME=$DIR/

exec $DIR/hexagon-lldb-3.5.0 -o “command script import $DIR/hexagon_utils.py” $*

Ted

Looks like you missed an "import sys"

script import sys; sys.path[:0] = [os.path.expanduser('~')]; import binutils
command script add -f binutils.itob itob
command script add -f binutils.utob utob

and an import os...

script import sys; import os; sys.path[:0] = [os.path.expanduser('~')]; import binutils
command script add -f binutils.itob itob
command script add -f binutils.utob utob

To avoid this though, you should really use "command script import" which will add the path to the file to the python path if it is needed and import the module for you:

command script import ~/binutils.py
command script add -f binutils.itob itob
command script add -f binutils.utob utob