summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-29 19:28:21 +0000
committerscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-29 19:28:21 +0000
commit3bb4eb6b5d556ae7e17ee0bff5b3c28529c54b62 (patch)
tree02be269087989bad1d138dfefcfdb4cdf8b1cc46
parentc8423065a0054dc81e72801dfd60b99483f70b79 (diff)
downloadchromium_src-3bb4eb6b5d556ae7e17ee0bff5b3c28529c54b62.zip
chromium_src-3bb4eb6b5d556ae7e17ee0bff5b3c28529c54b62.tar.gz
chromium_src-3bb4eb6b5d556ae7e17ee0bff5b3c28529c54b62.tar.bz2
Add log statements to generated stub code.
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
-rwxr-xr-xtools/generate_stubs/generate_stubs.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/generate_stubs/generate_stubs.py b/tools/generate_stubs/generate_stubs.py
index d8fac2d..10cbb30 100755
--- a/tools/generate_stubs/generate_stubs.py
+++ b/tools/generate_stubs/generate_stubs.py
@@ -147,6 +147,8 @@ STUB_HEADER_PREAMBLE = """// This is generated file. Do not modify directly.
#include <string>
#include <vector>
+#include "base/logging.h"
+
namespace %(namespace)s {
"""
@@ -231,6 +233,7 @@ bool %s() {
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
@@ -295,6 +298,8 @@ UMBRELLA_INITIALIZER_INITIALIZE_FUNCTION_START = (
if (handle != NULL) {
module_opened = true;
opened_libraries[cur_module] = handle;
+ } else {
+ VLOG(1) << "dlopen(" << dso_path->c_str() << ") failed";
}
}