mirror of
https://github.com/chararomandroid/android_device_samsung_a20
synced 2026-08-21 11:55:31 -04:00
universal7885: Import dlopener debugging tool
[Linux4: This is helpful for things like OMX which hide dlopen errors]
This commit is contained in:
parent
dcd42d191d
commit
2e6fa25a3a
3 changed files with 41 additions and 1 deletions
12
universal7885-common/debug-tools/dlopener/Android.bp
Normal file
12
universal7885-common/debug-tools/dlopener/Android.bp
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
cc_binary {
|
||||||
|
name: "dlopener",
|
||||||
|
srcs: ["dlopener.c"],
|
||||||
|
vendor_available: true,
|
||||||
|
}
|
||||||
|
|
||||||
|
cc_binary {
|
||||||
|
name: "dlopener32",
|
||||||
|
srcs: ["dlopener.c"],
|
||||||
|
compile_multilib: "32",
|
||||||
|
vendor_available: true,
|
||||||
|
}
|
||||||
28
universal7885-common/debug-tools/dlopener/dlopener.c
Normal file
28
universal7885-common/debug-tools/dlopener/dlopener.c
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
#include <dlfcn.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
const char *path;
|
||||||
|
int status = -EINVAL;
|
||||||
|
void *handle = NULL;
|
||||||
|
|
||||||
|
if(argc <= 1) {
|
||||||
|
printf("Please specify a module to load!\n");
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
path = argv[1];
|
||||||
|
|
||||||
|
handle = dlopen(path, RTLD_NOW);
|
||||||
|
if (handle == NULL) {
|
||||||
|
char const *err_str = dlerror();
|
||||||
|
printf("load: module=%s\n%s\n", path, err_str?err_str:"unknown");
|
||||||
|
status = -EINVAL;
|
||||||
|
} else {
|
||||||
|
printf("load: module=%s %s\n", path,"Success!");
|
||||||
|
}
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
@ -105,7 +105,7 @@ PRODUCT_PACKAGES += \
|
||||||
libsuspend
|
libsuspend
|
||||||
|
|
||||||
# Debug
|
# Debug
|
||||||
PRODUCT_PACKAGES += eklogger
|
PRODUCT_PACKAGES += eklogger dlopener
|
||||||
|
|
||||||
# DRM
|
# DRM
|
||||||
PRODUCT_PACKAGES += \
|
PRODUCT_PACKAGES += \
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue