Fix several bugs in the windbg and cris. thanks to coverity