The dynamics of dislocation generation at crack tips and the ductile-brittle transition