1Cut the onions in half lengthwise; thinly slice crosswise (you should have about 8 cups/2 L). In a large heavy saucepan, melt the butter over medium heat. Add the onions and sugar; cook, stirring often, until very soft and coloured, about 30 minutes.
3Pour in 1/2 cup of the broth and bring to a boil. Cook, stirring up any brown bits from the bottom of the pan, until the broth has evaporated. Repeat with another 1/2 cup of the broth. Stir in the remaining broth, the garlic, thyme, pepper and salt. Bring to a boil, reduce the heat and simmer gently for 15 minutes, stirring occasionally. (Make-ahead: Cool, cover and refrigerate for up to 3 days. Gently reheat.)
5Toast the bread slices until golden. Place four ovenproof soup bowls on a baking sheet; ladle the soup into them. Sprinkle half the cheese over the soup and place a piece of toast in each bowl. Sprinkle with the remaining cheese. Broil until the cheese melts and is golden, about 3 minutes. Serves 4.