Preheat the oven to 275 degrees F (135 degrees C).
Mix together onion, garlic, rosemary, thyme, parsley, and basil in an 8-inch square baking pan; spread evenly in the bottom of the pan. Place tomatoes, cut-sides down, on top of the onion mixture. Drizzle olive oil on top. Sprinkle with sugar and season with salt and pepper.
Roast in the preheated oven until tomatoes have started to collapse and are browning around the edges, about 2 1/2 hours.