• R/O
  • SSH
  • HTTPS

chibios: Commit


Commit MetaInfo

Revision14337 (tree)
Time2021-04-30 21:44:23
Authorgdisirio

Log Message

Updated RT7 viewer.

Change Summary

Incremental Difference

--- branches/chibistudio_trunk/common/chibistudio_update_site/site.xml (revision 14336)
+++ branches/chibistudio_trunk/common/chibistudio_update_site/site.xml (revision 14337)
@@ -3,7 +3,7 @@
33 <description name="ChibiStudio Update Site" url="http://www.chibios.org/eclipse/chibistudio">
44 ChibiStudio Eclipse Update Site.
55 </description>
6- <feature url="features/org.chibios.eclipse.tools.feature_4.2.0.202102201557.jar" id="org.chibios.eclipse.tools.feature" version="4.2.0.202102201557">
6+ <feature url="features/org.chibios.eclipse.tools.feature_4.2.1.qualifier.jar" id="org.chibios.eclipse.tools.feature" version="4.2.1.qualifier">
77 <category name="chibistudio_components"/>
88 </feature>
99 <category-def name="chibistudio_components" label="ChibiStudio Eclipse Components">
--- branches/chibistudio_trunk/tools/chibios-rt7_debug_support/src/org/chibios/tools/eclipse/debug/utils/KernelObjects.java (revision 14336)
+++ branches/chibistudio_trunk/tools/chibios-rt7_debug_support/src/org/chibios/tools/eclipse/debug/utils/KernelObjects.java (revision 14337)
@@ -61,7 +61,7 @@
6161 // been initialized.
6262 String r_current;
6363 try {
64- r_current = evaluateExpression("(uint32_t)ch.rlist.current");
64+ r_current = evaluateExpression("(uint32_t)ch0.rlist.current");
6565 if (r_current == null)
6666 return true;
6767 } catch (DebugProxyException e) {
@@ -111,10 +111,10 @@
111111 return null;
112112
113113 // rlist structure address.
114- String rlist;
114+ String reglist;
115115 try {
116- rlist = evaluateExpression("(uint32_t)&ch.rlist");
117- if (rlist == null)
116+ reglist = evaluateExpression("(uint32_t)&ch0.reglist");
117+ if (reglist == null)
118118 return null;
119119 } catch (DebugProxyException e) {
120120 throw new DebugProxyException("ready list not found on target");
@@ -125,15 +125,16 @@
125125 // Scanning registry.
126126 LinkedHashMap<String, HashMap<String, String>> lhm =
127127 new LinkedHashMap<String, HashMap<String, String>>(10);
128- String current = rlist;
129- String previous = rlist;
128+ String current_reg = reglist;
129+ String previous_reg = reglist;
130130 while (true) {
131-
131+ String current_thread;
132+
132133 // Fetching next thread in the registry (newer link). This fetch fails
133134 // if the register is not enabled in the kernel and the "newer" field
134135 // does not exist.
135136 try {
136- current = evaluateExpression("(uint32_t)((struct ch_thread *)" + current + ")->newer");
137+ current_reg = evaluateExpression("(uint32_t)((ch_queue_t *)" + current_reg + ")->next");
137138 } catch (DebugProxyException e1) {
138139 throw new DebugProxyException("ChibiOS/RT registry not enabled in kernel");
139140 }
@@ -140,22 +141,30 @@
140141
141142 // This can happen if the kernel is not initialized yet or if the
142143 // registry is corrupted.
143- if (current.compareTo("0") == 0)
144+ if (current_reg.compareTo("0") == 0)
144145 throw new DebugProxyException("ChibiOS/RT registry integrity check failed, NULL pointer");
145146
146147 // TODO: integrity check on the pointer value (alignment, range).
147148
148- // The previous thread in the list is fetched as a integrity check.
149- String older = evaluateExpression("(uint32_t)((struct ch_thread *)" + current + ")->older");
149+ // The previous thread in the list is fetched as an integrity check.
150+ String older = evaluateExpression("(uint32_t)((ch_queue_t *)" + current_reg + ")->prev");
150151 if (older.compareTo("0") == 0)
151152 throw new DebugProxyException("ChibiOS/RT registry integrity check failed, NULL pointer");
152- if (previous.compareTo(older) != 0)
153+ if (previous_reg.compareTo(older) != 0)
153154 throw new DebugProxyException("ChibiOS/RT registry integrity check failed, double linked list violation");
154155
155156 // End of the linked list condition.
156- if (current.compareTo(rlist) == 0)
157+ if (current_reg.compareTo(reglist) == 0)
157158 break;
158159
160+ // Thread associated to this registry entry.
161+ try {
162+ long current_thread_address = evaluateExpressionNumber(current_reg + " - ((char *)(&((thread_t *)0)->rqueue) - (char *)0)");
163+ current_thread = Long.toString(current_thread_address);
164+ } catch (DebugProxyException e1) {
165+ throw new DebugProxyException("ChibiOS/RT registry offset calculation error");
166+ }
167+
159168 // Hash of threads fields.
160169 HashMap<String, String> map = new HashMap<String, String>(16);
161170
@@ -163,7 +172,7 @@
163172 // are optional so are placed within try-catch.
164173 long stklimit;
165174 try {
166- stklimit = evaluateExpressionNumber("(uint32_t)((struct ch_thread *)" + current + ")->wabase");
175+ stklimit = evaluateExpressionNumber("(uint32_t)((struct ch_thread *)" + current_thread + ")->wabase");
167176 map.put("stklimit", Long.toString(stklimit));
168177 } catch (DebugProxyException e) {
169178 map.put("stklimit", "-");
@@ -172,11 +181,11 @@
172181
173182 long stack;
174183 try {
175- stack = evaluateExpressionNumber("(uint32_t)((struct ch_thread *)" + current + ")->ctx.r13");
184+ stack = evaluateExpressionNumber("(uint32_t)((struct ch_thread *)" + current_thread + ")->ctx.r13");
176185 map.put("stack", Long.toString(stack));
177186 } catch (DebugProxyException e) {
178187 try {
179- stack = evaluateExpressionNumber("(uint32_t)((struct ch_thread *)" + current + ")->ctx.sp");
188+ stack = evaluateExpressionNumber("(uint32_t)((struct ch_thread *)" + current_thread + ")->ctx.sp");
180189 map.put("stack", Long.toString(stack));
181190 } catch (DebugProxyException ex) {
182191 map.put("stack", "-");
@@ -197,7 +206,7 @@
197206
198207 long n;
199208 try {
200- n = evaluateExpressionNumber("(uint32_t)((struct ch_thread *)" + current + ")->name");
209+ n = evaluateExpressionNumber("(uint32_t)((struct ch_thread *)" + current_thread + ")->name");
201210 if (n == 0)
202211 map.put("name", "<no name>");
203212 else
@@ -206,7 +215,7 @@
206215 map.put("name", "-");
207216 }
208217
209- n = evaluateExpressionNumber("(uint32_t)((struct ch_thread *)" + current + ")->state");
218+ n = evaluateExpressionNumber("(uint32_t)((struct ch_thread *)" + current_thread + ")->state");
210219 map.put("state", Long.toString(n));
211220 if ((n >= 0) && (n < threadStates.length)) {
212221 map.put("state_s", threadStates[(int)n]);
@@ -214,14 +223,14 @@
214223 else
215224 map.put("state_s", "unknown");
216225
217- n = evaluateExpressionNumber("(uint32_t)((struct ch_thread *)" + current + ")->flags");
226+ n = evaluateExpressionNumber("(uint32_t)((struct ch_thread *)" + current_thread + ")->flags");
218227 map.put("flags", Long.toString(n));
219228
220- n = evaluateExpressionNumber("(uint32_t)((struct ch_thread *)" + current + ")->hdr.pqueue.prio");
229+ n = evaluateExpressionNumber("(uint32_t)((struct ch_thread *)" + current_thread + ")->hdr.pqueue.prio");
221230 map.put("prio", Long.toString(n));
222231
223232 try {
224- n = evaluateExpressionNumber("(uint32_t)((struct ch_thread *)" + current + ")->refs");
233+ n = evaluateExpressionNumber("(uint32_t)((struct ch_thread *)" + current_thread + ")->refs");
225234 map.put("refs", Long.toString(n));
226235 } catch (DebugProxyException e) {
227236 map.put("refs", "-");
@@ -228,7 +237,7 @@
228237 }
229238
230239 try {
231- n = evaluateExpressionNumber("(uint32_t)((struct ch_thread *)" + current + ")->time");
240+ n = evaluateExpressionNumber("(uint32_t)((struct ch_thread *)" + current_thread + ")->time");
232241 map.put("time", Long.toString(n));
233242 } catch (DebugProxyException e) {
234243 map.put("time", "-");
@@ -235,7 +244,7 @@
235244 }
236245
237246 try {
238- n = evaluateExpressionNumber("(uint32_t)((struct ch_thread *)" + current + ")->u.wtobjp");
247+ n = evaluateExpressionNumber("(uint32_t)((struct ch_thread *)" + current_thread + ")->u.wtobjp");
239248 map.put("wtobjp", Long.toString(n));
240249 } catch (DebugProxyException e) {
241250 map.put("wtobjp", "-");
@@ -242,7 +251,7 @@
242251 }
243252
244253 try {
245- n = evaluateExpressionNumber("(uint32_t)((struct ch_thread *)" + current + ")->stats.n");
254+ n = evaluateExpressionNumber("(uint32_t)((struct ch_thread *)" + current_thread + ")->stats.n");
246255 map.put("stats_n", Long.toString(n));
247256 } catch (DebugProxyException e) {
248257 map.put("stats_n", "-");
@@ -249,7 +258,7 @@
249258 }
250259
251260 try {
252- n = evaluateExpressionNumber("(uint32_t)((struct ch_thread *)" + current + ")->stats.worst");
261+ n = evaluateExpressionNumber("(uint32_t)((struct ch_thread *)" + current_thread + ")->stats.worst");
253262 map.put("stats_worst", Long.toString(n));
254263 } catch (DebugProxyException e) {
255264 map.put("stats_worst", "-");
@@ -256,7 +265,7 @@
256265 }
257266
258267 try {
259- n = evaluateExpressionNumber("(uint64_t)((struct ch_thread *)" + current + ")->stats.cumulative");
268+ n = evaluateExpressionNumber("(uint64_t)((struct ch_thread *)" + current_thread + ")->stats.cumulative");
260269 map.put("stats_cumulative", Long.toString(n));
261270 } catch (DebugProxyException e) {
262271 map.put("stats_cumulative", "-");
@@ -263,9 +272,9 @@
263272 }
264273
265274 // Inserting the new thread map into the threads list.
266- lhm.put(current, map);
275+ lhm.put(current_thread, map);
267276
268- previous = current;
277+ previous_reg = current_reg;
269278 }
270279 return lhm;
271280 }
@@ -298,7 +307,7 @@
298307 // Delta list structure address.
299308 String vtlist;
300309 try {
301- vtlist = evaluateExpression("(uint32_t)&ch.vtlist");
310+ vtlist = evaluateExpression("(uint32_t)&ch0.vtlist");
302311 if (vtlist == null)
303312 return null;
304313 } catch (DebugProxyException e) {
@@ -375,7 +384,7 @@
375384 * the target is running.
376385 *
377386 * @throws DebugProxyException If the debugger is active but the structure
378- * @p ch.trace_buffer is not found, not
387+ * @p ch0.trace_buffer is not found, not
379388 * initialized or corrupted.
380389 */
381390 public LinkedHashMap<String, HashMap<String, String>> readTraceBuffer()
@@ -387,7 +396,7 @@
387396 // Trace buffer size.
388397 String s;
389398 try {
390- s = evaluateExpression("(uint32_t)ch.trace_buffer.size");
399+ s = evaluateExpression("(uint32_t)ch0.trace_buffer.size");
391400 if (s == null)
392401 return null;
393402 } catch (DebugProxyException e) {
@@ -398,9 +407,9 @@
398407
399408 int tbsize = (int)HexUtils.parseNumber(s);
400409 int tbrecsize = (int)evaluateExpressionNumber("(uint32_t)sizeof (trace_event_t)");
401- long tbstart = evaluateExpressionNumber("(uint32_t)ch.trace_buffer.buffer");
402- long tbend = evaluateExpressionNumber("(uint32_t)&ch.trace_buffer.buffer[" + tbsize + "]");
403- long tbptr = evaluateExpressionNumber("(uint32_t)ch.trace_buffer.ptr");
410+ long tbstart = evaluateExpressionNumber("(uint32_t)ch0.trace_buffer.buffer");
411+ long tbend = evaluateExpressionNumber("(uint32_t)&ch0.trace_buffer.buffer[" + tbsize + "]");
412+ long tbptr = evaluateExpressionNumber("(uint32_t)ch0.trace_buffer.ptr");
404413
405414 // Scanning the trace buffer from the oldest event to the newest.
406415 LinkedHashMap<String, HashMap<String, String>> lhm =
@@ -505,7 +514,7 @@
505514 LinkedHashMap<String, String> map = new LinkedHashMap<String, String>(16);
506515
507516 try {
508- String vt_lasttime = evaluateExpression("(uint32_t)ch.vtlist.dlist.delta");
517+ String vt_lasttime = evaluateExpression("(uint32_t)ch0.vtlist.dlist.delta");
509518 if (vt_lasttime == null)
510519 return null;
511520 map.put("vt_lasttime", vt_lasttime);
@@ -516,7 +525,7 @@
516525 }
517526
518527 try {
519- String vt_systime = evaluateExpression("(uint32_t)ch.vtlist.systime");
528+ String vt_systime = evaluateExpression("(uint32_t)ch0.vtlist.systime");
520529 if (vt_systime == null)
521530 return null;
522531 map.put("vt_systime", vt_systime);
@@ -523,7 +532,7 @@
523532 } catch (DebugProxyException e) {}
524533
525534 try {
526- String vt_lasttime = evaluateExpression("(uint32_t)ch.vtlist.lasttime");
535+ String vt_lasttime = evaluateExpression("(uint32_t)ch0.vtlist.lasttime");
527536 if (vt_lasttime == null)
528537 return null;
529538 map.put("vt_lasttime", vt_lasttime);
@@ -530,7 +539,7 @@
530539 } catch (DebugProxyException e) {}
531540
532541 try {
533- long r_current = evaluateExpressionNumber("(uint32_t)ch.rlist.current");
542+ long r_current = evaluateExpressionNumber("(uint32_t)ch0.rlist.current");
534543 if (r_current != 0) {
535544 String name;
536545 try {
@@ -549,12 +558,12 @@
549558 } catch (DebugProxyException e) {}
550559
551560 try {
552- String r_preempt = evaluateExpression("(uint32_t)ch.rlist.preempt");
561+ String r_preempt = evaluateExpression("(uint32_t)ch0.rlist.preempt");
553562 map.put("r_preempt", r_preempt);
554563 } catch (DebugProxyException e) {}
555564
556565 try {
557- Long addr = evaluateExpressionNumber("(uint32_t)ch.dbg.panic_msg");
566+ Long addr = evaluateExpressionNumber("(uint32_t)ch0.dbg.panic_msg");
558567 if (addr == 0)
559568 map.put("dbg_panic_msg", "<NULL>");
560569 else
@@ -564,7 +573,7 @@
564573 }
565574
566575 try {
567- Long isr_cnt = evaluateExpressionNumber("(uint32_t)ch.dbg.isr_cnt");
576+ Long isr_cnt = evaluateExpressionNumber("(uint32_t)ch0.dbg.isr_cnt");
568577 if (isr_cnt == 0)
569578 map.put("dbg_isr_cnt", "not within ISR");
570579 else
@@ -574,7 +583,7 @@
574583 }
575584
576585 try {
577- Long lock_cnt = evaluateExpressionNumber("(uint32_t)ch.dbg.lock_cnt");
586+ Long lock_cnt = evaluateExpressionNumber("(uint32_t)ch0.dbg.lock_cnt");
578587 if (lock_cnt == 0)
579588 map.put("dbg_lock_cnt", "not within lock");
580589 else
@@ -613,7 +622,7 @@
613622 // Statistics structure.
614623 String s;
615624 try {
616- s = evaluateExpression("(uint32_t)&ch.kernel_stats");
625+ s = evaluateExpression("(uint32_t)&ch0.kernel_stats");
617626 if (s == null)
618627 return null;
619628 } catch (DebugProxyException e) {
@@ -626,7 +635,7 @@
626635 new LinkedHashMap<String, HashMap<String, String>>(64);
627636
628637 try {
629- long n_irq = evaluateExpressionNumber("(uint32_t)ch.kernel_stats.n_irq");
638+ long n_irq = evaluateExpressionNumber("(uint32_t)ch0.kernel_stats.n_irq");
630639 HashMap<String, String> map = new HashMap<String, String>(4);
631640 map.put("best", "");
632641 map.put("worst", "");
@@ -636,7 +645,7 @@
636645 } catch (DebugProxyException e) {}
637646
638647 try {
639- long n_ctxswc = evaluateExpressionNumber("(uint32_t)ch.kernel_stats.n_ctxswc");
648+ long n_ctxswc = evaluateExpressionNumber("(uint32_t)ch0.kernel_stats.n_ctxswc");
640649 HashMap<String, String> map = new HashMap<String, String>(4);
641650 map.put("best", "");
642651 map.put("worst", "");
@@ -646,10 +655,10 @@
646655 } catch (DebugProxyException e) {}
647656
648657 try {
649- long m_crit_thd_best = evaluateExpressionNumber("(uint32_t)ch.kernel_stats.m_crit_thd.best");
650- long m_crit_thd_worst = evaluateExpressionNumber("(uint32_t)ch.kernel_stats.m_crit_thd.worst");
651- long m_crit_thd_n = evaluateExpressionNumber("(uint32_t)ch.kernel_stats.m_crit_thd.n");
652- String m_crit_thd_cumulative = evaluateExpression("(uint64_t)ch.kernel_stats.m_crit_thd.cumulative");
658+ long m_crit_thd_best = evaluateExpressionNumber("(uint32_t)ch0.kernel_stats.m_crit_thd.best");
659+ long m_crit_thd_worst = evaluateExpressionNumber("(uint32_t)ch0.kernel_stats.m_crit_thd.worst");
660+ long m_crit_thd_n = evaluateExpressionNumber("(uint32_t)ch0.kernel_stats.m_crit_thd.n");
661+ String m_crit_thd_cumulative = evaluateExpression("(uint64_t)ch0.kernel_stats.m_crit_thd.cumulative");
653662 HashMap<String, String> map = new HashMap<String, String>(4);
654663 map.put("best", Long.toString(m_crit_thd_best));
655664 map.put("worst", Long.toString(m_crit_thd_worst));
@@ -659,10 +668,10 @@
659668 } catch (DebugProxyException e) {}
660669
661670 try {
662- long m_crit_isr_best = evaluateExpressionNumber("(uint32_t)ch.kernel_stats.m_crit_isr.best");
663- long m_crit_isr_worst = evaluateExpressionNumber("(uint32_t)ch.kernel_stats.m_crit_isr.worst");
664- long m_crit_isr_n = evaluateExpressionNumber("(uint32_t)ch.kernel_stats.m_crit_isr.n");
665- String m_crit_isr_cumulative = evaluateExpression("(uint64_t)ch.kernel_stats.m_crit_isr.cumulative");
671+ long m_crit_isr_best = evaluateExpressionNumber("(uint32_t)ch0.kernel_stats.m_crit_isr.best");
672+ long m_crit_isr_worst = evaluateExpressionNumber("(uint32_t)ch0.kernel_stats.m_crit_isr.worst");
673+ long m_crit_isr_n = evaluateExpressionNumber("(uint32_t)ch0.kernel_stats.m_crit_isr.n");
674+ String m_crit_isr_cumulative = evaluateExpression("(uint64_t)ch0.kernel_stats.m_crit_isr.cumulative");
666675 HashMap<String, String> map = new HashMap<String, String>(4);
667676 map.put("best", Long.toString(m_crit_isr_best));
668677 map.put("worst", Long.toString(m_crit_isr_worst));
--- branches/chibistudio_trunk/tools/chibios_eclipse_feature/feature.xml (revision 14336)
+++ branches/chibistudio_trunk/tools/chibios_eclipse_feature/feature.xml (revision 14337)
@@ -2,7 +2,7 @@
22 <feature
33 id="org.chibios.eclipse.tools.feature"
44 label="ChibiOS Eclipse Tools"
5- version="4.2.0.qualifier"
5+ version="4.2.1.qualifier"
66 provider-name="www.chibios.org"
77 plugin="org.chibios.chibistudio.branding"
88 exclusive="true">
Show on old repository browser