diff options
author | Jack Palevich <jackpal@google.com> | 2009-10-27 13:58:08 -0700 |
---|---|---|
committer | Jack Palevich <jackpal@google.com> | 2009-10-27 13:58:08 -0700 |
commit | 66d487487fd117df392e6bb88ffa7d7b3d16d45d (patch) | |
tree | 811e0b8aa6398c7554b9652f4bbb7675a1b75f84 /libacc | |
parent | fe20a7abf1c39e0c08725c866a619d005f218a23 (diff) | |
download | system_core-66d487487fd117df392e6bb88ffa7d7b3d16d45d.zip system_core-66d487487fd117df392e6bb88ffa7d7b3d16d45d.tar.gz system_core-66d487487fd117df392e6bb88ffa7d7b3d16d45d.tar.bz2 |
Print out error message when symbol lookup fails.
Diffstat (limited to 'libacc')
-rw-r--r-- | libacc/tests/main.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libacc/tests/main.cpp b/libacc/tests/main.cpp index e4e386f..948f4cb 100644 --- a/libacc/tests/main.cpp +++ b/libacc/tests/main.cpp @@ -38,7 +38,14 @@ int run(MainPtr mainFunc, int argc, char** argv) { } ACCvoid* symbolLookup(ACCvoid* pContext, const ACCchar* name) { - return (ACCvoid*) dlsym(RTLD_DEFAULT, name); + // Call dlerror once to clear out any preexisting error condition. + (void) dlerror(); + ACCvoid* result = (ACCvoid*) dlsym(RTLD_DEFAULT, name); + const char* error = dlerror(); + if (error) { + fprintf(stderr, "%s\"%s\"\n", error, name); + } + return result; } #ifdef PROVIDE_ARM_DISASSEMBLY |