[lldb-dev] Hello, I have Questions, about lldb:(

Malea, Daniel daniel.malea at intel.com
Sun Oct 14 19:01:30 PDT 2012


Hi Chip,

You made my day with the build system patch! It looks good to me, however, I’m not an expert on the SWIG scripts..so maybe someone else who is more familiar with the old source/Interpreter/Makefile can take a look too?


After applying it, I noticed a small problem on Linux with the generation of the _lldb.so symlink. On Ubuntu 11.10 (with GNU Make 3.81) I did a clean out-of-tree build and ended up with the following files:

[OK]     build/Debug+Asserts/lib/liblldb.so
[BROKEN] build/Debug+Asserts/lib/python2.7/site-packages/lldb/_lldb.so --> ../../liblldb.so

To fix the problem, either the symlink needs to point 3 (instead of 2) directories up, or the it needs to be located one directory up.

However, to keep PYTHONPATH simple, I recommend the latter option, since the former would require adding two directories to the PYTHONPATH (“site-packages” as well as “lldb”). I am attaching a patch (can be applied on top of yours) that places the _lldb.so symlink in “site-packages” instead of “lldb”.

Otherwise, your patch looks great. I can confirm no test regressions on Linux (but a couple of fixes!). I tried it out on Mac OS X too, and noticed no build problems on 10.8.

Cheers,
Dan


From: Charles Davis [mailto:cdavis5x at gmail.com]
Sent: Sunday, October 14, 2012 3:30 PM
To: Malea, Daniel
Cc: Kyung su Kim; lldb-dev at cs.uiuc.edu
Subject: Re: [lldb-dev] Hello, I have Questions, about lldb:(


On Oct 14, 2012, at 11:21 AM, Malea, Daniel wrote:


The instructions posted on the build page are slightly out-of-date. LLDB trunk builds against LLVM and Clang trunk, and not a pinned revision as the docs mention. If you’re using older revisions, you should update all your working copies to trunk.

The error you’re seeing with importing _lldb is due to a problem in one of the Makefiles. Python requires an _lldb.so symlink (pointing to liblldb.so) on the PYTHONPATH in order for the import to work correctly. I am working on a cross-platform way to generate it with the Makefiles,
I have a patch for you right now.

I originally wrote this patch so I could build with Makefiles on Darwin. (For the record, I have commit access, so I can commit this once approved).

I'll note that with this change, the liblldbInterpreter.a Makefile is *radically* simpler.

Summary of changes:
- Stop assuming that "Darwin" means "being built by Xcode". There's a slight chance this could break Xcode builds, but I carefully reworked the argument parsing in the scripts so that Xcode builds don't need to change. Apple devs: if this patch breaks Xcode builds, feel free to scream loudly at me so I can go fix it. ;)
- Use the finish script to install, too.
- Make swig auto-generate dependencies if DISABLE_AUTO_DEPENDENCIES is off (like before).
- Ask python where to put site-specific files using the distutils.sysconfig.get_python_lib() function. (Tests' Makefile was changed to do this, too.) This is what you're "supposed" to do, but I avoided doing that when I first wrote the Makefile because I thought that not all python installs would have it. I hope I was wrong...
- Fix out-of-tree builds. For out-of-tree builds, you have to pass to the edit-swig-python-wrapper-file.py script the directory where swig put the LLDBWrapPython.cpp file, or it won't be able to find it. The Makefiles were doing this before Filipe went in and started this.
- Completely eliminate duplication of logic between Makefile and Xcode builds. Radically simplify the Interpreter Makefile; now there aren't two versions of the same rule (one of which wasn't even being maintained!).

I've tested this patch with several self-host builds of Clang, and I have had no trouble building, installing, or running LLDB.

Chip


Best of luck,
Dan

From: lldb-dev-bounces at cs.uiuc.edu<mailto:lldb-dev-bounces at cs.uiuc.edu> [mailto:lldb-dev-bounces at cs.uiuc.edu]<mailto:[mailto:lldb-dev-bounces at cs.uiuc.edu]> On Behalf Of Kyung su Kim
Sent: Saturday, October 13, 2012 6:20 PM
To: lldb-dev at cs.uiuc.edu<mailto:lldb-dev at cs.uiuc.edu>
Subject: [lldb-dev] Hello, I have Questions, about lldb:(

Hello

I'm a university student in korea

I have a project in my school, that related dissembleing arm machine code

( I'll use python script language to my project)

so I found this llvm project and i tried to build llvm

but I faced some problems..

(my compilation enviroment is Ubuntu Linux 10.x )

I saw http://lldb.llvm.org/build.html , and worked step by step

first problem is that the llvm_revision doesn't update,..

typed as I saw in manual "svn update -r 127682" ,doesn't work properly..

the result is as below..
-----------------------------------------------

root at kaspyx:~/llvm/tools# grep -m 1 llvm_revision lldb/scripts/build-llvm.pl<http://build-llvm.pl>
our $llvm_revision = "127600";

----------------------------------------------
it looks some guess.. but i wonder why llvm_revision version doesn't update is..

why the revision is 127600?? i want update to 127682..

it's my guess...

most of all, lldb doesn't work..

i compiled llvm, lldb, clang... step by step, referenced manual..

but lldb.py doesn't work..

There are compiled binaries in my directory.. ( like "lldb", "lldb.py" ..etc)

but When I typed for using lldb python library, I saw error strings

-----------------------------------------

root at kaspyx:~/build2/Debug+Asserts/bin# python lldb.py

Traceback (most recent call last):
  File "lldb.py", line 25, in <module>
    _lldb = swig_import_helper()
  File "lldb.py", line 17, in swig_import_helper
    import _lldb
ImportError: No module named _lldb

-----------------------------------------

I couldn't find _lldb module.. ,

problems are looks relate llvm_revision.

I don't know what should i do..

am i compiled properly??

thanks ....


_______________________________________________
lldb-dev mailing list
lldb-dev at cs.uiuc.edu<mailto:lldb-dev at cs.uiuc.edu>
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20121015/8a31a22b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fixup_lldb_symlink.patch
Type: application/octet-stream
Size: 448 bytes
Desc: fixup_lldb_symlink.patch
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20121015/8a31a22b/attachment.obj>


More information about the lldb-dev mailing list