The continuous accumulation of space debris poses a significant threat to spacecraft on orbit. This paper introduces a dynamic trajectory planning and control framework aimed at ensuring the safe traversal of spacecraft through space debris swarms. Initially, a threat model is established, considering the movement of the debris swarm and the constraints of spacecraft detection range. This model utilizes a dynamically updated, redefined Gaussian mixture model to characterize the threat posed by the debris swarm to spacecraft, with proximity to debris correlating to increased threat levels. Building upon this threat model, four guidance rules are defined, including target guidance, minimal threat, threat threshold, and local path optimization, to facilitate the generation of the shortest collision-free local trajectory for spacecraft. Combining the concept of receding horizon control, an online real-time planning and control framework is formulated for spacecraft navigating through debris swarms. Finally, numerical and semi-physical simulations verify that the proposed framework can stably generate spacecraft safe trajectories and control commands under the threat of numerous dynamic space debris, showing the characteristics of optimal planning trajectory, rapid computation speed and robust safety features.