Premise:
In QtCreator, I am trying to debug a library in which it [QtCreator] itself relies upon.
- I build the SO locally
- It is installed to
/home/anon/.local/usr/local/lib/libqbscore.so
- Then I test by running another instance of QtCreator, and loading the library with
LD_PRELOAD
:
And This is how I typically set the breakpoints:
I can reliably generate that ErrorInfo
. It outputs "fungo bar" to the Issues
pane in the running instance of QtCreator, which means that I have confirmed that the breakpoints are being missed.
I double checked to make sure the debug symbols were active, and the following looks fine:
file "/home/anon/.local/usr/local/lib/libqbscore.so.1.24.0"
/home/anon/.local/usr/local/lib/libqbscore.so.1.24.0: ELF 64-bit LSB shared object,
x86-64,
version 1 (GNU/Linux),
dynamically linked,
BuildID[sha1]=67ceaaa6f6054a82f50124acf14aa3b4cf3a3b71,
with debug_info,
not stripped
What I have tried:
https://stackoverflow.com/a/10448351/2158002
Under Additional Startup Commands:
set environment LD_PRELOAD /home/anon/.local/usr/local/lib/libqbscore.so
I checked the console to confirm the environment variable, and it is being set as intended. However my breakpoint does not fire.
https://stackoverflow.com/a/69537173/2158002
set solib-search-path /home/anon/.local/usr/local/lib/
Does not work.
https://stackoverflow.com/a/41822591/2158002
set exec-wrapper env 'LD_PRELOAD=/home/anon/.local/usr/local/lib/libqbscore.so'
Does not work.
Conclusion:
The obvious solutions have not worked, and relevant search results have run dry, which leads me to conclude that there is probably a simple oversight that I am plainly ignorant of. One consideration is that perhaps this will not work because the instance of QtCreator itself is not compiled with debug symbols:
gdb /usr/bin/qtcreator
GNU gdb (GDB) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/qtcreator...
This GDB supports auto-downloading debuginfo from the following URLs:
https://debuginfod.archlinux.org
Enable debuginfod for this session? (y or [n]) n
Debuginfod has been disabled.
To make this setting permanent, add 'set debuginfod enabled off' to .gdbinit.
(No debugging symbols found in /usr/bin/qtcreator)
However I highly doubt this because I am under the impression that only the shared object needed the Debug symbols.
In any case, how can I run QtCreator's debugger, that it can properly act upon breakpoints set up for the library [ which is being loaded via LD_PRELOAD
]?