gdb: LoongArch: Implement the software_single_step gdbarch method
authorTiezhu Yang <yangtiezhu@loongson.cn>
Thu, 2 Jun 2022 06:51:17 +0000 (14:51 +0800)
committerTiezhu Yang <yangtiezhu@loongson.cn>
Thu, 2 Jun 2022 14:43:35 +0000 (22:43 +0800)
commit2e90d0257855fa4661f2da67033286958632ed55
treec9b78eeefafc0e0dee16e613551a77779062ac03
parent625b6eae091709b95471eae92d42dc6bc71e6553
gdb: LoongArch: Implement the software_single_step gdbarch method

When execute the following command on LoongArch:

  make check-gdb TESTS="gdb.base/branch-to-self.exp"

there exist the following failed testcases:

  FAIL: gdb.base/branch-to-self.exp: single-step: si (timeout)
  FAIL: gdb.base/branch-to-self.exp: break-cond: side=host: continue to breakpoint: continue to break (timeout)
  FAIL: gdb.base/branch-to-self.exp: break-cond: side=host: p counter (timeout)

Implement the software_single_step gdbarch method to decode the current
branch instruction and determine the address of the next instruction on
LoongArch to fix the above failed testcases.

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
gdb/loongarch-tdep.c