I didn't change any compiler flags. Someone says here: https://emacs.stackexchange.com/a/4241 that it worked when they started emacsclient from emacs/lib-src but not when they started it from its location through make install. So I tried starting emacs from emacs/src. I thought debugging symbols were now on because the gdb output looked colorful, but the log doesn't so I'm not sure.