STM32 Reset Reason - detect debug reset
You cannot distinguish a reset from the programmer.
What you can do is have the debug initialization script write a memory location you take into consideration during RTC initialization.

However, you'll probably find the PINRSTF source bit to be active almost always, except on specific soft reset conditions (eg: SFTRSTF or WWDGRSTF).  

I'm not sure what you want to accomplish, but if you want to reset the RTC for debug purposes, you are better of doing this within the initialization script of your IDE.
Or if you want to reset the RTC on new program, copy the checksum of the program in backup registers (TAMP_BKPxR) and see if they match during initialization.