Program debugging is one of the most time-consuming parts of the software development cycle. In recent years, automatic debugging has been an active research area in software engineering; it has also attracted attention from the AI community. However, existing approaches are mostly experiential; moreover, those model-based approaches are based on abstract models of programs, which lends an experiential flavor to the approaches, due to the heuristic nature of choosing an abstract model. We believe that it is necessary to establish a precise theoretical foundation for debugging from first principles. In this paper, we present a first step towards this foundation: using Reiter's theoretical framework of modelbased diagnosis, we give a clean formalization of the program debugging task in the situation calculus, a logical language suitable for describing dynamic worlds. Examples are given to illustrate our formalization.