@samitouri / QOSamiQemu / commits / d1a4a7dfc7

target/sparc: Remove MonitorDef register entries available via gdbstub

All these registers are already provided by via gdbstub parsed XML and handler by the gdb_get_register() helper in the monitor/hmp.c file. Remove as now unreachable code. Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20260219191955.83815-18-philmd@linaro.org>

Philippe Mathieu-Daudé committed Feb 15, 2026 at 02:52 UTC d1a4a7dfc79dc96074ec1a1783c67e5f823b9012
1 file changed -107
target/sparc/monitor.c
-107
@@ -39,114 +39,8 @@ void hmp_info_tlb(Monitor *mon, const QDict *qdict)
39 dump_mmu(env1);
40 }
41
42 -#ifndef TARGET_SPARC64
43 -static target_long monitor_get_psr(Monitor *mon, const struct MonitorDef *md,
44 - int val)
45 -{
46 - CPUArchState *env = mon_get_cpu_env(mon);
47 -
48 - return cpu_get_psr(env);
49 -}
50 -#endif
51 -
52 -static target_long monitor_get_reg(Monitor *mon, const struct MonitorDef *md,
53 - int val)
54 -{
55 - CPUArchState *env = mon_get_cpu_env(mon);
56 - return env->regwptr[val];
57 -}
58 -
42 const MonitorDef monitor_defs[] = {
60 - { "g0", offsetof(CPUSPARCState, gregs[0]) },
61 - { "g1", offsetof(CPUSPARCState, gregs[1]) },
62 - { "g2", offsetof(CPUSPARCState, gregs[2]) },
63 - { "g3", offsetof(CPUSPARCState, gregs[3]) },
64 - { "g4", offsetof(CPUSPARCState, gregs[4]) },
65 - { "g5", offsetof(CPUSPARCState, gregs[5]) },
66 - { "g6", offsetof(CPUSPARCState, gregs[6]) },
67 - { "g7", offsetof(CPUSPARCState, gregs[7]) },
68 - { "o0", 0, monitor_get_reg },
69 - { "o1", 1, monitor_get_reg },
70 - { "o2", 2, monitor_get_reg },
71 - { "o3", 3, monitor_get_reg },
72 - { "o4", 4, monitor_get_reg },
73 - { "o5", 5, monitor_get_reg },
74 - { "o6", 6, monitor_get_reg },
75 - { "o7", 7, monitor_get_reg },
76 - { "l0", 8, monitor_get_reg },
77 - { "l1", 9, monitor_get_reg },
78 - { "l2", 10, monitor_get_reg },
79 - { "l3", 11, monitor_get_reg },
80 - { "l4", 12, monitor_get_reg },
81 - { "l5", 13, monitor_get_reg },
82 - { "l6", 14, monitor_get_reg },
83 - { "l7", 15, monitor_get_reg },
84 - { "i0", 16, monitor_get_reg },
85 - { "i1", 17, monitor_get_reg },
86 - { "i2", 18, monitor_get_reg },
87 - { "i3", 19, monitor_get_reg },
88 - { "i4", 20, monitor_get_reg },
89 - { "i5", 21, monitor_get_reg },
90 - { "i6", 22, monitor_get_reg },
91 - { "i7", 23, monitor_get_reg },
92 - { "pc", offsetof(CPUSPARCState, pc) },
93 - { "npc", offsetof(CPUSPARCState, npc) },
94 - { "y", offsetof(CPUSPARCState, y) },
95 -#ifndef TARGET_SPARC64
96 - { "psr", 0, &monitor_get_psr, },
97 - { "wim", offsetof(CPUSPARCState, wim) },
98 -#endif
99 - { "tbr", offsetof(CPUSPARCState, tbr) },
100 - { "fsr", offsetof(CPUSPARCState, fsr) },
101 - { "f0", offsetof(CPUSPARCState, fpr[0].l.upper) },
102 - { "f1", offsetof(CPUSPARCState, fpr[0].l.lower) },
103 - { "f2", offsetof(CPUSPARCState, fpr[1].l.upper) },
104 - { "f3", offsetof(CPUSPARCState, fpr[1].l.lower) },
105 - { "f4", offsetof(CPUSPARCState, fpr[2].l.upper) },
106 - { "f5", offsetof(CPUSPARCState, fpr[2].l.lower) },
107 - { "f6", offsetof(CPUSPARCState, fpr[3].l.upper) },
108 - { "f7", offsetof(CPUSPARCState, fpr[3].l.lower) },
109 - { "f8", offsetof(CPUSPARCState, fpr[4].l.upper) },
110 - { "f9", offsetof(CPUSPARCState, fpr[4].l.lower) },
111 - { "f10", offsetof(CPUSPARCState, fpr[5].l.upper) },
112 - { "f11", offsetof(CPUSPARCState, fpr[5].l.lower) },
113 - { "f12", offsetof(CPUSPARCState, fpr[6].l.upper) },
114 - { "f13", offsetof(CPUSPARCState, fpr[6].l.lower) },
115 - { "f14", offsetof(CPUSPARCState, fpr[7].l.upper) },
116 - { "f15", offsetof(CPUSPARCState, fpr[7].l.lower) },
117 - { "f16", offsetof(CPUSPARCState, fpr[8].l.upper) },
118 - { "f17", offsetof(CPUSPARCState, fpr[8].l.lower) },
119 - { "f18", offsetof(CPUSPARCState, fpr[9].l.upper) },
120 - { "f19", offsetof(CPUSPARCState, fpr[9].l.lower) },
121 - { "f20", offsetof(CPUSPARCState, fpr[10].l.upper) },
122 - { "f21", offsetof(CPUSPARCState, fpr[10].l.lower) },
123 - { "f22", offsetof(CPUSPARCState, fpr[11].l.upper) },
124 - { "f23", offsetof(CPUSPARCState, fpr[11].l.lower) },
125 - { "f24", offsetof(CPUSPARCState, fpr[12].l.upper) },
126 - { "f25", offsetof(CPUSPARCState, fpr[12].l.lower) },
127 - { "f26", offsetof(CPUSPARCState, fpr[13].l.upper) },
128 - { "f27", offsetof(CPUSPARCState, fpr[13].l.lower) },
129 - { "f28", offsetof(CPUSPARCState, fpr[14].l.upper) },
130 - { "f29", offsetof(CPUSPARCState, fpr[14].l.lower) },
131 - { "f30", offsetof(CPUSPARCState, fpr[15].l.upper) },
132 - { "f31", offsetof(CPUSPARCState, fpr[15].l.lower) },
43 #ifdef TARGET_SPARC64
134 - { "f32", offsetof(CPUSPARCState, fpr[16]) },
135 - { "f34", offsetof(CPUSPARCState, fpr[17]) },
136 - { "f36", offsetof(CPUSPARCState, fpr[18]) },
137 - { "f38", offsetof(CPUSPARCState, fpr[19]) },
138 - { "f40", offsetof(CPUSPARCState, fpr[20]) },
139 - { "f42", offsetof(CPUSPARCState, fpr[21]) },
140 - { "f44", offsetof(CPUSPARCState, fpr[22]) },
141 - { "f46", offsetof(CPUSPARCState, fpr[23]) },
142 - { "f48", offsetof(CPUSPARCState, fpr[24]) },
143 - { "f50", offsetof(CPUSPARCState, fpr[25]) },
144 - { "f52", offsetof(CPUSPARCState, fpr[26]) },
145 - { "f54", offsetof(CPUSPARCState, fpr[27]) },
146 - { "f56", offsetof(CPUSPARCState, fpr[28]) },
147 - { "f58", offsetof(CPUSPARCState, fpr[29]) },
148 - { "f60", offsetof(CPUSPARCState, fpr[30]) },
149 - { "f62", offsetof(CPUSPARCState, fpr[31]) },
44 { "asi", offsetof(CPUSPARCState, asi) },
45 { "pstate", offsetof(CPUSPARCState, pstate) },
46 { "cansave", offsetof(CPUSPARCState, cansave) },
@@ -154,7 +48,6 @@ const MonitorDef monitor_defs[] = {
48 { "otherwin", offsetof(CPUSPARCState, otherwin) },
49 { "wstate", offsetof(CPUSPARCState, wstate) },
50 { "cleanwin", offsetof(CPUSPARCState, cleanwin) },
157 - { "fprs", offsetof(CPUSPARCState, fprs), NULL, MD_I32 },
51 #endif
52 { NULL },
53 };