[Lldb-commits] [PATCH] Make llgs build on Android. No functionality changes.

Greg Clayton clayborg at gmail.com
Thu Sep 25 16:45:05 PDT 2014


Yikes, I really don't like the "#ifndef __ANDROID__" stuff everywhere. That will encourage others to do the same kind of thing. We should make a LLDB_NO_EDITLINE or some other define.

the IOHandlerEditline class does have support for non-editline based input. It uses this when the input file handle isn't interactive. You should actually leave the IOHandlerEditline class in and use the LLDB_NO_EDITLINE define to leave the actual editline based code out and always for it to use the file descriptor methods.

then the changes in files that were disabling the IOHandlerEditline are not needed.


size_t
FileSpec::ResolvePartialUsername (const char *partial_name, StringList &matches)
{
#if defined(LLDB_CONFIG_TILDE_RESOLVES_TO_USER) && !defined(__ANDROID__)
    size_t extant_entries = matches.GetSize();
    
    setpwent();
This:

#ifdef __ANDROID__ 
// Android does not have SUN_LEN
#ifndef SUN_LEN
#define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) + strlen((ptr)->sun_path))
#endif
#endif

Can just become:

#ifndef SUN_LEN
#define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) + strlen((ptr)->sun_path))
#endif

But this should probably be only moved to the files that need it. "Host.h" seems like too public of a place for this kind of specific stuff.

All #include changes where a more descriptive path are given are fine.


The changes in lldb-gdbserver.cpp:

#ifndef __ANDROID__
#include "lldb/lldb-python.h"
#endif

Should be removed and us the #define that disables python.

Why do we need to #include <spawn.h> in "ProcessGDBRemote.cpp"? Seems like we shouldn't need that anymore and the change in ProcessGDBRemote.cpp should be removed.

The change in FileSpec.cpp:

#if defined(LLDB_CONFIG_TILDE_RESOLVES_TO_USER) && !defined(__ANDROID__)

should not be here. The LLDB_CONFIG_TILDE_RESOLVES_TO_USER should not be defined for android builds.

All preprocessor check in common/Host.cpp are ok since this is a host file. But in general, there should be minimal android checks in non-host code.

Check all places that are including <spawn.h> and try to reroute these to use Host code. I am guessing a lot of places that include it no longer need to.

http://reviews.llvm.org/D5495






More information about the lldb-commits mailing list