Add more support for debugging plugins.

Added support for plugin debug messages and better error reporting
when something goes wrong during start up of SLPlugin.

Also added more debug output regarding general plugin messages
as well as debug output related to AIFilePicker.
This commit is contained in:
Aleric Inglewood
2011-05-08 15:31:51 +02:00
parent 80bbf5d083
commit 75ff0fc04d
14 changed files with 330 additions and 38 deletions

View File

@@ -42,6 +42,15 @@
<array>
<string>ShaderLoading</string>
<string>Openjpeg</string>
<!-- Debug output about messages received from plugins: -->
<string>Plugin</string> <!-- Everything except what is listed below -->
<string>Plugin child</string> <!-- Plugin log messages from the plugin child process -->
<!--<string>PluginRaw</string>--> <!-- The raw LLSD data -->
<string>PluginRaw child</string> <!-- The raw LLSD data from the plugin child process -->
<!--<string>PluginHeartbeat</string>--> <!-- One second interval CPU usage reports -->
<!--<string>PluginUpdated</string>--> <!-- The mouse "updated" message -->
<!-- Debug output about messages sent to plugins: -->
<!--<string>PluginMouseEvent</string>--> <!-- Mouse event data sent to plugins -->
</array>
</map>
</array>

View File

@@ -399,10 +399,12 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_
if(LLFile::stat(launcher_name, &s))
{
LL_WARNS("Media") << "Couldn't find launcher at " << launcher_name << LL_ENDL;
llassert(false); // Fail in debugging mode.
}
else if(LLFile::stat(plugin_name, &s))
{
LL_WARNS("Media") << "Couldn't find plugin at " << plugin_name << LL_ENDL;
llassert(false); // Fail in debugging mode.
}
else
{

View File

@@ -338,10 +338,12 @@ void AIFilePicker::receivePluginMessage(const LLPluginMessage &message)
std::string message_name = message.getName();
if (message_name == "canceled")
{
LL_DEBUGS("Plugin") << "received message \"canceled\"" << LL_ENDL;
set_state(AIFilePicker_canceled);
}
else if (message_name == "done")
{
LL_DEBUGS("Plugin") << "received message \"done\"" << LL_ENDL;
LLSD filenames = message.getValueLLSD("filenames");
mFilenames.clear();
for(LLSD::array_iterator filename = filenames.beginArray(); filename != filenames.endArray(); ++filename)

View File

@@ -175,6 +175,9 @@ private:
std::string get_folder(std::string const& default_path, std::string const& context);
protected:
// Call deleteMe(), not delete.
/*virtual*/ ~AIFilePicker() { LL_DEBUGS("Plugin") << "Calling AIFilePicker::~AIFilePicker()" << LL_ENDL; }
// Handle initializing the object.
/*virtual*/ void initialize_impl(void);
@@ -197,6 +200,7 @@ class AIPluginFilePicker : public LLPluginClassBasic {
LOG_CLASS(AIPluginFilePicker);
public:
AIPluginFilePicker(AIFilePicker* state_machine) : mStateMachine(state_machine) { }
/*virtual*/ ~AIPluginFilePicker() { LL_DEBUGS("Plugin") << "Calling AIPluginFilePicker::~AIPluginFilePicker()" << LL_ENDL; }
static std::string launcher_name(void) { return gDirUtilp->getLLPluginLauncher(); }
static char const* plugin_basename(void) { return "basic_plugin_filepicker"; }