A Round Rock police officer who accidentally discharged a gun into his right foot Tuesday was attending a workshop to become an instructor for Glock firearms, said Dee Carver, a police spokeswoman.