Skip to content

Commit ccbe157

Browse files
Explain how debug ndk libraries in the docs
1 parent 2462dd4 commit ccbe157

File tree

1 file changed

+16
-0
lines changed
  • src/extra/advanced/debugging_ndk_libraries

1 file changed

+16
-0
lines changed

Diff for: src/extra/advanced/debugging_ndk_libraries/index.md

+16
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,22 @@ You get the load address with
77
<https://github.com/minecraft-linux/mcpelauncher-linker/blob/5127987ca49c4aeca6d180f26a9a4ac5aa4501c2/src/linker.cpp#L21>.
88
Minecraft's load address is printed to the log as a hex number.
99

10+
## codelldb
11+
12+
Works on linux, macOS and windows on both arm64 and intel
13+
14+
1. Install vscode
15+
2. Install codelldb extension
16+
3. Compile the launcher with `-DCMAKE_BUILD_TYPE=Debug`
17+
4. Add the following property (only the python api seem to ignore that we load debug info of `.so` files into a macOS / windows process)
18+
```json
19+
"preRunCommands": [
20+
"breakpoint set --name mcpelauncher_linker_notifylldb -C \"script lldb.debugger.GetSelectedTarget().SetModuleLoadAddress(lldb.debugger.GetSelectedTarget().AddModule(lldb.process.ReadCStringFromMemory(lldb.frame.FindVariable('filename').unsigned, 255, lldb.SBError()), '', ''), lldb.frame.FindVariable('offset').unsigned)\" --auto-continue true",
21+
]
22+
```
23+
mcpelauncher-linker exposes this function used as an automated breakpoint and calls it before calling the constructor of the game, the address is available in the cli output as well.
24+
5. Enjoy having step debugging in mods compiled with debug information and better stack traces of the minecraft game
25+
1026
## Development Utilities
1127

1228
Use readelf to list symbols of `libminecraftpe.so`

0 commit comments

Comments
 (0)