In binder. c init function is defined but no exit function.
In init part misc_register() is called. The same should be deregistered in module exit by calling
Misc_deregister() function. Can anyone help me to understand why no module exit function for android binder driver?
Related
I have an apk with package name a.b.c.d
The main process that gets launched when starting this app is a.b.c.d and it spawns a new process a.b.c.d.e
From android studio, I opened the apk in "Profile/debug apk" option. But, I'm only attach to process a.b.c.d and not to a.b.c.d.e
When I try to attach to the child process the error I get is below:
Starting LLDB server using code injection
Code injection has failed
Debugger detached
Process finished with exit code 0
Any tips on how I can get this working?
There is FFmpeg Static (binary) available for Android and we can stop/cancel some FFmpeg execution (command) while it's doing something https://github.com/WritingMinds/ffmpeg-android-java/issues/33
But I want to use FFmpeg shared libraries and JNI, I found next library https://github.com/IljaKosynkin/FFmpeg-Development-Kit (it works ok)
But there is no option to stop execution of FFmpeg command (or killing the process)
We use Java native run method there to start execute some command:
Java:
https://github.com/IljaKosynkin/FFmpeg-Development-Kit/blob/master/JNI/app/src/main/java/com/example/ilja/jni/VideoKit.java#L57
and then in C we call FFmpeg's main method:
C:
https://github.com/IljaKosynkin/FFmpeg-Development-Kit/blob/master/JNI/app/jni/videokit.c#L41
How can I stop/cancel some FFmpeg executing after I called Java run and C main methods?
the solution is to edit ffmmpeg class (add some variables to check if it should execute farther or not)
(gradle newbie question)
I am looking to run a custom task with code from this thread. This is to do with setting up build env for release/debug etc...
Since the code bloats the original boilerplate code, I would like to do following for readability and extensibility -
Move the code to separate file as a task/def(Gist of the Code
Run the task/def before assembleDebug/Release
Here are problems I face when task is appended at the end of build.gradle file:
a) If I run just the task ./gradlew buildCustom , I get error
Could not find method defaultConfig() for arguments
b) If I try to use doLast I get error
Could not find method doLast() for arguments [task ':app:assembleDebug'] on task ':app:buildCustom'.
There is something very obvious that I donot understand, appreciate any help.
I've been successfully running Robolectric unit tests under the debugger in Android Studio since version 0.6.1
Now I am unable to and get the following error
ERROR: transport error 202: connect failed: Connection refused
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [../../../src/share/back/debugInit.c:750]
Could not write standard input into: Gradle Test Executor 1.
java.io.IOException: Broken pipe
I have always set the use in-process build flag unchecked in the compile settings and although I am currently using AS 0.8-14, I have gone back and tried 0.8-11, 0.8-9 and 0.6-1 and none of them work now. I'm using android build tools version 19.1.0 (and have been for some time and it does work with them).
Could it be some local security setting under Mac OS X? Any assistance would be gratefully received.
** Update **
I have discovered that the issue is caused by running an additional JavaExec task before running the unit test tasks. It seems that gradle is running the JVM for the first task and passing debug arguments to it e.g. -agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=49807 The task completes and the JVM exits. Gradle then runs the actual unit test and expects the new JVM to listen on the same port for the debugger to connect - which it doesn't and so the connection failure arises.
How can I either prevent the prior task (an ormlite database compile task) from running under the debugger or force gradle to recognise that the unit test task will run using a new JVM and so change the jvmArgs for the unit test to reflect the new debug port?
I fixed this by changing the database compilation task to be an Exec task rather than a JavaExec task. The exec task was defined as follows and so executed the database compilation as an external java process, not a gradle invoked one. This prevented the debug JVM being 'consumed' by the database compilation task.
task (taskName type: Exec) {
def mainClass = "com.some.class"
def classPath = "${buildDir}/intermediates/classes/${flavorName}/${buildType.name}" + ":" + configurations.databaseCompile.asPath
commandLine "java", "-cp", classPath, mainClass, configDirName
}
I summon the Android NDK debugging Ninjas here!
I've tried so many tutorials about debugging Android native code, so I can't remember them all.
Now I'm trying to get ARM DS-5 work. I've made it work with the Android NDK samples, where the main Activity loads the library. Laggy, but works.
But my project is a little bit complicated. My Main Activity has a button, when I tap it, SubActivity is launched, and it loads native lib. When I just try to use the DS-5 debugger, when Main Activity is loaded, I suppose debugger tries to connect to lib, but fails, saying:
Execution stopped at: 0xAFD0C52C
Connected to unknown platform
0xAFD0C52C POP {r4,r7}
file "D:\workspace\Project\bin\app_process"
WARNING(IMG53): app_process has no line debug information
add-symbol-file "D:\workspace\Project\bin\libc.so"
Loading library symbols: libc.so
WARNING(IMG53): libc.so has no line debug information
Execution stopped at: 0xAFD0C748
In thread 2 (OS thread id 7606)
In __futex_syscall3 (no debug info)
add-symbol-file "D:\workspace\Project\obj\local\armeabi\libName.so"
Execution stopped at: 0xAFD0C748
In thread 3 (OS thread id 7607)
Execution stopped at: 0xAFD0BFFC
In thread 4 (OS thread id 7608)
In __rt_sigtimedwait (no debug info)
Execution stopped at: 0xAFD0B854
In thread 5 (OS thread id 7609)
In select (no debug info)
Execution stopped at: 0xAFD0C748
In thread 6 (OS thread id 7610)
In __futex_syscall3 (no debug info)
Execution stopped at: 0xAFD0B70C
In thread 7 (OS thread id 7611)
In __ioctl (no debug info)
Execution stopped at: 0xAFD0B70C
In thread 8 (OS thread id 7612)
Execution stopped at: 0xAFD0C52C
In thread 1 (OS thread id 7605)
In epoll_wait (no debug info)
0xAFD0C52C POP {r4,r7}
WARNING(CMD454): The shared library D:\workspace\Project\obj\local\armeabi\libName.so is currently not loaded by the application so the request has been pended
cd "D:\workspace"
Working directory "D:\workspace"
directory "D:\workspace\Project"
Source directories searched: D:\workspace\Project;$cdir;$cwd;$idir
break -d -p "D:\workspace\Project\jni\Name.cpp":525
WARNING(CMD452-COR167):
! Breakpoint 1 has been pended
! No compilation unit matching "D:/workspace/Project/jni/Name.cpp" was found
condition 1
break-script 1 ""
ignore 1 0
break-stop-on-threads 1
unsilence 1
Breakpoint 1 unsilenced
I think that it tries to connect to native lib when Main Activity starts. But library is loaded later!
What I tried:
Setting Java breakpoint in SubActivity, after native lib was loaded,
then attaching DS-5 debugger. But I get various errors from Eclipse
saying about timeouts, whatever.
In the debug config settings I can't
select the activity, which should trigger debugging of native code,
there's combobox, but it's disabled:
The question itself: if my lib is not loaded by main Activity, how do I make DS-5 wait for lib to load?
Do you really need to have exact behaviour between debug and release version ?
If not, load the library in the main activity, too in debug version.