Chanjung Kim
04/06/2025, 6:04 AMSergey Y.
04/06/2025, 9:37 AMSergey Y.
04/06/2025, 9:41 AMChanjung Kim
04/06/2025, 9:56 AMandroid {
buildTypes {
debug {
packaging {
jniLibs {
keepDebugSymbols += "**/*.so"
}
}
}
}
}
Then, in the Run configuration, as you'd have done, set the debug type to Java + Native. Launch the app, attach the debugger, pause LLDB, and set breakpoints where you want. At least we would be able to shorten this manual breakpoint-setting process by making an IntelliJ plugin, but we don't have one yet.
I have plans to make an IntelliJ plugin for this, and I'll definitely post that news here when we got a basic debugger support.
As of now, the most practical way is to use unit tests. When you use androidTarget()
inside the project, Gobley will build the Rust library for the host machine's platform for local unit tests (You can turn this off). So you can share the unit test code between local unit tests and instrumented unit tests, as you'd do with Java or Kotlin.Sergey Y.
04/06/2025, 10:10 AMSergey Y.
04/06/2025, 10:11 AMChanjung Kim
04/06/2025, 10:20 AMadb
, configuring port forwarding, making the lldb server listening on the device, and launch lldb
on the host machine that connects to the port.
If I understand it correctly, then at least the process specifying the debug symbol directory and controlling lldb
from the terminal, that can be omitted. The screenshot I uploaded is made without doing the process in an external terminal. The only thing that should be manually done is setting breakpoints.Sergey Y.
04/06/2025, 10:24 AMSergey Y.
04/06/2025, 10:26 AMChanjung Kim
04/06/2025, 10:32 AM.rs
files). I'm saying that the process in the second screenshot is not necessary. I'm sure that you don't have to manually set the debug directory if you put the above Gradle DSL in your project settings. (If this doesn't work then maybe strip-symbols
are enabled in the Cargo profile settings in the workspace manifest).Sergey Y.
04/06/2025, 10:35 AMChanjung Kim
04/06/2025, 10:36 AMSergey Y.
04/06/2025, 10:39 AMadd
function in your Rust code. Does UniFFI export disable name mangling for the function symbol, or is it still mangled? And if I want to set a breakpoint on a specific function name, I do need to know the exact mangled symbol name, correct?Chanjung Kim
04/06/2025, 10:42 AMimage lookup
). UniFFI doesn't prevent name mangling, but it generates #[no_mangle] extern "C"
functions. In the above example, it would be something like uniffi_ffi_app_add
(I'm not sure).Chanjung Kim
04/06/2025, 10:42 AMnm -g
, it's uniffi_app_fn_func_add
.Sergey Y.
04/06/2025, 10:43 AMSal
04/06/2025, 5:21 PMbenkuly
04/08/2025, 4:50 PMSal
04/08/2025, 5:01 PM