Merge with siana/future

This commit is contained in:
Shyotl
2011-10-13 00:03:56 -05:00
parent 4963a064f1
commit 008bebd817
169 changed files with 15033 additions and 2475 deletions

View File

@@ -65,6 +65,9 @@ endif (NOT WORD_SIZE EQUAL 32)
list(APPEND llplugin_SOURCE_FILES ${llplugin_HEADER_FILES})
add_library (llplugin ${llplugin_SOURCE_FILES})
if(LINUX AND STANDALONE)
target_link_libraries (llplugin rt dl)
endif(LINUX AND STANDALONE)
add_dependencies(llplugin prepare)

View File

@@ -32,6 +32,10 @@
*
* @endcond
*/
#if LL_LINUX && defined(LL_STANDALONE)
#include <dlfcn.h>
#include <apr_portable.h>
#endif
#include "linden_common.h"
@@ -83,16 +87,25 @@ int LLPluginInstance::load(std::string &plugin_file)
{
pluginInitFunction init_function = NULL;
#if LL_LINUX && defined(LL_STANDALONE)
void *dso_handle = dlopen(plugin_file.c_str(), RTLD_NOW | RTLD_GLOBAL);
int result = (!dso_handle)?APR_EDSOOPEN:apr_os_dso_handle_put(&mDSOHandle,
dso_handle, AIAPRRootPool::get()());
#else
int result = apr_dso_load(&mDSOHandle,
plugin_file.c_str(),
LLAPRRootPool::get()());
#endif
if(result != APR_SUCCESS)
{
char buf[1024];
apr_dso_error(mDSOHandle, buf, sizeof(buf));
#if LL_LINUX && defined(LL_STANDALONE)
LL_WARNS("Plugin") << "plugin load " << plugin_file << " failed with error " << result << " , additional info string: " << buf << LL_ENDL;
#else
LL_WARNS("Plugin") << "apr_dso_load of " << plugin_file << " failed with error " << result << " , additional info string: " << buf << LL_ENDL;
#endif
}
if(result == APR_SUCCESS)

View File

@@ -40,6 +40,7 @@
#include "llpluginmessageclasses.h"
#if LL_LINUX
#include <boost/program_options/parsers.hpp>
#include <boost/tokenizer.hpp>
#endif
#include "llapr.h"
@@ -406,7 +407,23 @@ void LLPluginProcessParent::idle(void)
std::string const terminal_command = (env = getenv("LL_DEBUG_TERMINAL_COMMAND")) ? env : "/usr/bin/xterm -geometry 160x24+0+0 -e %s";
char const* const gdb_path = (env = getenv("LL_DEBUG_GDB_PATH")) ? env : "/usr/bin/gdb";
cmd << gdb_path << " -n /proc/" << mProcess.getProcessID() << "/exe " << mProcess.getProcessID();
std::vector<std::string> tokens = boost::program_options::split_unix(terminal_command, " ");
typedef boost::tokenizer< boost::escaped_list_separator<
char>, typename std::basic_string<
char>::const_iterator,
std::basic_string<char> > tokenizerT;
tokenizerT tok(terminal_command.begin(),
terminal_command.end(),
boost::escaped_list_separator< char >("\\",
" ", "'\""));
std::vector< std::basic_string<char> > tokens;
for (typename tokenizerT::iterator
cur_token(tok.begin()), end_token(tok.end());
cur_token != end_token; ++cur_token) {
if (!cur_token->empty())
tokens.push_back(*cur_token);
}
std::vector<std::string>::iterator token = tokens.begin();
mDebugger.setExecutable(*token);
while (++token != tokens.end())