Skip to content

Commit

Permalink
target/mips32: check read regs result in save context
Browse files Browse the repository at this point in the history
Add result check for mips32_pracc_read_regs in mips32_save_context.

Change-Id: Ie796d2b05a9feb11e246c2d0771b52cad4fb70db
Signed-off-by: Walter Ji <[email protected]>
Reviewed-on: https://review.openocd.org/c/openocd/+/7932
Reviewed-by: Oleksij Rempel <[email protected]>
Tested-by: jenkins
Reviewed-by: Antonio Borneo <[email protected]>
  • Loading branch information
709924470 authored and borneoa committed Oct 25, 2023
1 parent 18c64af commit e887cfb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/target/mips32.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,11 @@ int mips32_save_context(struct target *target)
struct mips32_common *mips32 = target_to_mips32(target);

/* read core registers */
mips32_pracc_read_regs(mips32);
int retval = mips32_pracc_read_regs(mips32);
if (retval != ERROR_OK) {
LOG_ERROR("Could not read core registers from target");
return retval;
}

for (i = 0; i < MIPS32_NUM_REGS; i++) {
if (!mips32->core_cache->reg_list[i].valid)
Expand Down

0 comments on commit e887cfb

Please sign in to comment.