I don't generally like mysteries with your flawed, self-hating, detectives, but I do love historical fiction, and Kerr's Bernie Gunther is a very special case. When you're a non-Nazi cop in WW II Germany, forced to dance to Reynard Heydrich's tune, you have plenty of reason for self-hate.
Gunther is a good cop in a bad situation, and fighting a losing battle with his own morality - not because he's turning to evil, but simply because every time he tries to do something good, the best that's available is not-quite-as-bad. He feeds two old Jewish spinsters in his apartment building - but all it does is keep them alive long enough to be sent to the concentration camp. He routinely accedes to the wishes of his Nazi masters, purely to stop them using somebody else who would have no qualms about the things he's ordered to do. Of course he feels like committing suicide on a daily basis - and because he's a good man who thinks that he can somehow have a positive effect, day after day he doesn't. It should be depressing, but somehow it isn't.