Heat the oil in a large, ovenproof frying pan or casserole, then add the onion and stir-fry on a medium to high heat for five minutes, until just starting to soften.
Add the aubergine and salt, and cook, stirring frequently, for a further 10 minutes, until the aubergine has started to soften and brown.
Add the garlic, capers, anchovies and olives, and stir-fry for 30 seconds, mashing the anchovies well.
Add the tinned tomatoes, bring to a boil, then turn down to a simmer and cook for 10 minutes.
Just before the sauce is ready, bring a large pan of water to a boil, then drop in the gnocchi and cook according to the packet instructions (usually on a rolling boil for two to three minutes).
Drain well, then stir the gnocchi through the sauce.
Heat the grill to medium-high.
Scatter the mozzarella all over the gnocchi.
Mix the breadcrumbs and parmesan in a bowl, then scatter this over the mozzarella.
Grill for three to five minutes, until the cheese has melted and the breadcrumbs and parmesan are well-browned, then serve hot.
