prepare_debuginfo: fix 'list index out of range'