aboutsummaryrefslogtreecommitdiff
path: root/gdb/csky-tdep.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/csky-tdep.c')
-rw-r--r--gdb/csky-tdep.c1454
1 files changed, 673 insertions, 781 deletions
diff --git a/gdb/csky-tdep.c b/gdb/csky-tdep.c
index df9520f..3d37186 100644
--- a/gdb/csky-tdep.c
+++ b/gdb/csky-tdep.c
@@ -68,47 +68,46 @@ static const reggroup *vr_reggroup;
static const reggroup *mmu_reggroup;
static const reggroup *prof_reggroup;
-static const char *csky_supported_tdesc_feature_names[] = {
- (const char *)"org.gnu.csky.abiv2.gpr",
- (const char *)"org.gnu.csky.abiv2.fpu",
- (const char *)"org.gnu.csky.abiv2.cr",
- (const char *)"org.gnu.csky.abiv2.fvcr",
- (const char *)"org.gnu.csky.abiv2.mmu",
- (const char *)"org.gnu.csky.abiv2.tee",
- (const char *)"org.gnu.csky.abiv2.fpu2",
- (const char *)"org.gnu.csky.abiv2.bank0",
- (const char *)"org.gnu.csky.abiv2.bank1",
- (const char *)"org.gnu.csky.abiv2.bank2",
- (const char *)"org.gnu.csky.abiv2.bank3",
- (const char *)"org.gnu.csky.abiv2.bank4",
- (const char *)"org.gnu.csky.abiv2.bank5",
- (const char *)"org.gnu.csky.abiv2.bank6",
- (const char *)"org.gnu.csky.abiv2.bank7",
- (const char *)"org.gnu.csky.abiv2.bank8",
- (const char *)"org.gnu.csky.abiv2.bank9",
- (const char *)"org.gnu.csky.abiv2.bank10",
- (const char *)"org.gnu.csky.abiv2.bank11",
- (const char *)"org.gnu.csky.abiv2.bank12",
- (const char *)"org.gnu.csky.abiv2.bank13",
- (const char *)"org.gnu.csky.abiv2.bank14",
- (const char *)"org.gnu.csky.abiv2.bank15",
- (const char *)"org.gnu.csky.abiv2.bank16",
- (const char *)"org.gnu.csky.abiv2.bank17",
- (const char *)"org.gnu.csky.abiv2.bank18",
- (const char *)"org.gnu.csky.abiv2.bank19",
- (const char *)"org.gnu.csky.abiv2.bank20",
- (const char *)"org.gnu.csky.abiv2.bank21",
- (const char *)"org.gnu.csky.abiv2.bank22",
- (const char *)"org.gnu.csky.abiv2.bank23",
- (const char *)"org.gnu.csky.abiv2.bank24",
- (const char *)"org.gnu.csky.abiv2.bank25",
- (const char *)"org.gnu.csky.abiv2.bank26",
- (const char *)"org.gnu.csky.abiv2.bank27",
- (const char *)"org.gnu.csky.abiv2.bank28",
- (const char *)"org.gnu.csky.abiv2.bank29",
- (const char *)"org.gnu.csky.abiv2.bank30",
- (const char *)"org.gnu.csky.abiv2.bank31"
-};
+static const char *csky_supported_tdesc_feature_names[]
+ = { (const char *) "org.gnu.csky.abiv2.gpr",
+ (const char *) "org.gnu.csky.abiv2.fpu",
+ (const char *) "org.gnu.csky.abiv2.cr",
+ (const char *) "org.gnu.csky.abiv2.fvcr",
+ (const char *) "org.gnu.csky.abiv2.mmu",
+ (const char *) "org.gnu.csky.abiv2.tee",
+ (const char *) "org.gnu.csky.abiv2.fpu2",
+ (const char *) "org.gnu.csky.abiv2.bank0",
+ (const char *) "org.gnu.csky.abiv2.bank1",
+ (const char *) "org.gnu.csky.abiv2.bank2",
+ (const char *) "org.gnu.csky.abiv2.bank3",
+ (const char *) "org.gnu.csky.abiv2.bank4",
+ (const char *) "org.gnu.csky.abiv2.bank5",
+ (const char *) "org.gnu.csky.abiv2.bank6",
+ (const char *) "org.gnu.csky.abiv2.bank7",
+ (const char *) "org.gnu.csky.abiv2.bank8",
+ (const char *) "org.gnu.csky.abiv2.bank9",
+ (const char *) "org.gnu.csky.abiv2.bank10",
+ (const char *) "org.gnu.csky.abiv2.bank11",
+ (const char *) "org.gnu.csky.abiv2.bank12",
+ (const char *) "org.gnu.csky.abiv2.bank13",
+ (const char *) "org.gnu.csky.abiv2.bank14",
+ (const char *) "org.gnu.csky.abiv2.bank15",
+ (const char *) "org.gnu.csky.abiv2.bank16",
+ (const char *) "org.gnu.csky.abiv2.bank17",
+ (const char *) "org.gnu.csky.abiv2.bank18",
+ (const char *) "org.gnu.csky.abiv2.bank19",
+ (const char *) "org.gnu.csky.abiv2.bank20",
+ (const char *) "org.gnu.csky.abiv2.bank21",
+ (const char *) "org.gnu.csky.abiv2.bank22",
+ (const char *) "org.gnu.csky.abiv2.bank23",
+ (const char *) "org.gnu.csky.abiv2.bank24",
+ (const char *) "org.gnu.csky.abiv2.bank25",
+ (const char *) "org.gnu.csky.abiv2.bank26",
+ (const char *) "org.gnu.csky.abiv2.bank27",
+ (const char *) "org.gnu.csky.abiv2.bank28",
+ (const char *) "org.gnu.csky.abiv2.bank29",
+ (const char *) "org.gnu.csky.abiv2.bank30",
+ (const char *) "org.gnu.csky.abiv2.bank31" };
struct csky_supported_tdesc_register
{
@@ -116,263 +115,217 @@ struct csky_supported_tdesc_register
int num;
};
-static const struct csky_supported_tdesc_register csky_supported_gpr_regs[] = {
- {"r0", 0},
- {"r1", 1},
- {"r2", 2},
- {"r3", 3},
- {"r4", 4},
- {"r5", 5},
- {"r6", 6},
- {"r7", 7},
- {"r8", 8},
- {"r9", 9},
- {"r10", 10},
- {"r11", 11},
- {"r12", 12},
- {"r13", 13},
- {"r14", 14},
- {"r15", 15},
- {"r16", 16},
- {"r17", 17},
- {"r18", 18},
- {"r19", 19},
- {"r20", 20},
- {"r21", 21},
- {"r22", 22},
- {"r23", 23},
- {"r24", 24},
- {"r25", 25},
- {"r26", 26},
- {"r27", 27},
- {"r28", 28},
- {"r28", 28},
- {"r29", 29},
- {"r30", 30},
- {"r31", 31},
- {"hi", CSKY_HI_REGNUM},
- {"lo", CSKY_LO_REGNUM},
- {"pc", CSKY_PC_REGNUM}
-};
+static const struct csky_supported_tdesc_register csky_supported_gpr_regs[]
+ = { { "r0", 0 },
+ { "r1", 1 },
+ { "r2", 2 },
+ { "r3", 3 },
+ { "r4", 4 },
+ { "r5", 5 },
+ { "r6", 6 },
+ { "r7", 7 },
+ { "r8", 8 },
+ { "r9", 9 },
+ { "r10", 10 },
+ { "r11", 11 },
+ { "r12", 12 },
+ { "r13", 13 },
+ { "r14", 14 },
+ { "r15", 15 },
+ { "r16", 16 },
+ { "r17", 17 },
+ { "r18", 18 },
+ { "r19", 19 },
+ { "r20", 20 },
+ { "r21", 21 },
+ { "r22", 22 },
+ { "r23", 23 },
+ { "r24", 24 },
+ { "r25", 25 },
+ { "r26", 26 },
+ { "r27", 27 },
+ { "r28", 28 },
+ { "r28", 28 },
+ { "r29", 29 },
+ { "r30", 30 },
+ { "r31", 31 },
+ { "hi", CSKY_HI_REGNUM },
+ { "lo", CSKY_LO_REGNUM },
+ { "pc", CSKY_PC_REGNUM } };
static const struct csky_supported_tdesc_register csky_supported_fpu_regs[] = {
/* fr0~fr15. */
- {"fr0", CSKY_FR0_REGNUM + 0},
- {"fr1", CSKY_FR0_REGNUM + 1},
- {"fr2", CSKY_FR0_REGNUM + 2},
- {"fr3", CSKY_FR0_REGNUM + 3},
- {"fr4", CSKY_FR0_REGNUM + 4},
- {"fr5", CSKY_FR0_REGNUM + 5},
- {"fr6", CSKY_FR0_REGNUM + 6},
- {"fr7", CSKY_FR0_REGNUM + 7},
- {"fr8", CSKY_FR0_REGNUM + 8},
- {"fr9", CSKY_FR0_REGNUM + 9},
- {"fr10", CSKY_FR0_REGNUM + 10},
- {"fr11", CSKY_FR0_REGNUM + 11},
- {"fr12", CSKY_FR0_REGNUM + 12},
- {"fr13", CSKY_FR0_REGNUM + 13},
- {"fr14", CSKY_FR0_REGNUM + 14},
- {"fr15", CSKY_FR0_REGNUM + 15},
+ { "fr0", CSKY_FR0_REGNUM + 0 },
+ { "fr1", CSKY_FR0_REGNUM + 1 },
+ { "fr2", CSKY_FR0_REGNUM + 2 },
+ { "fr3", CSKY_FR0_REGNUM + 3 },
+ { "fr4", CSKY_FR0_REGNUM + 4 },
+ { "fr5", CSKY_FR0_REGNUM + 5 },
+ { "fr6", CSKY_FR0_REGNUM + 6 },
+ { "fr7", CSKY_FR0_REGNUM + 7 },
+ { "fr8", CSKY_FR0_REGNUM + 8 },
+ { "fr9", CSKY_FR0_REGNUM + 9 },
+ { "fr10", CSKY_FR0_REGNUM + 10 },
+ { "fr11", CSKY_FR0_REGNUM + 11 },
+ { "fr12", CSKY_FR0_REGNUM + 12 },
+ { "fr13", CSKY_FR0_REGNUM + 13 },
+ { "fr14", CSKY_FR0_REGNUM + 14 },
+ { "fr15", CSKY_FR0_REGNUM + 15 },
/* fr16~fr31. */
- {"fr16", CSKY_FR16_REGNUM + 0},
- {"fr17", CSKY_FR16_REGNUM + 1},
- {"fr18", CSKY_FR16_REGNUM + 2},
- {"fr19", CSKY_FR16_REGNUM + 3},
- {"fr20", CSKY_FR16_REGNUM + 4},
- {"fr21", CSKY_FR16_REGNUM + 5},
- {"fr22", CSKY_FR16_REGNUM + 6},
- {"fr23", CSKY_FR16_REGNUM + 7},
- {"fr24", CSKY_FR16_REGNUM + 8},
- {"fr25", CSKY_FR16_REGNUM + 9},
- {"fr26", CSKY_FR16_REGNUM + 10},
- {"fr27", CSKY_FR16_REGNUM + 11},
- {"fr28", CSKY_FR16_REGNUM + 12},
- {"fr29", CSKY_FR16_REGNUM + 13},
- {"fr30", CSKY_FR16_REGNUM + 14},
- {"fr31", CSKY_FR16_REGNUM + 15},
+ { "fr16", CSKY_FR16_REGNUM + 0 },
+ { "fr17", CSKY_FR16_REGNUM + 1 },
+ { "fr18", CSKY_FR16_REGNUM + 2 },
+ { "fr19", CSKY_FR16_REGNUM + 3 },
+ { "fr20", CSKY_FR16_REGNUM + 4 },
+ { "fr21", CSKY_FR16_REGNUM + 5 },
+ { "fr22", CSKY_FR16_REGNUM + 6 },
+ { "fr23", CSKY_FR16_REGNUM + 7 },
+ { "fr24", CSKY_FR16_REGNUM + 8 },
+ { "fr25", CSKY_FR16_REGNUM + 9 },
+ { "fr26", CSKY_FR16_REGNUM + 10 },
+ { "fr27", CSKY_FR16_REGNUM + 11 },
+ { "fr28", CSKY_FR16_REGNUM + 12 },
+ { "fr29", CSKY_FR16_REGNUM + 13 },
+ { "fr30", CSKY_FR16_REGNUM + 14 },
+ { "fr31", CSKY_FR16_REGNUM + 15 },
/* vr0~vr15. */
- {"vr0", CSKY_VR0_REGNUM + 0},
- {"vr1", CSKY_VR0_REGNUM + 1},
- {"vr2", CSKY_VR0_REGNUM + 2},
- {"vr3", CSKY_VR0_REGNUM + 3},
- {"vr4", CSKY_VR0_REGNUM + 4},
- {"vr5", CSKY_VR0_REGNUM + 5},
- {"vr6", CSKY_VR0_REGNUM + 6},
- {"vr7", CSKY_VR0_REGNUM + 7},
- {"vr8", CSKY_VR0_REGNUM + 8},
- {"vr9", CSKY_VR0_REGNUM + 9},
- {"vr10", CSKY_VR0_REGNUM + 10},
- {"vr11", CSKY_VR0_REGNUM + 11},
- {"vr12", CSKY_VR0_REGNUM + 12},
- {"vr13", CSKY_VR0_REGNUM + 13},
- {"vr14", CSKY_VR0_REGNUM + 14},
- {"vr15", CSKY_VR0_REGNUM + 15},
+ { "vr0", CSKY_VR0_REGNUM + 0 },
+ { "vr1", CSKY_VR0_REGNUM + 1 },
+ { "vr2", CSKY_VR0_REGNUM + 2 },
+ { "vr3", CSKY_VR0_REGNUM + 3 },
+ { "vr4", CSKY_VR0_REGNUM + 4 },
+ { "vr5", CSKY_VR0_REGNUM + 5 },
+ { "vr6", CSKY_VR0_REGNUM + 6 },
+ { "vr7", CSKY_VR0_REGNUM + 7 },
+ { "vr8", CSKY_VR0_REGNUM + 8 },
+ { "vr9", CSKY_VR0_REGNUM + 9 },
+ { "vr10", CSKY_VR0_REGNUM + 10 },
+ { "vr11", CSKY_VR0_REGNUM + 11 },
+ { "vr12", CSKY_VR0_REGNUM + 12 },
+ { "vr13", CSKY_VR0_REGNUM + 13 },
+ { "vr14", CSKY_VR0_REGNUM + 14 },
+ { "vr15", CSKY_VR0_REGNUM + 15 },
/* fpu control registers. */
- {"fcr", CSKY_FCR_REGNUM + 0},
- {"fid", CSKY_FCR_REGNUM + 1},
- {"fesr", CSKY_FCR_REGNUM + 2},
+ { "fcr", CSKY_FCR_REGNUM + 0 },
+ { "fid", CSKY_FCR_REGNUM + 1 },
+ { "fesr", CSKY_FCR_REGNUM + 2 },
};
static const struct csky_supported_tdesc_register csky_supported_ar_regs[] = {
- {"ar0", CSKY_AR0_REGNUM + 0},
- {"ar1", CSKY_AR0_REGNUM + 1},
- {"ar2", CSKY_AR0_REGNUM + 2},
- {"ar3", CSKY_AR0_REGNUM + 3},
- {"ar4", CSKY_AR0_REGNUM + 4},
- {"ar5", CSKY_AR0_REGNUM + 5},
- {"ar6", CSKY_AR0_REGNUM + 6},
- {"ar7", CSKY_AR0_REGNUM + 7},
- {"ar8", CSKY_AR0_REGNUM + 8},
- {"ar9", CSKY_AR0_REGNUM + 9},
- {"ar10", CSKY_AR0_REGNUM + 10},
- {"ar11", CSKY_AR0_REGNUM + 11},
- {"ar12", CSKY_AR0_REGNUM + 12},
- {"ar13", CSKY_AR0_REGNUM + 13},
- {"ar14", CSKY_AR0_REGNUM + 14},
- {"ar15", CSKY_AR0_REGNUM + 15},
-};
-
-static const struct csky_supported_tdesc_register csky_supported_bank0_regs[] = {
- {"cr0", CSKY_CR0_REGNUM + 0},
- {"cr1", CSKY_CR0_REGNUM + 1},
- {"cr2", CSKY_CR0_REGNUM + 2},
- {"cr3", CSKY_CR0_REGNUM + 3},
- {"cr4", CSKY_CR0_REGNUM + 4},
- {"cr5", CSKY_CR0_REGNUM + 5},
- {"cr6", CSKY_CR0_REGNUM + 6},
- {"cr7", CSKY_CR0_REGNUM + 7},
- {"cr8", CSKY_CR0_REGNUM + 8},
- {"cr9", CSKY_CR0_REGNUM + 9},
- {"cr10", CSKY_CR0_REGNUM + 10},
- {"cr11", CSKY_CR0_REGNUM + 11},
- {"cr12", CSKY_CR0_REGNUM + 12},
- {"cr13", CSKY_CR0_REGNUM + 13},
- {"cr14", CSKY_CR0_REGNUM + 14},
- {"cr15", CSKY_CR0_REGNUM + 15},
- {"cr16", CSKY_CR0_REGNUM + 16},
- {"cr17", CSKY_CR0_REGNUM + 17},
- {"cr18", CSKY_CR0_REGNUM + 18},
- {"cr19", CSKY_CR0_REGNUM + 19},
- {"cr20", CSKY_CR0_REGNUM + 20},
- {"cr21", CSKY_CR0_REGNUM + 21},
- {"cr22", CSKY_CR0_REGNUM + 22},
- {"cr23", CSKY_CR0_REGNUM + 23},
- {"cr24", CSKY_CR0_REGNUM + 24},
- {"cr25", CSKY_CR0_REGNUM + 25},
- {"cr26", CSKY_CR0_REGNUM + 26},
- {"cr27", CSKY_CR0_REGNUM + 27},
- {"cr28", CSKY_CR0_REGNUM + 28},
- {"cr29", CSKY_CR0_REGNUM + 29},
- {"cr30", CSKY_CR0_REGNUM + 30},
- {"cr31", CSKY_CR0_REGNUM + 31}
-};
-
-static const struct csky_supported_tdesc_register csky_supported_mmu_regs[] = {
- {"mcr0", 128},
- {"mcr2", 129},
- {"mcr3", 130},
- {"mcr4", 131},
- {"mcr6", 132},
- {"mcr8", 133},
- {"mcr29", 134},
- {"mcr30", 135},
- {"mcr31", 136}
-};
-
-static const struct csky_supported_tdesc_register csky_supported_bank15_regs[] = {
- {"cp15cp1", 253},
- {"cp15cp5", 254},
- {"cp15cp7", 255},
- {"cp15cp9", 256},
- {"cp15cp10", 257},
- {"cp15cp11", 258},
- {"cp15cp12", 259},
- {"cp15cp13", 260},
- {"cp15cp14", 261},
- {"cp15cp15", 262},
- {"cp15cp16", 263},
- {"cp15cp17", 264},
- {"cp15cp18", 265},
- {"cp15cp19", 266},
- {"cp15cp20", 267},
- {"cp15cp21", 268},
- {"cp15cp22", 269},
- {"cp15cp23", 270},
- {"cp15cp24", 271},
- {"cp15cp25", 272},
- {"cp15cp26", 273},
- {"cp15cp27", 274},
- {"cp15cp28", 275},
+ { "ar0", CSKY_AR0_REGNUM + 0 }, { "ar1", CSKY_AR0_REGNUM + 1 },
+ { "ar2", CSKY_AR0_REGNUM + 2 }, { "ar3", CSKY_AR0_REGNUM + 3 },
+ { "ar4", CSKY_AR0_REGNUM + 4 }, { "ar5", CSKY_AR0_REGNUM + 5 },
+ { "ar6", CSKY_AR0_REGNUM + 6 }, { "ar7", CSKY_AR0_REGNUM + 7 },
+ { "ar8", CSKY_AR0_REGNUM + 8 }, { "ar9", CSKY_AR0_REGNUM + 9 },
+ { "ar10", CSKY_AR0_REGNUM + 10 }, { "ar11", CSKY_AR0_REGNUM + 11 },
+ { "ar12", CSKY_AR0_REGNUM + 12 }, { "ar13", CSKY_AR0_REGNUM + 13 },
+ { "ar14", CSKY_AR0_REGNUM + 14 }, { "ar15", CSKY_AR0_REGNUM + 15 },
};
-static const struct csky_supported_tdesc_register csky_supported_alias_regs[] = {
- /* Alias register names for Bank0. */
- {"psr", CSKY_CR0_REGNUM + 0},
- {"vbr", CSKY_CR0_REGNUM + 1},
- {"epsr", CSKY_CR0_REGNUM + 2},
- {"fpsr", CSKY_CR0_REGNUM + 3},
- {"epc", CSKY_CR0_REGNUM + 4},
- {"fpc", CSKY_CR0_REGNUM + 5},
- {"ss0", CSKY_CR0_REGNUM + 6},
- {"ss1", CSKY_CR0_REGNUM + 7},
- {"ss2", CSKY_CR0_REGNUM + 8},
- {"ss3", CSKY_CR0_REGNUM + 9},
- {"ss4", CSKY_CR0_REGNUM + 10},
- {"gcr", CSKY_CR0_REGNUM + 11},
- {"gsr", CSKY_CR0_REGNUM + 12},
- {"cpuid", CSKY_CR0_REGNUM + 13},
- {"ccr", CSKY_CR0_REGNUM + 18},
- {"capr", CSKY_CR0_REGNUM + 19},
- {"pacr", CSKY_CR0_REGNUM + 20},
- {"prsr", CSKY_CR0_REGNUM + 21},
- {"chr", CSKY_CR0_REGNUM + 31},
- /* Alias register names for MMU. */
- {"mir", 128},
- {"mel0", 129},
- {"mel1", 130},
- {"meh", 131},
- {"mpr", 132},
- {"mcir", 133},
- {"mpgd", 134},
- {"msa0", 135},
- {"msa1", 136},
- /* Alias register names for Bank1. */
- {"ebr", 190},
- {"errlc", 195},
- {"erraddr", 196},
- {"errsts", 197},
- {"errinj", 198},
- {"usp", 203},
- {"int_sp", 204},
- {"itcmcr", 211},
- {"dtcmcr", 212},
- {"cindex", 215},
- {"cdata0", 216},
- {"cdata1", 217},
- {"cdata2", 218},
- {"cins", 220},
- /* Alias register names for Bank3. */
- {"sepsr", 221},
- {"t_wssr", 221},
- {"sevbr", 222},
- {"t_wrcr", 222},
- {"seepsr", 223},
- {"seepc", 225},
- {"nsssp", 227},
- {"t_usp", 228},
- {"dcr", 229},
- {"t_pcr", 230},
-};
+static const struct csky_supported_tdesc_register csky_supported_bank0_regs[]
+ = { { "cr0", CSKY_CR0_REGNUM + 0 }, { "cr1", CSKY_CR0_REGNUM + 1 },
+ { "cr2", CSKY_CR0_REGNUM + 2 }, { "cr3", CSKY_CR0_REGNUM + 3 },
+ { "cr4", CSKY_CR0_REGNUM + 4 }, { "cr5", CSKY_CR0_REGNUM + 5 },
+ { "cr6", CSKY_CR0_REGNUM + 6 }, { "cr7", CSKY_CR0_REGNUM + 7 },
+ { "cr8", CSKY_CR0_REGNUM + 8 }, { "cr9", CSKY_CR0_REGNUM + 9 },
+ { "cr10", CSKY_CR0_REGNUM + 10 }, { "cr11", CSKY_CR0_REGNUM + 11 },
+ { "cr12", CSKY_CR0_REGNUM + 12 }, { "cr13", CSKY_CR0_REGNUM + 13 },
+ { "cr14", CSKY_CR0_REGNUM + 14 }, { "cr15", CSKY_CR0_REGNUM + 15 },
+ { "cr16", CSKY_CR0_REGNUM + 16 }, { "cr17", CSKY_CR0_REGNUM + 17 },
+ { "cr18", CSKY_CR0_REGNUM + 18 }, { "cr19", CSKY_CR0_REGNUM + 19 },
+ { "cr20", CSKY_CR0_REGNUM + 20 }, { "cr21", CSKY_CR0_REGNUM + 21 },
+ { "cr22", CSKY_CR0_REGNUM + 22 }, { "cr23", CSKY_CR0_REGNUM + 23 },
+ { "cr24", CSKY_CR0_REGNUM + 24 }, { "cr25", CSKY_CR0_REGNUM + 25 },
+ { "cr26", CSKY_CR0_REGNUM + 26 }, { "cr27", CSKY_CR0_REGNUM + 27 },
+ { "cr28", CSKY_CR0_REGNUM + 28 }, { "cr29", CSKY_CR0_REGNUM + 29 },
+ { "cr30", CSKY_CR0_REGNUM + 30 }, { "cr31", CSKY_CR0_REGNUM + 31 } };
+
+static const struct csky_supported_tdesc_register csky_supported_mmu_regs[]
+ = { { "mcr0", 128 }, { "mcr2", 129 }, { "mcr3", 130 },
+ { "mcr4", 131 }, { "mcr6", 132 }, { "mcr8", 133 },
+ { "mcr29", 134 }, { "mcr30", 135 }, { "mcr31", 136 } };
+
+static const struct csky_supported_tdesc_register csky_supported_bank15_regs[]
+ = {
+ { "cp15cp1", 253 }, { "cp15cp5", 254 }, { "cp15cp7", 255 },
+ { "cp15cp9", 256 }, { "cp15cp10", 257 }, { "cp15cp11", 258 },
+ { "cp15cp12", 259 }, { "cp15cp13", 260 }, { "cp15cp14", 261 },
+ { "cp15cp15", 262 }, { "cp15cp16", 263 }, { "cp15cp17", 264 },
+ { "cp15cp18", 265 }, { "cp15cp19", 266 }, { "cp15cp20", 267 },
+ { "cp15cp21", 268 }, { "cp15cp22", 269 }, { "cp15cp23", 270 },
+ { "cp15cp24", 271 }, { "cp15cp25", 272 }, { "cp15cp26", 273 },
+ { "cp15cp27", 274 }, { "cp15cp28", 275 },
+ };
+
+static const struct csky_supported_tdesc_register csky_supported_alias_regs[]
+ = {
+ /* Alias register names for Bank0. */
+ { "psr", CSKY_CR0_REGNUM + 0 },
+ { "vbr", CSKY_CR0_REGNUM + 1 },
+ { "epsr", CSKY_CR0_REGNUM + 2 },
+ { "fpsr", CSKY_CR0_REGNUM + 3 },
+ { "epc", CSKY_CR0_REGNUM + 4 },
+ { "fpc", CSKY_CR0_REGNUM + 5 },
+ { "ss0", CSKY_CR0_REGNUM + 6 },
+ { "ss1", CSKY_CR0_REGNUM + 7 },
+ { "ss2", CSKY_CR0_REGNUM + 8 },
+ { "ss3", CSKY_CR0_REGNUM + 9 },
+ { "ss4", CSKY_CR0_REGNUM + 10 },
+ { "gcr", CSKY_CR0_REGNUM + 11 },
+ { "gsr", CSKY_CR0_REGNUM + 12 },
+ { "cpuid", CSKY_CR0_REGNUM + 13 },
+ { "ccr", CSKY_CR0_REGNUM + 18 },
+ { "capr", CSKY_CR0_REGNUM + 19 },
+ { "pacr", CSKY_CR0_REGNUM + 20 },
+ { "prsr", CSKY_CR0_REGNUM + 21 },
+ { "chr", CSKY_CR0_REGNUM + 31 },
+ /* Alias register names for MMU. */
+ { "mir", 128 },
+ { "mel0", 129 },
+ { "mel1", 130 },
+ { "meh", 131 },
+ { "mpr", 132 },
+ { "mcir", 133 },
+ { "mpgd", 134 },
+ { "msa0", 135 },
+ { "msa1", 136 },
+ /* Alias register names for Bank1. */
+ { "ebr", 190 },
+ { "errlc", 195 },
+ { "erraddr", 196 },
+ { "errsts", 197 },
+ { "errinj", 198 },
+ { "usp", 203 },
+ { "int_sp", 204 },
+ { "itcmcr", 211 },
+ { "dtcmcr", 212 },
+ { "cindex", 215 },
+ { "cdata0", 216 },
+ { "cdata1", 217 },
+ { "cdata2", 218 },
+ { "cins", 220 },
+ /* Alias register names for Bank3. */
+ { "sepsr", 221 },
+ { "t_wssr", 221 },
+ { "sevbr", 222 },
+ { "t_wrcr", 222 },
+ { "seepsr", 223 },
+ { "seepc", 225 },
+ { "nsssp", 227 },
+ { "t_usp", 228 },
+ { "dcr", 229 },
+ { "t_pcr", 230 },
+ };
/* Functions declaration. */
-static const char *
-csky_pseudo_register_name (struct gdbarch *gdbarch, int regno);
+static const char *csky_pseudo_register_name (struct gdbarch *gdbarch,
+ int regno);
/* Get csky supported registers's count for tdesc xml. */
static int
-csky_get_supported_tdesc_registers_count()
+csky_get_supported_tdesc_registers_count ()
{
int count = 0;
count += ARRAY_SIZE (csky_supported_gpr_regs);
@@ -429,65 +382,65 @@ csky_get_supported_register_by_index (int index)
remain = index % 32;
switch (multi)
{
- case 0: /* Bank1. */
- {
- sprintf (tdesc_reg.name, "cp1cr%d", remain);
- tdesc_reg.num = 189 + remain;
- }
- break;
- case 1: /* Bank2. */
- {
- sprintf (tdesc_reg.name, "cp2cr%d", remain);
- tdesc_reg.num = 276 + remain;
- }
- break;
- case 2: /* Bank3. */
- {
- sprintf (tdesc_reg.name, "cp3cr%d", remain);
- tdesc_reg.num = 221 + remain;
- }
- break;
- case 3: /* Bank4. */
- case 4: /* Bank5. */
- case 5: /* Bank6. */
- case 6: /* Bank7. */
- case 7: /* Bank8. */
- case 8: /* Bank9. */
- case 9: /* Bank10. */
- case 10: /* Bank11. */
- case 11: /* Bank12. */
- case 12: /* Bank13. */
- case 13: /* Bank14. */
- {
- /* Regitsers in Bank4~14 have continuous regno with start 308. */
- sprintf (tdesc_reg.name, "cp%dcr%d", (multi + 1), remain);
- tdesc_reg.num = 308 + ((multi - 3) * 32) + remain;
- }
- break;
- case 14: /* Bank16. */
- case 15: /* Bank17. */
- case 16: /* Bank18. */
- case 17: /* Bank19. */
- case 18: /* Bank20. */
- case 19: /* Bank21. */
- case 20: /* Bank22. */
- case 21: /* Bank23. */
- case 22: /* Bank24. */
- case 23: /* Bank25. */
- case 24: /* Bank26. */
- case 25: /* Bank27. */
- case 26: /* Bank28. */
- case 27: /* Bank29. */
- case 28: /* Bank30. */
- case 29: /* Bank31. */
- {
- /* Regitsers in Bank16~31 have continuous regno with start 660. */
- sprintf (tdesc_reg.name, "cp%dcr%d", (multi + 2), remain);
- tdesc_reg.num = 660 + ((multi - 14) * 32) + remain;
- }
- break;
- default:
- return NULL;
+ case 0: /* Bank1. */
+ {
+ sprintf (tdesc_reg.name, "cp1cr%d", remain);
+ tdesc_reg.num = 189 + remain;
+ }
+ break;
+ case 1: /* Bank2. */
+ {
+ sprintf (tdesc_reg.name, "cp2cr%d", remain);
+ tdesc_reg.num = 276 + remain;
+ }
+ break;
+ case 2: /* Bank3. */
+ {
+ sprintf (tdesc_reg.name, "cp3cr%d", remain);
+ tdesc_reg.num = 221 + remain;
+ }
+ break;
+ case 3: /* Bank4. */
+ case 4: /* Bank5. */
+ case 5: /* Bank6. */
+ case 6: /* Bank7. */
+ case 7: /* Bank8. */
+ case 8: /* Bank9. */
+ case 9: /* Bank10. */
+ case 10: /* Bank11. */
+ case 11: /* Bank12. */
+ case 12: /* Bank13. */
+ case 13: /* Bank14. */
+ {
+ /* Regitsers in Bank4~14 have continuous regno with start 308. */
+ sprintf (tdesc_reg.name, "cp%dcr%d", (multi + 1), remain);
+ tdesc_reg.num = 308 + ((multi - 3) * 32) + remain;
+ }
+ break;
+ case 14: /* Bank16. */
+ case 15: /* Bank17. */
+ case 16: /* Bank18. */
+ case 17: /* Bank19. */
+ case 18: /* Bank20. */
+ case 19: /* Bank21. */
+ case 20: /* Bank22. */
+ case 21: /* Bank23. */
+ case 22: /* Bank24. */
+ case 23: /* Bank25. */
+ case 24: /* Bank26. */
+ case 25: /* Bank27. */
+ case 26: /* Bank28. */
+ case 27: /* Bank29. */
+ case 28: /* Bank30. */
+ case 29: /* Bank31. */
+ {
+ /* Regitsers in Bank16~31 have continuous regno with start 660. */
+ sprintf (tdesc_reg.name, "cp%dcr%d", (multi + 2), remain);
+ tdesc_reg.num = 660 + ((multi - 14) * 32) + remain;
+ }
+ break;
+ default:
+ return NULL;
}
return &tdesc_reg;
}
@@ -497,8 +450,8 @@ csky_get_supported_register_by_index (int index)
static void
print_savedreg_msg (int regno, int offsets[], bool print_continuing)
{
- gdb_printf (gdb_stdlog, "csky: r%d saved at offset 0x%x\n",
- regno, offsets[regno]);
+ gdb_printf (gdb_stdlog, "csky: r%d saved at offset 0x%x\n", regno,
+ offsets[regno]);
if (print_continuing)
gdb_printf (gdb_stdlog, "csky: continuing\n");
}
@@ -587,72 +540,68 @@ csky_write_pc (regcache *regcache, CORE_ADDR val)
/* C-Sky ABI register names. */
-static const char * const csky_register_names[] =
-{
+static const char *const csky_register_names[] = {
/* General registers 0 - 31. */
- "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
- "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
- "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
- "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31",
+ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11",
+ "r12", "r13", "r14", "r15", "r16", "r17", "r18", "r19", "r20", "r21", "r22",
+ "r23", "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31",
/* DSP hilo registers 36 and 37. */
- "", "", "", "", "hi", "lo", "", "",
+ "", "", "", "", "hi", "lo", "", "",
/* FPU/VPU general registers 40 - 71. */
- "fr0", "fr1", "fr2", "fr3", "fr4", "fr5", "fr6", "fr7",
- "fr8", "fr9", "fr10", "fr11", "fr12", "fr13", "fr14", "fr15",
- "vr0", "vr1", "vr2", "vr3", "vr4", "vr5", "vr6", "vr7",
- "vr8", "vr9", "vr10", "vr11", "vr12", "vr13", "vr14", "vr15",
+ "fr0", "fr1", "fr2", "fr3", "fr4", "fr5", "fr6", "fr7", "fr8", "fr9", "fr10",
+ "fr11", "fr12", "fr13", "fr14", "fr15", "vr0", "vr1", "vr2", "vr3", "vr4",
+ "vr5", "vr6", "vr7", "vr8", "vr9", "vr10", "vr11", "vr12", "vr13", "vr14",
+ "vr15",
/* Program counter 72. */
"pc",
/* Optional registers (ar) 73 - 88. */
- "ar0", "ar1", "ar2", "ar3", "ar4", "ar5", "ar6", "ar7",
- "ar8", "ar9", "ar10", "ar11", "ar12", "ar13", "ar14", "ar15",
+ "ar0", "ar1", "ar2", "ar3", "ar4", "ar5", "ar6", "ar7", "ar8", "ar9", "ar10",
+ "ar11", "ar12", "ar13", "ar14", "ar15",
/* Control registers (cr) 89 - 119. */
- "psr", "vbr", "epsr", "fpsr", "epc", "fpc", "ss0", "ss1",
- "ss2", "ss3", "ss4", "gcr", "gsr", "cr13", "cr14", "cr15",
- "cr16", "cr17", "cr18", "cr19", "cr20", "cr21", "cr22", "cr23",
- "cr24", "cr25", "cr26", "cr27", "cr28", "cr29", "cr30", "cr31",
+ "psr", "vbr", "epsr", "fpsr", "epc", "fpc", "ss0", "ss1", "ss2", "ss3",
+ "ss4", "gcr", "gsr", "cr13", "cr14", "cr15", "cr16", "cr17", "cr18", "cr19",
+ "cr20", "cr21", "cr22", "cr23", "cr24", "cr25", "cr26", "cr27", "cr28",
+ "cr29", "cr30", "cr31",
/* FPU/VPU control registers 121 ~ 123. */
/* User sp 127. */
"fid", "fcr", "fesr", "", "", "", "usp",
/* MMU control registers: 128 - 136. */
- "mcr0", "mcr2", "mcr3", "mcr4", "mcr6", "mcr8", "mcr29", "mcr30",
- "mcr31", "", "", "",
+ "mcr0", "mcr2", "mcr3", "mcr4", "mcr6", "mcr8", "mcr29", "mcr30", "mcr31",
+ "", "", "",
/* Profiling control registers 140 - 143. */
/* Profiling software general registers 144 - 157. */
- "profcr0", "profcr1", "profcr2", "profcr3", "profsgr0", "profsgr1",
- "profsgr2", "profsgr3", "profsgr4", "profsgr5", "profsgr6", "profsgr7",
- "profsgr8", "profsgr9", "profsgr10","profsgr11","profsgr12", "profsgr13",
- "", "",
+ "profcr0", "profcr1", "profcr2", "profcr3", "profsgr0", "profsgr1",
+ "profsgr2", "profsgr3", "profsgr4", "profsgr5", "profsgr6", "profsgr7",
+ "profsgr8", "profsgr9", "profsgr10", "profsgr11", "profsgr12", "profsgr13",
+ "", "",
/* Profiling architecture general registers 160 - 174. */
"profagr0", "profagr1", "profagr2", "profagr3", "profagr4", "profagr5",
- "profagr6", "profagr7", "profagr8", "profagr9", "profagr10","profagr11",
- "profagr12","profagr13","profagr14", "",
+ "profagr6", "profagr7", "profagr8", "profagr9", "profagr10", "profagr11",
+ "profagr12", "profagr13", "profagr14", "",
/* Profiling extension general registers 176 - 188. */
"profxgr0", "profxgr1", "profxgr2", "profxgr3", "profxgr4", "profxgr5",
- "profxgr6", "profxgr7", "profxgr8", "profxgr9", "profxgr10","profxgr11",
+ "profxgr6", "profxgr7", "profxgr8", "profxgr9", "profxgr10", "profxgr11",
"profxgr12",
/* Control registers in bank1. */
- "", "", "", "", "", "", "", "",
- "", "", "", "", "", "", "", "",
- "cp1cr16", "cp1cr17", "cp1cr18", "cp1cr19", "cp1cr20", "", "", "",
- "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "cp1cr16",
+ "cp1cr17", "cp1cr18", "cp1cr19", "cp1cr20", "", "", "", "", "", "", "", "",
+ "", "", "",
/* Control registers in bank3 (ICE). */
- "sepsr", "sevbr", "seepsr", "", "seepc", "", "nsssp", "seusp",
- "sedcr", "", "", "", "", "", "", "",
- "", "", "", "", "", "", "", "",
- "", "", "", "", "", "", "", ""
+ "sepsr", "sevbr", "seepsr", "", "seepc", "", "nsssp", "seusp", "sedcr", "",
+ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
+ "", "", ""
};
/* Implement the register_name gdbarch method. */
@@ -701,8 +650,7 @@ static struct type *
csky_register_type (struct gdbarch *gdbarch, int reg_nr)
{
int num_regs = gdbarch_num_regs (gdbarch);
- csky_gdbarch_tdep *tdep
- = gdbarch_tdep<csky_gdbarch_tdep> (gdbarch);
+ csky_gdbarch_tdep *tdep = gdbarch_tdep<csky_gdbarch_tdep> (gdbarch);
if (tdep->fv_pseudo_registers_count)
{
@@ -723,11 +671,11 @@ csky_register_type (struct gdbarch *gdbarch, int reg_nr)
{
struct type *tdesc_t = tdesc_register_type (gdbarch, reg_nr);
if (tdesc_t)
- return tdesc_t;
+ return tdesc_t;
}
/* PC, EPC, FPC is a text pointer. */
- if ((reg_nr == CSKY_PC_REGNUM) || (reg_nr == CSKY_EPC_REGNUM)
+ if ((reg_nr == CSKY_PC_REGNUM) || (reg_nr == CSKY_EPC_REGNUM)
|| (reg_nr == CSKY_FPC_REGNUM))
return builtin_type (gdbarch)->builtin_func_ptr;
@@ -736,9 +684,9 @@ csky_register_type (struct gdbarch *gdbarch, int reg_nr)
return builtin_type (gdbarch)->builtin_data_ptr;
/* Float register has 64 bits, and only in ck810. */
- if ((reg_nr >=CSKY_FR0_REGNUM) && (reg_nr <= CSKY_FR0_REGNUM + 15))
- return arch_float_type (gdbarch, 64, "builtin_type_csky_ext",
- floatformats_ieee_double);
+ if ((reg_nr >= CSKY_FR0_REGNUM) && (reg_nr <= CSKY_FR0_REGNUM + 15))
+ return arch_float_type (gdbarch, 64, "builtin_type_csky_ext",
+ floatformats_ieee_double);
/* Profiling general register has 48 bits, we use 64bit. */
if ((reg_nr >= CSKY_PROFGR_REGNUM) && (reg_nr <= CSKY_PROFGR_REGNUM + 44))
@@ -757,8 +705,10 @@ csky_register_type (struct gdbarch *gdbarch, int reg_nr)
struct csky_stack_item
{
csky_stack_item (int len_, const gdb_byte *data_)
- : len (len_), data (data_)
- {}
+ : len (len_),
+ data (data_)
+ {
+ }
int len;
const gdb_byte *data;
@@ -768,8 +718,8 @@ struct csky_stack_item
static CORE_ADDR
csky_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
- struct regcache *regcache, CORE_ADDR bp_addr,
- int nargs, struct value **args, CORE_ADDR sp,
+ struct regcache *regcache, CORE_ADDR bp_addr, int nargs,
+ struct value **args, CORE_ADDR sp,
function_call_return_method return_method,
CORE_ADDR struct_addr)
{
@@ -789,8 +739,7 @@ csky_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
{
if (csky_debug)
{
- gdb_printf (gdb_stdlog,
- "csky: struct return in %s = %s\n",
+ gdb_printf (gdb_stdlog, "csky: struct return in %s = %s\n",
gdbarch_register_name (gdbarch, argreg),
paddress (gdbarch, struct_addr));
}
@@ -817,8 +766,7 @@ csky_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
the arguments will always be stored in the low address. */
if (len < 4)
{
- CORE_ADDR regval
- = extract_unsigned_integer (val, len, byte_order);
+ CORE_ADDR regval = extract_unsigned_integer (val, len, byte_order);
regcache_cooked_write_unsigned (regcache, argreg, regval);
argreg++;
}
@@ -831,14 +779,12 @@ csky_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
{
/* The argument is passed in an argument register. */
CORE_ADDR regval
- = extract_unsigned_integer (val, partial_len,
- byte_order);
+ = extract_unsigned_integer (val, partial_len, byte_order);
if (byte_order == BFD_ENDIAN_BIG)
regval <<= (4 - partial_len) * 8;
/* Put regval into register in REGCACHE. */
- regcache_cooked_write_unsigned (regcache, argreg,
- regval);
+ regcache_cooked_write_unsigned (regcache, argreg, regval);
argreg++;
}
else
@@ -889,12 +835,12 @@ csky_return_value (struct gdbarch *gdbarch, struct value *function,
/* By using store_unsigned_integer we avoid having to do
anything special for small big-endian values. */
regcache->cooked_read (ret_regnum, &tmp);
- store_unsigned_integer (readbuf, (len > 4 ? 4 : len),
- byte_order, tmp);
+ store_unsigned_integer (readbuf, (len > 4 ? 4 : len), byte_order,
+ tmp);
if (len > 4)
{
regcache->cooked_read (ret_regnum + 1, &tmp);
- store_unsigned_integer (readbuf + 4, 4, byte_order, tmp);
+ store_unsigned_integer (readbuf + 4, 4, byte_order, tmp);
}
}
if (writebuf != NULL)
@@ -904,12 +850,11 @@ csky_return_value (struct gdbarch *gdbarch, struct value *function,
regcache_cooked_write_unsigned (regcache, ret_regnum, regval);
if (len > 4)
{
- regval = extract_unsigned_integer ((gdb_byte *) writebuf + 4,
- 4, byte_order);
+ regval = extract_unsigned_integer ((gdb_byte *) writebuf + 4, 4,
+ byte_order);
regcache_cooked_write_unsigned (regcache, ret_regnum + 1,
regval);
}
-
}
return RETURN_VALUE_REGISTER_CONVENTION;
}
@@ -951,13 +896,10 @@ struct csky_unwind_cache
after the function prologue. */
static CORE_ADDR
-csky_analyze_prologue (struct gdbarch *gdbarch,
- CORE_ADDR start_pc,
- CORE_ADDR limit_pc,
- CORE_ADDR end_pc,
+csky_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc,
+ CORE_ADDR limit_pc, CORE_ADDR end_pc,
frame_info_ptr this_frame,
- struct csky_unwind_cache *this_cache,
- lr_type_t lr_type)
+ struct csky_unwind_cache *this_cache, lr_type_t lr_type)
{
CORE_ADDR addr;
unsigned int insn, rn;
@@ -982,8 +924,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
{
gdb_printf (gdb_stdlog,
"csky: Scanning prologue: start_pc = 0x%x,"
- "limit_pc = 0x%x\n", (unsigned int) start_pc,
- (unsigned int) limit_pc);
+ "limit_pc = 0x%x\n",
+ (unsigned int) start_pc, (unsigned int) limit_pc);
}
/* Default to 16 bit instruction. */
@@ -1004,8 +946,7 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
int offset = CSKY_32_SUBI_IMM (insn);
if (csky_debug)
{
- gdb_printf (gdb_stdlog,
- "csky: got subi sp,%d; continuing\n",
+ gdb_printf (gdb_stdlog, "csky: got subi sp,%d; continuing\n",
offset);
}
stacksize += offset;
@@ -1030,15 +971,12 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
reg_count = CSKY_32_STM_SIZE (insn);
if (csky_debug)
{
- gdb_printf (gdb_stdlog,
- "csky: got stm r%d-r%d,(sp)\n",
- start_register,
- start_register + reg_count);
+ gdb_printf (gdb_stdlog, "csky: got stm r%d-r%d,(sp)\n",
+ start_register, start_register + reg_count);
}
for (rn = start_register, offset = 0;
- rn <= start_register + reg_count;
- rn++, offset += 4)
+ rn <= start_register + reg_count; rn++, offset += 4)
{
register_offsets[rn] = stacksize - offset;
if (csky_debug)
@@ -1046,8 +984,7 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
gdb_printf (gdb_stdlog,
"csky: r%d saved at 0x%x"
" (offset %d)\n",
- rn, register_offsets[rn],
- offset);
+ rn, register_offsets[rn], offset);
}
}
if (csky_debug)
@@ -1089,7 +1026,7 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
int offset;
/* CSKY_EPSR_REGNUM. */
- rn = CSKY_NUM_GREGS;
+ rn = CSKY_NUM_GREGS;
offset = CSKY_16_STWx0_OFFSET (insn2);
register_offsets[rn] = stacksize - offset;
if (csky_debug)
@@ -1107,7 +1044,7 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
int offset;
/* CSKY_EPSR_REGNUM. */
- rn = CSKY_NUM_GREGS;
+ rn = CSKY_NUM_GREGS;
offset = CSKY_32_ST_OFFSET (insn2);
register_offsets[rn] = framesize - offset;
if (csky_debug)
@@ -1126,13 +1063,12 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
if (insn_len == 2)
{
int stw_regnum = (insn2 >> 5) & 0x7;
- if (CSKY_16_IS_STWx0 (insn2) && (mfcr_regnum
- == stw_regnum))
+ if (CSKY_16_IS_STWx0 (insn2) && (mfcr_regnum == stw_regnum))
{
int offset;
/* CSKY_FPSR_REGNUM. */
- rn = CSKY_NUM_GREGS + 1;
+ rn = CSKY_NUM_GREGS + 1;
offset = CSKY_16_STWx0_OFFSET (insn2);
register_offsets[rn] = stacksize - offset;
if (csky_debug)
@@ -1150,7 +1086,7 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
int offset;
/* CSKY_FPSR_REGNUM. */
- rn = CSKY_NUM_GREGS + 1;
+ rn = CSKY_NUM_GREGS + 1;
offset = CSKY_32_ST_OFFSET (insn2);
register_offsets[rn] = framesize - offset;
if (csky_debug)
@@ -1174,7 +1110,7 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
int offset;
/* CSKY_EPC_REGNUM. */
- rn = CSKY_NUM_GREGS + 2;
+ rn = CSKY_NUM_GREGS + 2;
offset = CSKY_16_STWx0_OFFSET (insn2);
register_offsets[rn] = stacksize - offset;
if (csky_debug)
@@ -1192,7 +1128,7 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
int offset;
/* CSKY_EPC_REGNUM. */
- rn = CSKY_NUM_GREGS + 2;
+ rn = CSKY_NUM_GREGS + 2;
offset = CSKY_32_ST_OFFSET (insn2);
register_offsets[rn] = framesize - offset;
if (csky_debug)
@@ -1216,7 +1152,7 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
int offset;
/* CSKY_FPC_REGNUM. */
- rn = CSKY_NUM_GREGS + 3;
+ rn = CSKY_NUM_GREGS + 3;
offset = CSKY_16_STWx0_OFFSET (insn2);
register_offsets[rn] = stacksize - offset;
if (csky_debug)
@@ -1234,7 +1170,7 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
int offset;
/* CSKY_FPC_REGNUM. */
- rn = CSKY_NUM_GREGS + 3;
+ rn = CSKY_NUM_GREGS + 3;
offset = CSKY_32_ST_OFFSET (insn2);
register_offsets[rn] = framesize - offset;
if (csky_debug)
@@ -1267,15 +1203,15 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
}
for (rn = 16; rn <= 16 + num - 1; rn++)
{
- register_offsets[rn] = stacksize - tmp;
- if (csky_debug)
- {
- gdb_printf (gdb_stdlog,
- "csky: r%d saved at 0x%x"
- " (offset %d)\n", rn,
- register_offsets[rn], tmp);
- }
- tmp += 4;
+ register_offsets[rn] = stacksize - tmp;
+ if (csky_debug)
+ {
+ gdb_printf (gdb_stdlog,
+ "csky: r%d saved at 0x%x"
+ " (offset %d)\n",
+ rn, register_offsets[rn], tmp);
+ }
+ tmp += 4;
}
}
if (CSKY_32_IS_PUSH_R15 (insn))
@@ -1298,15 +1234,15 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
}
for (rn = 4; rn <= 4 + num - 1; rn++)
{
- register_offsets[rn] = stacksize - tmp;
- if (csky_debug)
- {
- gdb_printf (gdb_stdlog,
- "csky: r%d saved at 0x%x"
- " (offset %d)\n", rn,
- register_offsets[rn], tmp);
- }
- tmp += 4;
+ register_offsets[rn] = stacksize - tmp;
+ if (csky_debug)
+ {
+ gdb_printf (gdb_stdlog,
+ "csky: r%d saved at 0x%x"
+ " (offset %d)\n",
+ rn, register_offsets[rn], tmp);
+ }
+ tmp += 4;
}
}
@@ -1324,19 +1260,18 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
if (csky_debug)
{
- gdb_printf (gdb_stdlog,
- "csky: looking at large frame\n");
+ gdb_printf (gdb_stdlog, "csky: looking at large frame\n");
}
if (CSKY_32_IS_LRW4 (insn))
{
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- int literal_addr = (addr + ((insn & 0xffff) << 2))
- & 0xfffffffc;
+ int literal_addr
+ = (addr + ((insn & 0xffff) << 2)) & 0xfffffffc;
adjust = read_memory_unsigned_integer (literal_addr, 4,
byte_order);
}
else if (CSKY_32_IS_MOVI4 (insn))
- adjust = (insn & 0xffff);
+ adjust = (insn & 0xffff);
else if (CSKY_32_IS_MOVIH4 (insn))
adjust = (insn & 0xffff) << 16;
else
@@ -1347,8 +1282,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
if (csky_debug)
{
- gdb_printf (gdb_stdlog,
- "csky: base stacksize=0x%x\n", adjust);
+ gdb_printf (gdb_stdlog, "csky: base stacksize=0x%x\n",
+ adjust);
/* May have zero or more insns which modify r4. */
gdb_printf (gdb_stdlog,
@@ -1365,8 +1300,7 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust += imm;
if (csky_debug)
{
- gdb_printf (gdb_stdlog,
- "csky: addi r4,%d\n", imm);
+ gdb_printf (gdb_stdlog, "csky: addi r4,%d\n", imm);
}
}
else if (CSKY_32_IS_SUBI4 (insn2))
@@ -1375,8 +1309,7 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust -= imm;
if (csky_debug)
{
- gdb_printf (gdb_stdlog,
- "csky: subi r4,%d\n", imm);
+ gdb_printf (gdb_stdlog, "csky: subi r4,%d\n", imm);
}
}
else if (CSKY_32_IS_NOR4 (insn2))
@@ -1384,8 +1317,7 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust = ~adjust;
if (csky_debug)
{
- gdb_printf (gdb_stdlog,
- "csky: nor r4,r4,r4\n");
+ gdb_printf (gdb_stdlog, "csky: nor r4,r4,r4\n");
}
}
else if (CSKY_32_IS_ROTLI4 (insn2))
@@ -1396,8 +1328,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust |= temp;
if (csky_debug)
{
- gdb_printf (gdb_stdlog,
- "csky: rotli r4,r4,%d\n", imm);
+ gdb_printf (gdb_stdlog, "csky: rotli r4,r4,%d\n",
+ imm);
}
}
else if (CSKY_32_IS_LISI4 (insn2))
@@ -1406,8 +1338,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust <<= imm;
if (csky_debug)
{
- gdb_printf (gdb_stdlog,
- "csky: lsli r4,r4,%d\n", imm);
+ gdb_printf (gdb_stdlog, "csky: lsli r4,r4,%d\n",
+ imm);
}
}
else if (CSKY_32_IS_BSETI4 (insn2))
@@ -1416,8 +1348,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust |= (1 << imm);
if (csky_debug)
{
- gdb_printf (gdb_stdlog,
- "csky: bseti r4,r4 %d\n", imm);
+ gdb_printf (gdb_stdlog, "csky: bseti r4,r4 %d\n",
+ imm);
}
}
else if (CSKY_32_IS_BCLRI4 (insn2))
@@ -1426,8 +1358,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust &= ~(1 << imm);
if (csky_debug)
{
- gdb_printf (gdb_stdlog,
- "csky: bclri r4,r4 %d\n", imm);
+ gdb_printf (gdb_stdlog, "csky: bclri r4,r4 %d\n",
+ imm);
}
}
else if (CSKY_32_IS_IXH4 (insn2))
@@ -1435,8 +1367,7 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust *= 3;
if (csky_debug)
{
- gdb_printf (gdb_stdlog,
- "csky: ixh r4,r4,r4\n");
+ gdb_printf (gdb_stdlog, "csky: ixh r4,r4,r4\n");
}
}
else if (CSKY_32_IS_IXW4 (insn2))
@@ -1444,8 +1375,7 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust *= 5;
if (csky_debug)
{
- gdb_printf (gdb_stdlog,
- "csky: ixw r4,r4,r4\n");
+ gdb_printf (gdb_stdlog, "csky: ixw r4,r4,r4\n");
}
}
else if (CSKY_16_IS_ADDI4 (insn2))
@@ -1454,8 +1384,7 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust += imm;
if (csky_debug)
{
- gdb_printf (gdb_stdlog,
- "csky: addi r4,%d\n", imm);
+ gdb_printf (gdb_stdlog, "csky: addi r4,%d\n", imm);
}
}
else if (CSKY_16_IS_SUBI4 (insn2))
@@ -1464,8 +1393,7 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust -= imm;
if (csky_debug)
{
- gdb_printf (gdb_stdlog,
- "csky: subi r4,%d\n", imm);
+ gdb_printf (gdb_stdlog, "csky: subi r4,%d\n", imm);
}
}
else if (CSKY_16_IS_NOR4 (insn2))
@@ -1473,8 +1401,7 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust = ~adjust;
if (csky_debug)
{
- gdb_printf (gdb_stdlog,
- "csky: nor r4,r4\n");
+ gdb_printf (gdb_stdlog, "csky: nor r4,r4\n");
}
}
else if (CSKY_16_IS_BSETI4 (insn2))
@@ -1483,8 +1410,7 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust |= (1 << imm);
if (csky_debug)
{
- gdb_printf (gdb_stdlog,
- "csky: bseti r4, %d\n", imm);
+ gdb_printf (gdb_stdlog, "csky: bseti r4, %d\n", imm);
}
}
else if (CSKY_16_IS_BCLRI4 (insn2))
@@ -1493,8 +1419,7 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust &= ~(1 << imm);
if (csky_debug)
{
- gdb_printf (gdb_stdlog,
- "csky: bclri r4, %d\n", imm);
+ gdb_printf (gdb_stdlog, "csky: bclri r4, %d\n", imm);
}
}
else if (CSKY_16_IS_LSLI4 (insn2))
@@ -1503,19 +1428,19 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust <<= imm;
if (csky_debug)
{
- gdb_printf (gdb_stdlog,
- "csky: lsli r4,r4, %d\n", imm);
+ gdb_printf (gdb_stdlog, "csky: lsli r4,r4, %d\n",
+ imm);
}
}
offset += insn_len;
- insn_len = csky_get_insn (gdbarch, addr + offset, &insn2);
+ insn_len = csky_get_insn (gdbarch, addr + offset, &insn2);
};
if (csky_debug)
{
gdb_printf (gdb_stdlog, "csky: done looking for"
- " r4 adjusters\n");
+ " r4 adjusters\n");
}
/* If the next insn adjusts the stack pointer, we keep
@@ -1529,12 +1454,12 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
{
gdb_printf (gdb_stdlog,
"csky: found stack adjustment of"
- " 0x%x bytes.\n", adjust);
+ " 0x%x bytes.\n",
+ adjust);
gdb_printf (gdb_stdlog,
"csky: skipping to new address %s\n",
core_addr_to_string_nz (addr));
- gdb_printf (gdb_stdlog,
- "csky: continuing\n");
+ gdb_printf (gdb_stdlog, "csky: continuing\n");
}
continue;
}
@@ -1560,8 +1485,7 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
int offset = CSKY_16_SUBI_IMM (insn);
if (csky_debug)
{
- gdb_printf (gdb_stdlog,
- "csky: got subi r0,%d; continuing\n",
+ gdb_printf (gdb_stdlog, "csky: got subi r0,%d; continuing\n",
offset);
}
stacksize += offset;
@@ -1598,7 +1522,7 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
if (csky_debug)
print_savedreg_msg (15, register_offsets, false);
offset += 4;
- }
+ }
if (CSKY_16_PUSH_LIST1 (insn))
{
int num = CSKY_16_PUSH_LIST1 (insn);
@@ -1613,15 +1537,15 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
}
for (rn = 4; rn <= 4 + num - 1; rn++)
{
- register_offsets[rn] = stacksize - tmp;
- if (csky_debug)
- {
- gdb_printf (gdb_stdlog,
- "csky: r%d saved at 0x%x"
- " (offset %d)\n", rn,
- register_offsets[rn], offset);
- }
- tmp += 4;
+ register_offsets[rn] = stacksize - tmp;
+ if (csky_debug)
+ {
+ gdb_printf (gdb_stdlog,
+ "csky: r%d saved at 0x%x"
+ " (offset %d)\n",
+ rn, register_offsets[rn], offset);
+ }
+ tmp += 4;
}
}
@@ -1637,27 +1561,26 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
if (csky_debug)
{
- gdb_printf (gdb_stdlog,
- "csky: looking at large frame\n");
+ gdb_printf (gdb_stdlog, "csky: looking at large frame\n");
}
if (CSKY_16_IS_LRW4 (insn))
{
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
int offset = ((insn & 0x300) >> 3) | (insn & 0x1f);
- int literal_addr = (addr + ( offset << 2)) & 0xfffffffc;
+ int literal_addr = (addr + (offset << 2)) & 0xfffffffc;
adjust = read_memory_unsigned_integer (literal_addr, 4,
byte_order);
}
else
{
/* CSKY_16_IS_MOVI4 (insn). */
- adjust = (insn & 0xff);
+ adjust = (insn & 0xff);
}
if (csky_debug)
{
- gdb_printf (gdb_stdlog,
- "csky: base stacksize=0x%x\n", adjust);
+ gdb_printf (gdb_stdlog, "csky: base stacksize=0x%x\n",
+ adjust);
}
/* May have zero or more instructions which modify r4. */
@@ -1676,8 +1599,7 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust += imm;
if (csky_debug)
{
- gdb_printf (gdb_stdlog,
- "csky: addi r4,%d\n", imm);
+ gdb_printf (gdb_stdlog, "csky: addi r4,%d\n", imm);
}
}
else if (CSKY_32_IS_SUBI4 (insn2))
@@ -1686,8 +1608,7 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust -= imm;
if (csky_debug)
{
- gdb_printf (gdb_stdlog,
- "csky: subi r4,%d\n", imm);
+ gdb_printf (gdb_stdlog, "csky: subi r4,%d\n", imm);
}
}
else if (CSKY_32_IS_NOR4 (insn2))
@@ -1695,8 +1616,7 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust = ~adjust;
if (csky_debug)
{
- gdb_printf (gdb_stdlog,
- "csky: nor r4,r4,r4\n");
+ gdb_printf (gdb_stdlog, "csky: nor r4,r4,r4\n");
}
}
else if (CSKY_32_IS_ROTLI4 (insn2))
@@ -1707,8 +1627,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust |= temp;
if (csky_debug)
{
- gdb_printf (gdb_stdlog,
- "csky: rotli r4,r4,%d\n", imm);
+ gdb_printf (gdb_stdlog, "csky: rotli r4,r4,%d\n",
+ imm);
}
}
else if (CSKY_32_IS_LISI4 (insn2))
@@ -1717,8 +1637,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust <<= imm;
if (csky_debug)
{
- gdb_printf (gdb_stdlog,
- "csky: lsli r4,r4,%d\n", imm);
+ gdb_printf (gdb_stdlog, "csky: lsli r4,r4,%d\n",
+ imm);
}
}
else if (CSKY_32_IS_BSETI4 (insn2))
@@ -1727,8 +1647,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust |= (1 << imm);
if (csky_debug)
{
- gdb_printf (gdb_stdlog,
- "csky: bseti r4,r4 %d\n", imm);
+ gdb_printf (gdb_stdlog, "csky: bseti r4,r4 %d\n",
+ imm);
}
}
else if (CSKY_32_IS_BCLRI4 (insn2))
@@ -1737,8 +1657,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust &= ~(1 << imm);
if (csky_debug)
{
- gdb_printf (gdb_stdlog,
- "csky: bclri r4,r4 %d\n", imm);
+ gdb_printf (gdb_stdlog, "csky: bclri r4,r4 %d\n",
+ imm);
}
}
else if (CSKY_32_IS_IXH4 (insn2))
@@ -1746,8 +1666,7 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust *= 3;
if (csky_debug)
{
- gdb_printf (gdb_stdlog,
- "csky: ixh r4,r4,r4\n");
+ gdb_printf (gdb_stdlog, "csky: ixh r4,r4,r4\n");
}
}
else if (CSKY_32_IS_IXW4 (insn2))
@@ -1755,8 +1674,7 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust *= 5;
if (csky_debug)
{
- gdb_printf (gdb_stdlog,
- "csky: ixw r4,r4,r4\n");
+ gdb_printf (gdb_stdlog, "csky: ixw r4,r4,r4\n");
}
}
else if (CSKY_16_IS_ADDI4 (insn2))
@@ -1765,8 +1683,7 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust += imm;
if (csky_debug)
{
- gdb_printf (gdb_stdlog,
- "csky: addi r4,%d\n", imm);
+ gdb_printf (gdb_stdlog, "csky: addi r4,%d\n", imm);
}
}
else if (CSKY_16_IS_SUBI4 (insn2))
@@ -1775,8 +1692,7 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust -= imm;
if (csky_debug)
{
- gdb_printf (gdb_stdlog,
- "csky: subi r4,%d\n", imm);
+ gdb_printf (gdb_stdlog, "csky: subi r4,%d\n", imm);
}
}
else if (CSKY_16_IS_NOR4 (insn2))
@@ -1784,8 +1700,7 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust = ~adjust;
if (csky_debug)
{
- gdb_printf (gdb_stdlog,
- "csky: nor r4,r4\n");
+ gdb_printf (gdb_stdlog, "csky: nor r4,r4\n");
}
}
else if (CSKY_16_IS_BSETI4 (insn2))
@@ -1794,8 +1709,7 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust |= (1 << imm);
if (csky_debug)
{
- gdb_printf (gdb_stdlog,
- "csky: bseti r4, %d\n", imm);
+ gdb_printf (gdb_stdlog, "csky: bseti r4, %d\n", imm);
}
}
else if (CSKY_16_IS_BCLRI4 (insn2))
@@ -1804,8 +1718,7 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust &= ~(1 << imm);
if (csky_debug)
{
- gdb_printf (gdb_stdlog,
- "csky: bclri r4, %d\n", imm);
+ gdb_printf (gdb_stdlog, "csky: bclri r4, %d\n", imm);
}
}
else if (CSKY_16_IS_LSLI4 (insn2))
@@ -1814,8 +1727,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust <<= imm;
if (csky_debug)
{
- gdb_printf (gdb_stdlog,
- "csky: lsli r4,r4, %d\n", imm);
+ gdb_printf (gdb_stdlog, "csky: lsli r4,r4, %d\n",
+ imm);
}
}
@@ -1826,7 +1739,7 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
if (csky_debug)
{
gdb_printf (gdb_stdlog, "csky: "
- "done looking for r4 adjusters\n");
+ "done looking for r4 adjusters\n");
}
/* If the next instruction adjusts the stack pointer, we keep
@@ -1838,10 +1751,13 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
stacksize += adjust;
if (csky_debug)
{
- gdb_printf (gdb_stdlog, "csky: "
+ gdb_printf (gdb_stdlog,
+ "csky: "
"found stack adjustment of 0x%x"
- " bytes.\n", adjust);
- gdb_printf (gdb_stdlog, "csky: "
+ " bytes.\n",
+ adjust);
+ gdb_printf (gdb_stdlog,
+ "csky: "
"skipping to new address %s\n",
core_addr_to_string_nz (addr));
gdb_printf (gdb_stdlog, "csky: continuing\n");
@@ -1854,7 +1770,7 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
if (csky_debug)
{
gdb_printf (gdb_stdlog, "csky: no subu sp,r4; "
- "NOT altering stacksize.\n");
+ "NOT altering stacksize.\n");
}
break;
}
@@ -1864,7 +1780,7 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
if (csky_debug)
{
gdb_printf (gdb_stdlog, "csky: insn is not a prologue"
- " insn -- ending scan\n");
+ " insn -- ending scan\n");
}
break;
}
@@ -1878,15 +1794,15 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
if (is_fp_saved)
{
this_cache->framereg = CSKY_FP_REGNUM;
- unwound_fp = get_frame_register_unsigned (this_frame,
- this_cache->framereg);
+ unwound_fp
+ = get_frame_register_unsigned (this_frame, this_cache->framereg);
this_cache->prev_sp = unwound_fp + adjust_fp;
}
else
{
this_cache->framereg = CSKY_SP_REGNUM;
- unwound_fp = get_frame_register_unsigned (this_frame,
- this_cache->framereg);
+ unwound_fp
+ = get_frame_register_unsigned (this_frame, this_cache->framereg);
this_cache->prev_sp = unwound_fp + stacksize;
}
@@ -1902,12 +1818,13 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
{
CORE_ADDR rn_value = read_memory_unsigned_integer (
this_cache->saved_regs[rn].addr (), 4, byte_order);
- gdb_printf (gdb_stdlog, "Saved register %s "
- "stored at 0x%08lx, value=0x%08lx\n",
- csky_register_names[rn],
- (unsigned long)
- this_cache->saved_regs[rn].addr (),
- (unsigned long) rn_value);
+ gdb_printf (
+ gdb_stdlog,
+ "Saved register %s "
+ "stored at 0x%08lx, value=0x%08lx\n",
+ csky_register_names[rn],
+ (unsigned long) this_cache->saved_regs[rn].addr (),
+ (unsigned long) rn_value);
}
}
}
@@ -1988,8 +1905,8 @@ csky_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
func_end = pc + default_search_limit;
/* Find the end of prologue. Default lr_type. */
- return csky_analyze_prologue (gdbarch, pc, func_end, func_end,
- NULL, NULL, LR_TYPE_R15);
+ return csky_analyze_prologue (gdbarch, pc, func_end, func_end, NULL, NULL,
+ LR_TYPE_R15);
}
/* Implement the breakpoint_kind_from_pc gdbarch method. */
@@ -2024,8 +1941,8 @@ csky_sw_breakpoint_from_kind (struct gdbarch *gdbarch, int kind, int *size)
/* Determine link register type. */
static lr_type_t
-csky_analyze_lr_type (struct gdbarch *gdbarch,
- CORE_ADDR start_pc, CORE_ADDR end_pc)
+csky_analyze_lr_type (struct gdbarch *gdbarch, CORE_ADDR start_pc,
+ CORE_ADDR end_pc)
{
CORE_ADDR addr;
unsigned int insn, insn_len;
@@ -2054,7 +1971,7 @@ csky_analyze_lr_type (struct gdbarch *gdbarch,
return LR_TYPE_R15;
}
}
- return LR_TYPE_R15;
+ return LR_TYPE_R15;
}
/* Heuristic unwinder. */
@@ -2082,8 +1999,8 @@ csky_frame_unwind_cache (frame_info_ptr this_frame)
prev_pc = get_frame_pc (this_frame);
block_addr = get_frame_address_in_block (this_frame);
- if (find_pc_partial_function (block_addr, NULL, &prologue_start,
- &func_end) == 0)
+ if (find_pc_partial_function (block_addr, NULL, &prologue_start, &func_end)
+ == 0)
/* We couldn't find a function containing block_addr, so bail out
and hope for the best. */
return cache;
@@ -2108,8 +2025,8 @@ csky_frame_unwind_cache (frame_info_ptr this_frame)
prologue_end = std::min (func_end, prev_pc);
/* Analyze the function prologue. */
- csky_analyze_prologue (gdbarch, prologue_start, prologue_end,
- func_end, this_frame, cache, lr_type);
+ csky_analyze_prologue (gdbarch, prologue_start, prologue_end, func_end,
+ this_frame, cache, lr_type);
/* gdbarch_sp_regnum contains the value and not the address. */
cache->saved_regs[sp_regnum].set_value (cache->prev_sp);
@@ -2119,8 +2036,8 @@ csky_frame_unwind_cache (frame_info_ptr this_frame)
/* Implement the this_id function for the normal unwinder. */
static void
-csky_frame_this_id (frame_info_ptr this_frame,
- void **this_prologue_cache, struct frame_id *this_id)
+csky_frame_this_id (frame_info_ptr this_frame, void **this_prologue_cache,
+ struct frame_id *this_id)
{
struct csky_unwind_cache *cache;
struct frame_id id;
@@ -2149,32 +2066,29 @@ csky_frame_prev_register (frame_info_ptr this_frame,
*this_prologue_cache = csky_frame_unwind_cache (this_frame);
cache = (struct csky_unwind_cache *) *this_prologue_cache;
- return trad_frame_get_prev_register (this_frame, cache->saved_regs,
- regnum);
+ return trad_frame_get_prev_register (this_frame, cache->saved_regs, regnum);
}
/* Data structures for the normal prologue-analysis-based
unwinder. */
-static const struct frame_unwind csky_unwind_cache = {
- "cski prologue",
- NORMAL_FRAME,
- default_frame_unwind_stop_reason,
- csky_frame_this_id,
- csky_frame_prev_register,
- NULL,
- default_frame_sniffer,
- NULL,
- NULL
-};
+static const struct frame_unwind csky_unwind_cache
+ = { "cski prologue",
+ NORMAL_FRAME,
+ default_frame_unwind_stop_reason,
+ csky_frame_this_id,
+ csky_frame_prev_register,
+ NULL,
+ default_frame_sniffer,
+ NULL,
+ NULL };
static CORE_ADDR
csky_check_long_branch (frame_info_ptr frame, CORE_ADDR pc)
{
gdb_byte buf[8];
struct gdbarch *gdbarch = get_frame_arch (frame);
- enum bfd_endian byte_order_for_code
- = gdbarch_byte_order_for_code (gdbarch);
+ enum bfd_endian byte_order_for_code = gdbarch_byte_order_for_code (gdbarch);
if (target_read_memory (pc, buf, 8) == 0)
{
@@ -2195,7 +2109,7 @@ csky_check_long_branch (frame_info_ptr frame, CORE_ADDR pc)
if ((data0 == CSKY_LRW_T1_PC_8) && (data1 == CSKY_JMP_T1_VS_NOP))
{
if (target_read_memory (pc + 8, buf, 4) == 0)
- return extract_unsigned_integer (buf, 4, byte_order_for_code);
+ return extract_unsigned_integer (buf, 4, byte_order_for_code);
}
return 0;
@@ -2218,8 +2132,7 @@ csky_stub_unwind_sniffer (const struct frame_unwind *self,
addr_in_block = get_frame_address_in_block (this_frame);
pc = get_frame_pc (this_frame);
- if (in_plt_section (addr_in_block)
- || target_read_memory (pc, dummy, 4) != 0)
+ if (in_plt_section (addr_in_block) || target_read_memory (pc, dummy, 4) != 0)
return 1;
/* Find the starting address and name of the function containing the PC. */
@@ -2249,9 +2162,8 @@ csky_make_stub_cache (frame_info_ptr this_frame)
}
static void
-csky_stub_this_id (frame_info_ptr this_frame,
- void **this_cache,
- struct frame_id *this_id)
+csky_stub_this_id (frame_info_ptr this_frame, void **this_cache,
+ struct frame_id *this_id)
{
struct csky_unwind_cache *cache;
@@ -2264,9 +2176,8 @@ csky_stub_this_id (frame_info_ptr this_frame,
}
static struct value *
-csky_stub_prev_register (frame_info_ptr this_frame,
- void **this_cache,
- int prev_regnum)
+csky_stub_prev_register (frame_info_ptr this_frame, void **this_cache,
+ int prev_regnum)
{
struct csky_unwind_cache *cache;
@@ -2290,15 +2201,13 @@ csky_stub_prev_register (frame_info_ptr this_frame,
prev_regnum);
}
-static frame_unwind csky_stub_unwind = {
- "csky stub",
- NORMAL_FRAME,
- default_frame_unwind_stop_reason,
- csky_stub_this_id,
- csky_stub_prev_register,
- NULL,
- csky_stub_unwind_sniffer
-};
+static frame_unwind csky_stub_unwind = { "csky stub",
+ NORMAL_FRAME,
+ default_frame_unwind_stop_reason,
+ csky_stub_this_id,
+ csky_stub_prev_register,
+ NULL,
+ csky_stub_unwind_sniffer };
/* Implement the this_base, this_locals, and this_args hooks
for the normal unwinder. */
@@ -2315,12 +2224,9 @@ csky_frame_base_address (frame_info_ptr this_frame, void **this_cache)
return cache->prev_sp - cache->framesize;
}
-static const struct frame_base csky_frame_base = {
- &csky_unwind_cache,
- csky_frame_base_address,
- csky_frame_base_address,
- csky_frame_base_address
-};
+static const struct frame_base csky_frame_base
+ = { &csky_unwind_cache, csky_frame_base_address, csky_frame_base_address,
+ csky_frame_base_address };
/* Initialize register access method. */
@@ -2378,22 +2284,18 @@ csky_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
return raw_p;
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))
+ || (regnum == CSKY_PC_REGNUM) || (regnum == CSKY_EPC_REGNUM)
+ || (regnum == CSKY_CR0_REGNUM) || (regnum == CSKY_EPSR_REGNUM))
&& (reggroup == general_reggroup))
return 1;
if (((regnum == CSKY_PC_REGNUM)
- || ((regnum >= CSKY_CR0_REGNUM)
- && (regnum <= CSKY_CR0_REGNUM + 30)))
+ || ((regnum >= CSKY_CR0_REGNUM) && (regnum <= CSKY_CR0_REGNUM + 30)))
&& (reggroup == cr_reggroup))
return 2;
if ((((regnum >= CSKY_VR0_REGNUM) && (regnum <= CSKY_VR0_REGNUM + 15))
- || ((regnum >= CSKY_FCR_REGNUM)
- && (regnum <= CSKY_FCR_REGNUM + 2)))
+ || ((regnum >= CSKY_FCR_REGNUM) && (regnum <= CSKY_FCR_REGNUM + 2)))
&& (reggroup == vr_reggroup))
return 3;
@@ -2401,8 +2303,7 @@ csky_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
&& (reggroup == mmu_reggroup))
return 4;
- if (((regnum >= CSKY_PROFCR_REGNUM)
- && (regnum <= CSKY_PROFCR_REGNUM + 48))
+ if (((regnum >= CSKY_PROFCR_REGNUM) && (regnum <= CSKY_PROFCR_REGNUM + 48))
&& (reggroup == prof_reggroup))
return 5;
@@ -2414,7 +2315,7 @@ csky_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
if (tdesc_has_registers (gdbarch_target_desc (gdbarch)))
{
if (tdesc_register_in_reggroup_p (gdbarch, regnum, reggroup) > 0)
- return 7;
+ return 7;
}
return 0;
@@ -2440,9 +2341,9 @@ csky_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dw_reg)
char name_buf[4];
xsnprintf (name_buf, sizeof (name_buf), "s%d",
- dw_reg - FV_PSEUDO_REGNO_FIRST);
+ dw_reg - FV_PSEUDO_REGNO_FIRST);
return user_reg_map_name_to_regnum (gdbarch, name_buf,
- strlen (name_buf));
+ strlen (name_buf));
}
/* Others, unknown. */
@@ -2454,14 +2355,11 @@ csky_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dw_reg)
static int
csky_essential_reg_check (const struct csky_supported_tdesc_register *reg)
{
- if ((strcmp (reg->name , "pc") == 0)
- && (reg->num == CSKY_PC_REGNUM))
+ if ((strcmp (reg->name, "pc") == 0) && (reg->num == CSKY_PC_REGNUM))
return CSKY_TDESC_REGS_PC_NUMBERED;
- else if ((strcmp (reg->name , "r14") == 0)
- && (reg->num == CSKY_SP_REGNUM))
+ else if ((strcmp (reg->name, "r14") == 0) && (reg->num == CSKY_SP_REGNUM))
return CSKY_TDESC_REGS_SP_NUMBERED;
- else if ((strcmp (reg->name , "r15") == 0)
- && (reg->num == CSKY_LR_REGNUM))
+ else if ((strcmp (reg->name, "r15") == 0) && (reg->num == CSKY_LR_REGNUM))
return CSKY_TDESC_REGS_LR_NUMBERED;
else
return 0;
@@ -2470,13 +2368,14 @@ csky_essential_reg_check (const struct csky_supported_tdesc_register *reg)
/* Check whether xml has discribled the fr0~fr15 regs. */
static int
-csky_fr0_fr15_reg_check (const struct csky_supported_tdesc_register *reg) {
+csky_fr0_fr15_reg_check (const struct csky_supported_tdesc_register *reg)
+{
int i = 0;
for (i = 0; i < 16; i++)
{
if ((strcmp (reg->name, csky_supported_fpu_regs[i].name) == 0)
- && (csky_supported_fpu_regs[i].num == reg->num))
- return (1 << i);
+ && (csky_supported_fpu_regs[i].num == reg->num))
+ return (1 << i);
}
return 0;
@@ -2485,13 +2384,14 @@ csky_fr0_fr15_reg_check (const struct csky_supported_tdesc_register *reg) {
/* Check whether xml has discribled the fr16~fr31 regs. */
static int
-csky_fr16_fr31_reg_check (const struct csky_supported_tdesc_register *reg) {
+csky_fr16_fr31_reg_check (const struct csky_supported_tdesc_register *reg)
+{
int i = 0;
for (i = 0; i < 16; i++)
{
if ((strcmp (reg->name, csky_supported_fpu_regs[i + 16].name) == 0)
- && (csky_supported_fpu_regs[i + 16].num == reg->num))
- return (1 << i);
+ && (csky_supported_fpu_regs[i + 16].num == reg->num))
+ return (1 << i);
}
return 0;
@@ -2500,13 +2400,14 @@ csky_fr16_fr31_reg_check (const struct csky_supported_tdesc_register *reg) {
/* Check whether xml has discribled the vr0~vr15 regs. */
static int
-csky_vr0_vr15_reg_check (const struct csky_supported_tdesc_register *reg) {
+csky_vr0_vr15_reg_check (const struct csky_supported_tdesc_register *reg)
+{
int i = 0;
for (i = 0; i < 16; i++)
{
if ((strcmp (reg->name, csky_supported_fpu_regs[i + 32].name) == 0)
- && (csky_supported_fpu_regs[i + 32].num == reg->num))
- return (1 << i);
+ && (csky_supported_fpu_regs[i + 32].num == reg->num))
+ return (1 << i);
}
return 0;
@@ -2518,41 +2419,39 @@ static const char *
csky_pseudo_register_name (struct gdbarch *gdbarch, int regno)
{
int num_regs = gdbarch_num_regs (gdbarch);
- csky_gdbarch_tdep *tdep
- = gdbarch_tdep<csky_gdbarch_tdep> (gdbarch);
+ csky_gdbarch_tdep *tdep = gdbarch_tdep<csky_gdbarch_tdep> (gdbarch);
regno -= num_regs;
if (tdep->fv_pseudo_registers_count)
{
static const char *const fv_pseudo_names[] = {
- "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7",
- "s8", "s9", "s10", "s11", "s12", "s13", "s14", "s15",
- "s16", "s17", "s18", "s19", "s20", "s21", "s22", "s23",
- "s24", "s25", "s26", "s27", "s28", "s29", "s30", "s31",
- "s32", "s33", "s34", "s35", "s36", "s37", "s38", "s39",
- "s40", "s41", "s42", "s43", "s44", "s45", "s46", "s47",
- "s48", "s49", "s50", "s51", "s52", "s53", "s54", "s55",
- "s56", "s57", "s58", "s59", "s60", "s61", "s62", "s63",
- "s64", "s65", "s66", "s67", "s68", "s69", "s70", "s71",
- "s72", "s73", "s74", "s75", "s76", "s77", "s78", "s79",
- "s80", "s81", "s82", "s83", "s84", "s85", "s86", "s87",
- "s88", "s89", "s90", "s91", "s92", "s93", "s94", "s95",
- "s96", "s97", "s98", "s99", "s100", "s101", "s102", "s103",
- "s104", "s105", "s106", "s107", "s108", "s109", "s110", "s111",
- "s112", "s113", "s114", "s115", "s116", "s117", "s118", "s119",
- "s120", "s121", "s122", "s123", "s124", "s125", "s126", "s127",
+ "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", "s8",
+ "s9", "s10", "s11", "s12", "s13", "s14", "s15", "s16", "s17",
+ "s18", "s19", "s20", "s21", "s22", "s23", "s24", "s25", "s26",
+ "s27", "s28", "s29", "s30", "s31", "s32", "s33", "s34", "s35",
+ "s36", "s37", "s38", "s39", "s40", "s41", "s42", "s43", "s44",
+ "s45", "s46", "s47", "s48", "s49", "s50", "s51", "s52", "s53",
+ "s54", "s55", "s56", "s57", "s58", "s59", "s60", "s61", "s62",
+ "s63", "s64", "s65", "s66", "s67", "s68", "s69", "s70", "s71",
+ "s72", "s73", "s74", "s75", "s76", "s77", "s78", "s79", "s80",
+ "s81", "s82", "s83", "s84", "s85", "s86", "s87", "s88", "s89",
+ "s90", "s91", "s92", "s93", "s94", "s95", "s96", "s97", "s98",
+ "s99", "s100", "s101", "s102", "s103", "s104", "s105", "s106", "s107",
+ "s108", "s109", "s110", "s111", "s112", "s113", "s114", "s115", "s116",
+ "s117", "s118", "s119", "s120", "s121", "s122", "s123", "s124", "s125",
+ "s126", "s127",
};
if (regno < tdep->fv_pseudo_registers_count)
- {
- if ((regno < 64) && ((regno % 4) >= 2) && !tdep->has_vr0)
- return "";
- else if ((regno >= 64) && ((regno % 4) >= 2))
- return "";
- else
- return fv_pseudo_names[regno];
- }
+ {
+ if ((regno < 64) && ((regno % 4) >= 2) && !tdep->has_vr0)
+ return "";
+ else if ((regno >= 64) && ((regno % 4) >= 2))
+ return "";
+ else
+ return fv_pseudo_names[regno];
+ }
}
return "";
@@ -2562,12 +2461,11 @@ csky_pseudo_register_name (struct gdbarch *gdbarch, int regno)
static enum register_status
csky_pseudo_register_read (struct gdbarch *gdbarch,
- struct readable_regcache *regcache,
- int regnum, gdb_byte *buf)
+ struct readable_regcache *regcache, int regnum,
+ gdb_byte *buf)
{
int num_regs = gdbarch_num_regs (gdbarch);
- csky_gdbarch_tdep *tdep
- = gdbarch_tdep<csky_gdbarch_tdep> (gdbarch);
+ csky_gdbarch_tdep *tdep = gdbarch_tdep<csky_gdbarch_tdep> (gdbarch);
regnum -= num_regs;
@@ -2580,31 +2478,31 @@ csky_pseudo_register_read (struct gdbarch *gdbarch,
/* Ensure getting s0~s63 from vrx if tdep->has_vr0 is ture. */
if (tdep->has_vr0)
- {
- if (regnum < 64)
- {
- gdb_regnum = CSKY_VR0_REGNUM + (regnum / 4);
- offset = (regnum % 4) * 4;
- }
- else
- {
- gdb_regnum = CSKY_FR16_REGNUM + ((regnum - 64) / 4);
- if ((regnum % 4) >= 2)
- return REG_UNAVAILABLE;
- offset = (regnum % 2) * 4;
- }
- }
+ {
+ if (regnum < 64)
+ {
+ gdb_regnum = CSKY_VR0_REGNUM + (regnum / 4);
+ offset = (regnum % 4) * 4;
+ }
+ else
+ {
+ gdb_regnum = CSKY_FR16_REGNUM + ((regnum - 64) / 4);
+ if ((regnum % 4) >= 2)
+ return REG_UNAVAILABLE;
+ offset = (regnum % 2) * 4;
+ }
+ }
else
- {
- gdb_regnum = CSKY_FR0_REGNUM + (regnum / 4);
- if ((regnum % 4) >= 2)
- return REG_UNAVAILABLE;
- offset = (regnum % 2) * 4;
- }
+ {
+ gdb_regnum = CSKY_FR0_REGNUM + (regnum / 4);
+ if ((regnum % 4) >= 2)
+ return REG_UNAVAILABLE;
+ offset = (regnum % 2) * 4;
+ }
status = regcache->raw_read (gdb_regnum, reg_buf);
if (status == REG_VALID)
- memcpy (buf, reg_buf + offset, 4);
+ memcpy (buf, reg_buf + offset, 4);
return status;
}
@@ -2615,11 +2513,10 @@ csky_pseudo_register_read (struct gdbarch *gdbarch,
static void
csky_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
- int regnum, const gdb_byte *buf)
+ int regnum, const gdb_byte *buf)
{
int num_regs = gdbarch_num_regs (gdbarch);
- csky_gdbarch_tdep *tdep
- = gdbarch_tdep<csky_gdbarch_tdep> (gdbarch);
+ csky_gdbarch_tdep *tdep = gdbarch_tdep<csky_gdbarch_tdep> (gdbarch);
regnum -= num_regs;
@@ -2630,27 +2527,27 @@ csky_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
int offset = 0;
if (tdep->has_vr0)
- {
- if (regnum < 64)
- {
- gdb_regnum = CSKY_VR0_REGNUM + (regnum / 4);
- offset = (regnum % 4) * 4;
- }
- else
- {
- gdb_regnum = CSKY_FR16_REGNUM + ((regnum - 64) / 4);
- if ((regnum % 4) >= 2)
- return;
- offset = (regnum % 2) * 4;
- }
- }
+ {
+ if (regnum < 64)
+ {
+ gdb_regnum = CSKY_VR0_REGNUM + (regnum / 4);
+ offset = (regnum % 4) * 4;
+ }
+ else
+ {
+ gdb_regnum = CSKY_FR16_REGNUM + ((regnum - 64) / 4);
+ if ((regnum % 4) >= 2)
+ return;
+ offset = (regnum % 2) * 4;
+ }
+ }
else
- {
- gdb_regnum = CSKY_FR0_REGNUM + (regnum / 4);
- if ((regnum % 4) >= 2)
- return;
- offset = (regnum % 2) * 4;
- }
+ {
+ gdb_regnum = CSKY_FR0_REGNUM + (regnum / 4);
+ if ((regnum % 4) >= 2)
+ return;
+ offset = (regnum % 2) * 4;
+ }
regcache->raw_read (gdb_regnum, reg_buf);
memcpy (reg_buf + offset, buf, 4);
@@ -2688,71 +2585,72 @@ csky_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
int numbered = 0;
int index = 0;
int i = 0;
- int feature_names_count = ARRAY_SIZE (csky_supported_tdesc_feature_names);
+ int feature_names_count
+ = ARRAY_SIZE (csky_supported_tdesc_feature_names);
int support_tdesc_regs_count
- = csky_get_supported_tdesc_registers_count();
+ = csky_get_supported_tdesc_registers_count ();
const struct csky_supported_tdesc_register *tdesc_reg;
const struct tdesc_feature *feature;
tdesc_data = tdesc_data_alloc ();
- for (index = 0; index < feature_names_count; index ++)
- {
- feature = tdesc_find_feature (info.target_desc,
- csky_supported_tdesc_feature_names[index]);
- if (feature != NULL)
- {
- for (i = 0; i < support_tdesc_regs_count; i++)
- {
- tdesc_reg = csky_get_supported_register_by_index (i);
- if (!tdesc_reg)
- break;
- numbered = tdesc_numbered_register (feature, tdesc_data.get(),
- tdesc_reg->num,
- tdesc_reg->name);
- if (numbered) {
- valid_p |= csky_essential_reg_check (tdesc_reg);
- has_fr0 |= csky_fr0_fr15_reg_check (tdesc_reg);
- has_fr16 |= csky_fr16_fr31_reg_check (tdesc_reg);
- has_vr0 |= csky_vr0_vr15_reg_check (tdesc_reg);
- if (num_regs < tdesc_reg->num)
- num_regs = tdesc_reg->num;
- }
- }
- }
- }
+ for (index = 0; index < feature_names_count; index++)
+ {
+ feature
+ = tdesc_find_feature (info.target_desc,
+ csky_supported_tdesc_feature_names[index]);
+ if (feature != NULL)
+ {
+ for (i = 0; i < support_tdesc_regs_count; i++)
+ {
+ tdesc_reg = csky_get_supported_register_by_index (i);
+ if (!tdesc_reg)
+ break;
+ numbered
+ = tdesc_numbered_register (feature, tdesc_data.get (),
+ tdesc_reg->num,
+ tdesc_reg->name);
+ if (numbered)
+ {
+ valid_p |= csky_essential_reg_check (tdesc_reg);
+ has_fr0 |= csky_fr0_fr15_reg_check (tdesc_reg);
+ has_fr16 |= csky_fr16_fr31_reg_check (tdesc_reg);
+ has_vr0 |= csky_vr0_vr15_reg_check (tdesc_reg);
+ if (num_regs < tdesc_reg->num)
+ num_regs = tdesc_reg->num;
+ }
+ }
+ }
+ }
if (valid_p != CSKY_TDESC_REGS_ESSENTIAL_VALUE)
- return NULL;
+ return NULL;
}
/* When the type of bfd file is srec(or any files are not elf),
the E_FLAGS will be not credible. */
- if (info.abfd != NULL && bfd_get_flavour (info.abfd) == bfd_target_elf_flavour)
+ if (info.abfd != NULL
+ && bfd_get_flavour (info.abfd) == bfd_target_elf_flavour)
{
/* Get FPU, VDSP build options. */
- fpu_abi = bfd_elf_get_obj_attr_int (info.abfd,
- OBJ_ATTR_PROC,
- Tag_CSKY_FPU_ABI);
- vdsp_version = bfd_elf_get_obj_attr_int (info.abfd,
- OBJ_ATTR_PROC,
- Tag_CSKY_VDSP_VERSION);
- fpu_hardfp = bfd_elf_get_obj_attr_int (info.abfd,
- OBJ_ATTR_PROC,
- Tag_CSKY_FPU_HARDFP);
+ fpu_abi = bfd_elf_get_obj_attr_int (info.abfd, OBJ_ATTR_PROC,
+ Tag_CSKY_FPU_ABI);
+ vdsp_version = bfd_elf_get_obj_attr_int (info.abfd, OBJ_ATTR_PROC,
+ Tag_CSKY_VDSP_VERSION);
+ fpu_hardfp = bfd_elf_get_obj_attr_int (info.abfd, OBJ_ATTR_PROC,
+ Tag_CSKY_FPU_HARDFP);
}
/* Find a candidate among the list of pre-declared architectures. */
- for (arches = gdbarch_list_lookup_by_info (arches, &info);
- arches != NULL;
+ for (arches = gdbarch_list_lookup_by_info (arches, &info); arches != NULL;
arches = gdbarch_list_lookup_by_info (arches->next, &info))
{
csky_gdbarch_tdep *tdep
= gdbarch_tdep<csky_gdbarch_tdep> (arches->gdbarch);
if (fpu_abi != tdep->fpu_abi)
- continue;
+ continue;
if (vdsp_version != tdep->vdsp_version)
- continue;
+ continue;
if (fpu_hardfp != tdep->fpu_hardfp)
- continue;
+ continue;
/* Found a match. */
return arches->gdbarch;
@@ -2771,28 +2669,28 @@ csky_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
if (tdesc_data != NULL)
{
if ((has_vr0 == CSKY_FULL16_ONEHOT_VALUE)
- && (has_fr16 == CSKY_FULL16_ONEHOT_VALUE))
- {
- tdep->has_vr0 = 1;
- tdep->fv_pseudo_registers_count = 128;
- }
+ && (has_fr16 == CSKY_FULL16_ONEHOT_VALUE))
+ {
+ tdep->has_vr0 = 1;
+ tdep->fv_pseudo_registers_count = 128;
+ }
else if ((has_vr0 == CSKY_FULL16_ONEHOT_VALUE)
- && (has_fr16 != CSKY_FULL16_ONEHOT_VALUE))
- {
- tdep->has_vr0 = 1;
- tdep->fv_pseudo_registers_count = 64;
- }
+ && (has_fr16 != CSKY_FULL16_ONEHOT_VALUE))
+ {
+ tdep->has_vr0 = 1;
+ tdep->fv_pseudo_registers_count = 64;
+ }
else if ((has_fr0 == CSKY_FULL16_ONEHOT_VALUE)
- && (has_vr0 != CSKY_FULL16_ONEHOT_VALUE))
- {
- tdep->has_vr0 = 0;
- tdep->fv_pseudo_registers_count = 64;
- }
+ && (has_vr0 != CSKY_FULL16_ONEHOT_VALUE))
+ {
+ tdep->has_vr0 = 0;
+ tdep->fv_pseudo_registers_count = 64;
+ }
else
- {
- tdep->has_vr0 = 0;
- tdep->fv_pseudo_registers_count = 0;
- }
+ {
+ tdep->has_vr0 = 0;
+ tdep->fv_pseudo_registers_count = 0;
+ }
}
else
{
@@ -2859,18 +2757,14 @@ 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);
+ set_gdbarch_register_reggroup_p (gdbarch, csky_register_reggroup_p);
}
if (tdep->fv_pseudo_registers_count)
{
- set_gdbarch_num_pseudo_regs (gdbarch,
- tdep->fv_pseudo_registers_count);
- set_gdbarch_pseudo_register_read (gdbarch,
- csky_pseudo_register_read);
- set_gdbarch_pseudo_register_write (gdbarch,
- csky_pseudo_register_write);
+ set_gdbarch_num_pseudo_regs (gdbarch, tdep->fv_pseudo_registers_count);
+ set_gdbarch_pseudo_register_read (gdbarch, csky_pseudo_register_read);
+ set_gdbarch_pseudo_register_write (gdbarch, csky_pseudo_register_write);
set_tdesc_pseudo_register_name (gdbarch, csky_pseudo_register_name);
}
@@ -2878,20 +2772,18 @@ csky_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
}
void _initialize_csky_tdep ();
+
void
_initialize_csky_tdep ()
{
-
gdbarch_register (bfd_arch_csky, csky_gdbarch_init);
csky_init_reggroup ();
/* Allow debugging this file's internals. */
add_setshow_boolean_cmd ("csky", class_maintenance, &csky_debug,
- _("Set C-Sky debugging."),
- _("Show C-Sky debugging."),
- _("When on, C-Sky specific debugging is enabled."),
- NULL,
- NULL,
- &setdebuglist, &showdebuglist);
+ _ ("Set C-Sky debugging."),
+ _ ("Show C-Sky debugging."),
+ _ ("When on, C-Sky specific debugging is enabled."),
+ NULL, NULL, &setdebuglist, &showdebuglist);
}