id = 2590 title = "qemu-x86_64: gdb doesn't read symbols from dynamically linked shared libraries." state = "opened" created_at = "2024-09-25T15:40:08.888Z" closed_at = "n/a" labels = ["GDB", "target: i386"] url = "https://gitlab.com/qemu-project/qemu/-/issues/2590" host-os = "Kali Linux" host-arch = "ARM64" qemu-version = "v9.1.0-452-ga5dd9ee060" guest-os = "n/a" guest-arch = "x86_64" description = """GDB fails to load dynamically linked shared libraries when connecting to qemu-x86_64, causing it to not recognize symbols from the shared libraries. As a result, breakpoints in shared library functions (e.g, `break printf`) do not work.""" reproduce = """1. Start the debug server: `./qemu-x86_64 -g PORT ./x86_64-binary` 2. Connect GDB to the debug server: ``` $ gdb-multiarch ./x86_64-binary (gdb) set verbose on (gdb) target remote :PORT ``` 3. GDB displays a warning and fails to load shared libraries: ``` (gdb) target remote :PORT Remote debugging using :PORT warning: platform-specific solib_create_inferior_hook did not load initial shared libraries. (gdb) info sharedlibrary No shared libraries loaded at this time. ```""" additional = """This issue does not occur when using gdbserver on a native x86_64 machine and connecting to it from gdb-multiarch on an ARM64 machine, indicating the issue is likely related to QEMU rather than GDB. GDB correctly recognizes symbols from the target binary (e.g., the `main` function), and breakpoints at these symbols function as expected."""