tdesc_create_reg (feature, "r29", regnum++, 1, "general", 32, "uint32");
tdesc_create_reg (feature, "r30", regnum++, 1, "general", 32, "uint32");
tdesc_create_reg (feature, "r31", regnum++, 1, "general", 32, "uint32");
+ tdesc_create_reg (feature, "orig_a0", regnum++, 1, "general", 32, "uint32");
tdesc_create_reg (feature, "pc", regnum++, 1, "general", 32, "code_ptr");
tdesc_create_reg (feature, "badv", regnum++, 1, "general", 32, "code_ptr");
return regnum;
<reg name="r29" bitsize="32" type="uint32" group="general"/>
<reg name="r30" bitsize="32" type="uint32" group="general"/>
<reg name="r31" bitsize="32" type="uint32" group="general"/>
+ <reg name="orig_a0" bitsize="32" type="uint32" group="general"/>
<reg name="pc" bitsize="32" type="code_ptr" group="general"/>
<reg name="badv" bitsize="32" type="code_ptr" group="general"/>
</feature>
tdesc_create_reg (feature, "r29", regnum++, 1, "general", 64, "uint64");
tdesc_create_reg (feature, "r30", regnum++, 1, "general", 64, "uint64");
tdesc_create_reg (feature, "r31", regnum++, 1, "general", 64, "uint64");
+ tdesc_create_reg (feature, "orig_a0", regnum++, 1, "general", 64, "uint64");
tdesc_create_reg (feature, "pc", regnum++, 1, "general", 64, "code_ptr");
tdesc_create_reg (feature, "badv", regnum++, 1, "general", 64, "code_ptr");
return regnum;
<reg name="r29" bitsize="64" type="uint64" group="general"/>
<reg name="r30" bitsize="64" type="uint64" group="general"/>
<reg name="r31" bitsize="64" type="uint64" group="general"/>
+ <reg name="orig_a0" bitsize="64" type="uint64" group="general"/>
<reg name="pc" bitsize="64" type="code_ptr" group="general"/>
<reg name="badv" bitsize="64" type="code_ptr" group="general"/>
</feature>
elf_gregset_t regset;
if (regnum == -1 || (regnum >= 0 && regnum < 32)
+ || regnum == LOONGARCH_ORIG_A0_REGNUM
|| regnum == LOONGARCH_PC_REGNUM
|| regnum == LOONGARCH_BADV_REGNUM)
{
elf_gregset_t regset;
if (regnum == -1 || (regnum >= 0 && regnum < 32)
+ || regnum == LOONGARCH_ORIG_A0_REGNUM
|| regnum == LOONGARCH_PC_REGNUM
|| regnum == LOONGARCH_BADV_REGNUM)
{
regcache->raw_supply (i, (const void *) buf);
}
+ buf = (const gdb_byte*) gprs + regsize * LOONGARCH_ORIG_A0_REGNUM;
+ regcache->raw_supply (LOONGARCH_ORIG_A0_REGNUM, (const void *) buf);
+
buf = (const gdb_byte*) gprs + regsize * LOONGARCH_PC_REGNUM;
regcache->raw_supply (LOONGARCH_PC_REGNUM, (const void *) buf);
else if (regnum == 0)
regcache->raw_supply_zeroed (0);
else if ((regnum > 0 && regnum < 32)
+ || regnum == LOONGARCH_ORIG_A0_REGNUM
|| regnum == LOONGARCH_PC_REGNUM
|| regnum == LOONGARCH_BADV_REGNUM)
{
regcache->raw_collect (i, (void *) buf);
}
+ buf = (gdb_byte *) gprs + regsize * LOONGARCH_ORIG_A0_REGNUM;
+ regcache->raw_collect (LOONGARCH_ORIG_A0_REGNUM, (void *) buf);
+
buf = (gdb_byte *) gprs + regsize * LOONGARCH_PC_REGNUM;
regcache->raw_collect (LOONGARCH_PC_REGNUM, (void *) buf);
regcache->raw_collect (LOONGARCH_BADV_REGNUM, (void *) buf);
}
else if ((regnum >= 0 && regnum < 32)
+ || regnum == LOONGARCH_ORIG_A0_REGNUM
|| regnum == LOONGARCH_PC_REGNUM
|| regnum == LOONGARCH_BADV_REGNUM)
{
for (int i = 0; i < 32; i++)
valid_p &= tdesc_numbered_register (feature_cpu, tdesc_data.get (), regnum++,
loongarch_r_normal_name[i] + 1);
+ valid_p &= tdesc_numbered_register (feature_cpu, tdesc_data.get (), regnum++, "orig_a0");
valid_p &= tdesc_numbered_register (feature_cpu, tdesc_data.get (), regnum++, "pc");
valid_p &= tdesc_numbered_register (feature_cpu, tdesc_data.get (), regnum++, "badv");
if (!valid_p)
LOONGARCH_A0_REGNUM = 4, /* First Argument/Return Value. */
LOONGARCH_A7_REGNUM = 11, /* Seventh Argument/Syscall Number. */
LOONGARCH_FP_REGNUM = 22, /* Frame Pointer. */
- LOONGARCH_PC_REGNUM = 32, /* Program Counter. */
- LOONGARCH_BADV_REGNUM = 33, /* Bad Vaddr for Addressing Exception. */
- LOONGARCH_LINUX_NUM_GREGSET = 45, /* 32 GPR, PC, BADV, RESERVED 11. */
+ LOONGARCH_ORIG_A0_REGNUM = 32, /* Syscall's original arg0. */
+ LOONGARCH_PC_REGNUM = 33, /* Program Counter. */
+ LOONGARCH_BADV_REGNUM = 34, /* Bad Vaddr for Addressing Exception. */
+ LOONGARCH_LINUX_NUM_GREGSET = 45, /* 32 GPR, ORIG_A0, PC, BADV, RESERVED 10. */
};
/* Register set definitions. */