Skip to content

Commit

Permalink
Use dlerror() for in generated stub loading code for more informative…
Browse files Browse the repository at this point in the history
… error messages.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99079 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
scherkus@chromium.org committed Aug 31, 2011
1 parent 466028d commit f632555
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tools/generate_stubs/generate_stubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,8 @@ 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";
VLOG_IF(1, !%(name)s_ptr) << "Couldn't load %(name)s, dlerror() says:\\n"
<< dlerror();
"""

# Template for module initializer function start and end. This template takes
Expand Down Expand Up @@ -299,7 +300,8 @@ def __str__(self):
module_opened = true;
opened_libraries[cur_module] = handle;
} else {
VLOG(1) << "dlopen(" << dso_path->c_str() << ") failed";
VLOG(1) << "dlopen(" << dso_path->c_str() << ") failed, "
<< "dlerror() says:\\n" << dlerror();
}
}
Expand Down

0 comments on commit f632555

Please sign in to comment.