Merge remote-tracking branch 'singu/master'

Conflicts:
	indra/cmake/WebKitLibPlugin.cmake
	indra/llmessage/llurlrequest.cpp
	indra/plugins/webkit/media_plugin_webkit.cpp
This commit is contained in:
Drake Arconis
2012-10-04 16:17:41 -04:00
115 changed files with 7973 additions and 6004 deletions

View File

@@ -125,7 +125,7 @@ int LLPluginInstance::load(const std::string& plugin_dir, std::string &plugin_fi
buf[0] = 0;
if (error)
{
strncpy(buf, dlerror(), sizeof(buf));
strncpy(buf, error, sizeof(buf));
}
buf[sizeof(buf) - 1] = 0;
}

View File

@@ -379,6 +379,7 @@ void LLPluginProcessParent::idle(void)
}
else
{
// Set PluginAttachDebuggerToPlugins to TRUE to use this. You might also want to set DebugPluginDisableTimeout to TRUE.
if(mDebug)
{
// If we're set to debug, start up a gdb instance in a new terminal window and have it attach to the plugin process and continue.
@@ -400,14 +401,37 @@ void LLPluginProcessParent::idle(void)
mDebugger.launch();
#elif LL_LINUX
// The command we're constructing would look like this on the command line:
// /usr/bin/xterm -geometry 160x24-0+0 -e '/usr/bin/gdb -n /proc/12345/exe 12345'
// This can be changed by setting the following environment variables, for example:
// export LL_DEBUG_TERMINAL_COMMAND="/usr/bin/gnome-terminal --geometry=165x24-0+0 -e %s"
// /usr/bin/xterm -geometry 160x24-0+0 -e /usr/bin/gdb -n /proc/12345/exe 12345
// Note that most terminals demand that all arguments to the process that is
// started with -e are passed as arguments to the terminal: there are no quotes
// around '/usr/bin/gdb -n /proc/12345/exe 12345'. This is the case for xterm,
// uxterm, konsole etc. The exception might be gnome-terminal.
//
// The constructed command can be changed by setting the following environment
// variables, for example:
//
// export LL_DEBUG_GDB_PATH=/usr/bin/gdb
// export LL_DEBUG_TERMINAL_COMMAND='/usr/bin/gnome-terminal --geometry=165x24-0+0 -e "%s"'
//
// Or, as second example, if you are running the viewer on host 'A', and you want
// to open the gdb terminal on the X display of host 'B', you would run on host B:
// 'ssh -X A' (and then start the viewer, or just leave the terminal open), and
// then use:
//
// export LL_DEBUG_TERMINAL_COMMAND="/usr/bin/uxterm -fs 9 -fa 'DejaVu Sans Mono' -display localhost:10 -geometry 209x31+0-50 -e %s"
//
// which would open the terminal on B (no quotes around the %s, since this uses uxterm!).
// For a list of available strings to pass to the -fa, run in a terminal: fc-list :scalable=true:spacing=mono: family
char const* env;
std::string const terminal_command = (env = getenv("LL_DEBUG_TERMINAL_COMMAND")) ? env : "/usr/bin/xterm -geometry 160x24+0+0 -e %s";
std::string 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::string::size_type pos = terminal_command.find("%s");
if (pos != std::string::npos)
{
terminal_command.replace(pos, 2, cmd.str());
}
typedef boost::tokenizer< boost::escaped_list_separator<
char>, std::basic_string<
@@ -429,14 +453,7 @@ void LLPluginProcessParent::idle(void)
mDebugger.setExecutable(*token);
while (++token != tokens.end())
{
if (*token == "%s")
{
mDebugger.addArgument(cmd.str());
}
else
{
mDebugger.addArgument(*token);
}
mDebugger.addArgument(*token);
}
mDebugger.launch();
#endif