Skip to content

Commit

Permalink
Add log statements to generated stub code.
Browse files Browse the repository at this point in the history
This makes it easier to debug what went wrong in the case of a failed module load.


Review URL: http://codereview.chromium.org/7532032

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94731 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
scherkus@chromium.org committed Jul 29, 2011
1 parent c842306 commit 3bb4eb6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tools/generate_stubs/generate_stubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ def __str__(self):
#include <string>
#include <vector>
#include "base/logging.h"
namespace %(namespace)s {
"""

Expand Down Expand Up @@ -231,6 +233,7 @@ def __str__(self):
STUB_POINTER_INITIALIZER = """ %(name)s_ptr =
reinterpret_cast<%(return_type)s (*)(%(parameters)s)>(
dlsym(module, "%(name)s"));
VLOG_IF(1, !%(name)s_ptr) << "Couldn't load %(name)s";
"""

# Template for module initializer function start and end. This template takes
Expand Down Expand Up @@ -295,6 +298,8 @@ def __str__(self):
if (handle != NULL) {
module_opened = true;
opened_libraries[cur_module] = handle;
} else {
VLOG(1) << "dlopen(" << dso_path->c_str() << ") failed";
}
}
Expand Down

0 comments on commit 3bb4eb6

Please sign in to comment.