I want to debug a project on android that includes a native extension. I did everything as described in the description (https://www.defold.com/manuals/extensions-debugging-android/). When I set the source path of the native extension on the path mapping and apply it, the source does not appear in the Project window on the left. So I can’t set a breakpoint.
Someone may have an idea why the source doesn’t appear? Thanks!
I wonder if this is where the Android Studio differs between macOS and WIndows?
I think I’ve seen this before, but we were unable to figure it out then.
Huh, that seems to indeed be related.
But I’m pretty sure I tested this with a server built apk together with my local source.
I guess it’s actually a path problem, i.e ”\” vs ”/”.
A classic issue, and there really is no reason Android studio couldn’t fix it.
Perhaps you can use a Linux virtual machine to debug it?
What is still a problem for me is that during debugging I can’t see, for example, the contents of the lua structures being expanded on the variables tab.
Or can I find out which lua version (Lua: download area) you are built in the engine? I was thinking of downloading the source of the lua and setting it on the path mappings. If this works, which path should I set?
We use LuaJIT 2.1.0-beta3 on all platforms except HTML5. You can pprint(jit) to see the version used. On HTML5 we use plain Lua 5.1.5 with the BitOp module from LuaJIT added.
For path mappings you should choose such a path that the underlying relative paths would work in your local folder.
E.g. if the compiler says the path is “/some/dir/packagename/src/a/b/c.cpp” you should choose the package name local on your computer “/my/drive/packagename/src”
What folder does the path mapper display, and what path did you try?
Unfortunately my English is very bad and I may not write what I really want. I’m sorry for it. I’ll try to describe what I want again.
So I would like to set the source of luajit for path maps just like my native extension.
This is shown in the picture above:
/home/coderm4ster/AdMobTest/ags_native/src -> /tmp/job3916…3044/upload/ags_native/src
I downloaded the luajit 2.1.0-beta3 source code. The question is which path to the src folder will belong to.
So /home/coderm4ster/LuaJIT-2.1.0-beta3/src -> ?
I don’t recall off the top of my head (I’m not at my computer) but the path should mention luajit.
Such libraries we build locally and I believe Sven or Johan built this library last.
So perhaps check under ”/Users/svenandersson”? I saw that in the first picture you posted.
I checked all folders under “/Users/svenandersson” but I didn’t find any luajit folders. There are a few folders named lua, where I tried to set the luajit source, but did not appear on the left side of the Project window as the source of my native extension.
I look deeper into the “.so” file. You probably build the luajit independently (maybe in release mode) from the engine. Then the built luajit is statically linked to the engine. Because it is not built directly from the source into the engine, the built engine does not contain any reference to the luajit source.
If so, it explains why I can’t see the luajit at path mappings.