[PATCH v3 0/7] kdb: Refactor and fix bugs in kdb_read()