Running a Test with the Debugger

To run a test named some.test with the debugger in embedded mode you could do this:

  1. Run libmysqld/examples/test_run --gdb some.test. This creates a libmysqld/examples/test-gdbinit file which contains the required parameters for mysqltest.

  2. Make a copy of the test-gdbinit file (call it, for example, some-gdbinit). The test-gdbinit file will be removed after test-run --gdb has finished.

  3. Load libmysqld/examples/mysqltest_embedded into your favorite debugger, for example: gdb mysqltest_embedded.

  4. In the debugger, for example in gdb, do: --sou some-gdbinit

Now some.test is running, and you can see if it's passing or not.

If you just want to debug some queries with the embedded server (not the test), it's easier to just run libmysqld/examples/mysql. It's the embedded server-based clone of the usual mysql tool, and works fine under gdb or whatever your favorite debugger is.