[lldb-dev] Compiling LLDB on Linux, certain types don't exist at all?

austin seipp as at hacks.yi.org
Tue Dec 14 11:04:31 PST 2010


Hello,

I currently have spent a little bit of time in the past day or two
trying to get the latest copy of LLDB compiling on Linux.

Most of the work has been pretty easy - stuff GCC is a little anal
about for the most part (like commas at the end of enumeration
declarations) or simple fixes (missing #includes).

Currently I can get a bit of stuff under source/ to build with these
simple changes such as API and Breakpoint, but when compiling Commands
I get the following error, and I have no idea where this comes from.

Background: I have checked out LLVM and clang, revision 121655 which
is the latest that LLDB works with. I checked them out into a normal
directory structure and then built llvm + clang in debug mode. I then
took a copy of the LLDB checkout, and put it under llvm/tools, so that
it could find all the needed LLVM headers and whatnot.

On Mac OS X, from what I can tell the build-llvm.pl scripts is called
to invoke an LLVM build, and the resulting shared libraries and clang
library are stuffed into the llvm.zip in the top level directory as
well as all the needed includes, which is checked into SVN, so for
most people they can just be unzipped and linked against when
building, without checking out clang/llvm manually, because lldb lags
behind llvm/clang trunk a little bit. I have not tried getting this
script working on linux, because I don't know the full usage of
build-llvm.pl or it's ramifications on the Mac OS X build (I have an
OS X machine at home, but I haven't built LLDB using it.) I've tried
to keep changes minimal. So I opted to just put lldb under an llvm
checkout at the specified revision, since it looked like the Makefile
was intended to be used that way.

After having a built llvm+clang, and then attempting to build lldb, I
get into source/Breakpoints when this occurs:

llvm[2]: Compiling CommandObjectCall.cpp for Debug+Asserts build
In file included from CommandObjectCall.h:17,
                 from CommandObjectCall.cpp:10:
/home/a/src/llvm-lldb_build/tools/lldb/source/Commands/../../include/lldb/Interpreter/CommandObject.h:117:
warning: type qualifiers ignored on function return type
CommandObjectCall.cpp: In constructor
‘lldb_private::CommandObjectCall::CommandObjectCall()’:
CommandObjectCall.cpp:115: error: no matching function for call to
‘lldb_private::CommandObject::CommandObject(const char [5], const char
[17], NULL, int)’
/home/a/src/llvm-lldb_build/tools/lldb/source/Commands/../../include/lldb/Interpreter/CommandObject.h:57:
note: candidates are:
lldb_private::CommandObject::CommandObject(lldb_private::CommandInterpreter&,
const char*, const char*, const char*, uint32_t)
/home/a/src/llvm-lldb_build/tools/lldb/source/Commands/../../include/lldb/Interpreter/CommandObject.h:27:
note:                 lldb_private::CommandObject::CommandObject(const
lldb_private::CommandObject&)
CommandObjectCall.cpp:126: error: ‘eArgTypeType’ was not declared in this scope
CommandObjectCall.cpp:132: error: ‘eArgTypePlain’ was not declared in this scope
CommandObjectCall.cpp:136: error: ‘eArgTypeArgType’ was not declared
in this scope
CommandObjectCall.cpp: In member function ‘virtual bool
lldb_private::CommandObjectCall::Execute(lldb_private::Args&,
lldb_private::CommandReturnObject&)’:
CommandObjectCall.cpp:171: error: ‘interpreter’ was not declared in this scope
CommandObjectCall.cpp:295: error: ‘ExecutionResults’ is not a member
of ‘lldb_private::Process’
CommandObjectCall.cpp:295: error: expected `;' before ‘return_status’
CommandObjectCall.cpp:299: error: ‘return_status’ was not declared in this scope
CommandObjectCall.cpp:302: error: ‘eExecutionSetupError’ is not a
member of ‘lldb_private::Process’
CommandObjectCall.cpp:308: error: ‘eExecutionCompleted’ is not a
member of ‘lldb_private::Process’
CommandObjectCall.cpp: At global scope:
CommandObjectCall.cpp:340: error: cannot convert ‘const char*’ to
‘lldb::CommandArgumentType’ in initialization
CommandObjectCall.cpp:340: error: cannot convert ‘const char*’ to
‘lldb::CommandArgumentType’ in initialization
CommandObjectCall.cpp:340: error: invalid conversion from ‘long int’
to ‘lldb::CommandArgumentType’
CommandObjectCall.cpp:340: error: cannot convert ‘const char*’ to
‘lldb::CommandArgumentType’ in initialization
CommandObjectCall.cpp:340: error: invalid conversion from ‘long int’
to ‘lldb::CommandArgumentType’
CommandObjectCall.cpp:340: error: invalid conversion from ‘long int’
to ‘lldb::CommandArgumentType’
make[2]: *** [/home/a/src/llvm-lldb_build/tools/lldb/source/Commands/Debug+Asserts/CommandObjectCall.o]
Error 1
make[2]: Leaving directory
`/home/a/src/llvm-lldb_build/tools/lldb/source/Commands'
make[1]: *** [all] Error 1
make[1]: Leaving directory `/home/a/src/llvm-lldb_build/tools/lldb/source'
make: *** [all] Error 1

I am not so worried about the incorrect call to the CommandObjectCall
constructor, what perplexes me more is the errors for missing things
like 'eArgTypeType.'

As far as I can tell, eArgTypeType exists nowhere at all in the
source. I have used ack to search every file in the LLVM+LLDB tree,
and the only reference to it is in CommandObjectCall; I don't even see
a declaration of it anywhere.

Googling it, the only result is this lldb-commits post:

http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20101004/000910.html

which introduces the usage of those types as you can see in the diff,
but not their actual definitions. The same can be said of
eArgTypePlain and eArgTypeArgType as well I believe.

Is the current LLDB trunk build known to be broken, or are these
values expected to be defined somewhere else? Generated as part of the
build, perhaps (although that seems highly unlikely)?

Any help would be appreciated; I'd like to get LLDB building easily on
linux so it can be ported to work fully, eventually. I am currently
hosting my changes in a git repository (horray for git-svn) to keep
track of the changes in a more granular fashion, and it is on my
github:

https://github.com/thoughtpolice/lldb/commits/linux

All development happens on this 'linux' branch for me. You can see the
changes I've made in the above commit listing. But I would recommend
nobody check it out using git yet - because git svn must rebase when
updating the repository to reflect the latest SVN changes (it rebases
your un-pushed changes on top of all the new incoming SVN changes,)
the history will be rewritten frequently and I will have to
continuously delete and re-push my branch to github, if people want to
see it publicly, and if I want to keep up with the latest LLDB HEAD
revision (or I'll have to date the branches or something, but that
would be a PITA too.) As a result, anybody who pulls from it will have
to frequently delete their branch that tracks my 'linux' branch and
re-pull it, since it will be rebased fairly frequently to keep up with
HEAD when it changes. This isn't ideal, but it's better than managing
the changes with multiple .patch files, and through github it is
easier to see what changes I have made, and get comments on what
should/should not be done. If anybody can give some better tips on how
to manage this, that would be great, because I'm a git user and not
really a subversion person.


Regards,
Austin




More information about the lldb-dev mailing list