ok after some further research I have found this page (probably the one you @SGaist were referring to) https://forums.developer.apple.com/thread/9233.
As you mentioned, it seems that DYLD_* variables have been disabled (they are ignored) since El Capitan because of a new feature called System Integrity Protection (SIP). According to Apple Developer website, debugging can be happily performed only by Xcode (although I haven't tried it yet). What about Qt? Will 5.5.1 or 5.6 allow debugging on El Cap with SIP?
I read on another page SIP can be disabled in Recovery mode. Anyway, I am not keen at hacking my own system... the alternative is to wait for the next version of Qt and hope for a solution. Unsure what to do for now, in the meanwhile I am stuck! Grrr
UPDATE: I ended up disabling SIP following the following step:
Enter Recovery mode (Cmd+R on startup)
Open Terminal
csrutil disable; reboot
Now debugging went back to normality!
My only doubt is that when i do csrutil status, I receive the following message:
"System Integrity Protection status: enabled (Custom Configuration).
Configuration:
Apple Internal: disabled
Kext Signing: disabled
Filesystem Protections: disabled
Debugging Restrictions: disabled
DTrace Restrictions: disabled
NVRAM Protections: disabled
This is an unsupported configuration, likely to break in the future and leave your machine in an unknown state."
Not very reassuring uh? (and why is that still saying SIP enabled?)