Local and on-chip debugging