public inbox for gdb-cvs@sourceware.org help / color / mirror / Atom feed
From: Jiangshuai Li <jiangshuaili@sourceware.org> To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb/csky modify registers list for general_reggroup Date: Fri, 22 Jul 2022 02:33:59 +0000 (GMT) [thread overview] Message-ID: <20220722023359.1A28D3835839@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=4686f81068433540a8dcf1104548389922e2bfef commit 4686f81068433540a8dcf1104548389922e2bfef Author: Jiangshuai Li <jiangshuai_li@linux.alibaba-inc.com> Date: Fri Jul 22 10:33:14 2022 +0800 gdb/csky modify registers list for general_reggroup There are two modification points here: 1. For the debugging of csky architecture, after executing "info register", we hope to print out GPRs, PC and the registers related to exceptions. 2. With tdesc-xml, users can view the register groups described in XML. Diff: --- gdb/csky-tdep.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/gdb/csky-tdep.c b/gdb/csky-tdep.c index 93534306af5..01d4a0f28cb 100644 --- a/gdb/csky-tdep.c +++ b/gdb/csky-tdep.c @@ -2518,7 +2518,11 @@ csky_register_reggroup_p (struct gdbarch *gdbarch, int regnum, if (reggroup == save_reggroup || reggroup == restore_reggroup) return raw_p; - if (((regnum >= CSKY_R0_REGNUM) && (regnum <= CSKY_R0_REGNUM + 31)) + if ((((regnum >= CSKY_R0_REGNUM) && (regnum <= CSKY_R0_REGNUM + 31)) + || (regnum == CSKY_PC_REGNUM) + || (regnum == CSKY_EPC_REGNUM) + || (regnum == CSKY_CR0_REGNUM) + || (regnum == CSKY_EPSR_REGNUM)) && (reggroup == general_reggroup)) return 1; @@ -2548,6 +2552,12 @@ csky_register_reggroup_p (struct gdbarch *gdbarch, int regnum, && (reggroup == fr_reggroup)) return 6; + if (tdesc_has_registers (gdbarch_target_desc (gdbarch))) + { + if (tdesc_register_in_reggroup_p (gdbarch, regnum, reggroup) > 0) + return 7; + } + return 0; } @@ -2557,16 +2567,16 @@ static int csky_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dw_reg) { /* For GPRs. */ - if (dw_reg >= CSKY_R0_REGNUM && dw_reg <= (CSKY_R0_REGNUM + 31)) + if (dw_reg >= CSKY_R0_REGNUM && dw_reg <= CSKY_R0_REGNUM + 31) return dw_reg; /* For Hi, Lo, PC. */ - if ((dw_reg == CSKY_HI_REGNUM) || (dw_reg == CSKY_LO_REGNUM) - || (dw_reg == CSKY_PC_REGNUM)) + if (dw_reg == CSKY_HI_REGNUM || dw_reg == CSKY_LO_REGNUM + || dw_reg == CSKY_PC_REGNUM) return dw_reg; /* For Float and Vector pseudo registers. */ - if ((dw_reg >= FV_PSEUDO_REGNO_FIRST) && (dw_reg <= FV_PSEUDO_REGNO_LAST)) + if (dw_reg >= FV_PSEUDO_REGNO_FIRST && dw_reg <= FV_PSEUDO_REGNO_LAST) { char name_buf[4]; @@ -3020,6 +3030,8 @@ csky_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_num_regs (gdbarch, (num_regs + 1)); tdesc_use_registers (gdbarch, info.target_desc, std::move (tdesc_data)); set_gdbarch_register_type (gdbarch, csky_register_type); + set_gdbarch_register_reggroup_p (gdbarch, + csky_register_reggroup_p); } if (tdep->fv_pseudo_registers_count)
reply other threads:[~2022-07-22 2:33 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220722023359.1A28D3835839@sourceware.org \ --to=jiangshuaili@sourceware.org \ --cc=gdb-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).