In an oven-proof skillet over medium heat, heat a small amount of oil or butter and add the onions and a pinch of white sugar. Cook, stirring often, until onions are golden, about 10 minutes. Remove from pan and place in a small bowl. In the same pan, fry the bacon until browned and slightly crisp. Remove from the pan and combine with the onions.
In the same pan, arrange a layer of sliced potatoes in the bottom of the pan. Sprinkle with 1/3 of the onion/bacon mixture. Add another layer of potatoes and another 1/3 of the onion/bacon mixture. Season lightly with salt and pepper. Add another layer of potatoes and the final 1/3 of the onion/bacon mixture. Top with a final layer of potatoes. Pour about a cup of chicken stock over the potatoes. The goal is to cover the bottom and com up the sides just a bit. You may need a bit more if you skillet is larger.
Increase the heat to medium high and bring the stock to a boil. Cover the pan with a lid or piece of foil and reduce the heat to low. Simmer for 15 - 20 minutes, or until the potatoes are tender.
Heat your oven broiler with the rack in the top position. Uncover the pan and place the skillet under the broiler for about 5 minutes, or until the top potatoes have browned. Remover and top with grated cheese. Return to broiler and heat until cheese is melted and browned, about 5 minutes. If you have any excess stock left in the pan, simply spoon it off.