Skip to content

Instantly share code, notes, and snippets.

@ruipacheco
Last active May 4, 2017 13:07
Show Gist options
  • Save ruipacheco/097409fcfcab6fc489c0fefb5bde0fe7 to your computer and use it in GitHub Desktop.
Save ruipacheco/097409fcfcab6fc489c0fefb5bde0fe7 to your computer and use it in GitHub Desktop.
Debugging MariaDB 10.1 on macOS Sierra
These are the steps I took to be able to have lldb breakpoint on a function name in macOS Sierra:
```
cmake . -DCMAKE_BUILD_TYPE=Debug -DTOKUDB_OK=0 -DWITH_LIBARCHIVE=OFF;
make
cd mysql-test
./mtr --manual-debug 1st
```
This will log a number of parameters, like the path to the mysqld executable and the parameters to pass to it.
Open a new tab, launch lldb and launch the binary with the parameters:
`$ lldb <path to executable found in output above> <parameters returned in output above>`
Then set a breakpoint on a method name, native_password_authenticate in this case:
`(lldb) br set --name native_password_authenticate`
Finally, start the executable
`(lldb) run`
Upon executing your client code lldb should stop on the method you chose, assuming the code path goes through it.
@vaintroub
Copy link

Nah, TOKUDB is broken, so it should stay -DTOKUDB_OK=0

@ruipacheco
Copy link
Author

I tried to compile with -DPLUGIN_TOKUDB=NO and worked well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment