Qt’s macdeployqt & debug binaries

In some form I have been working with Qt since 2014. A couple years ago I took over as lead on a Qt project and noticed something weird. I could never get breakpoints to work on macOS. After spending a day or two on the problem with no luck, I moved on to more important things, falling back on log messages.

Today I was in another project and looking at macdeployqt’s help and I noticed this:

-no-strip	Don't run 'strip' on the binaries

Even though the Qt project had long been given to another team, I pulled the latest code from the repo and built it. I confirmed that breakpoints still didn’t work and then added the -no-strip option. Voila! Breakpoints worked!

It seems like bad design that by default a tool would remove functionality from a binary when its job is to package that binary. I also wonder does the counterpart, windeployqt do something similar?