mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 13:27:01 +08:00
elf/coredump: correct register offset after xcp.regs update
The offset should be calculated from pointer xcp.regs Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
@@ -246,8 +246,20 @@ static void elf_emit_note_info(FAR struct elf_dumpinfo_s *cinfo)
|
|||||||
|
|
||||||
for (j = 0; j < nitems(status.pr_regs); j++)
|
for (j = 0; j < nitems(status.pr_regs); j++)
|
||||||
{
|
{
|
||||||
status.pr_regs[j] = *(uintptr_t *)((uint8_t *)tcb +
|
if (tcb->xcp.regs == NULL)
|
||||||
g_tcbinfo.reg_off.p[j]);
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (g_tcbinfo.reg_off.p[j] == UINT16_MAX)
|
||||||
|
{
|
||||||
|
status.pr_regs[j] = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
status.pr_regs[j] = *(uintptr_t *)((uint8_t *)tcb->xcp.regs +
|
||||||
|
g_tcbinfo.reg_off.p[j]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
elf_emit(cinfo, &status, sizeof(status));
|
elf_emit(cinfo, &status, sizeof(status));
|
||||||
|
|||||||
Reference in New Issue
Block a user