Polyfilla, as Heathy says, is the usual.
It rather depends on what type of paint it is though. The thickness you describe suggest that it might be several generations of cement basedpaint or limewash/whitewash. Modern paints tend not to come away from render quite so cleanly.
It makes no difference to how you deal with it. I only mention it because you usually have to go at it fairly hard with a scraper, otherwise more chunks are likely to keep coming away.
Anyway, an old trick is to thicken some paint with fine sand. Daub that on around the edges to lose the "step" in the paint thickness.