Page 3 of 8
Re: Eclipse debug plugin for ChibiOS/RT
Posted: Mon Aug 22, 2011 9:48 am
by Giovanni
mabl wrote:I have one wish too
I don't know if it is feasible, but I'd love to click on a thread/callback and directly jump to the source code as well.
I tried this but so fat I've been unable to convert from an object address to the associated symbol name so no luck, the Eclipse code is huge and documentation scarce, even things apparently simple can be difficult to implement if you don't know exactly where so search.
Giovanni
Re: Eclipse debug plugin for ChibiOS/RT
Posted: Sat Aug 27, 2011 2:08 pm
by barthess
What might be the cause of this error:
Error: ChibiOS/RT registry integrity check failed, NULL pointer.
Additional info:
After some time of successful running one tread hm... dead. Looks like it simple do return, but it has not return statment. All debug options switched on and I have no kernel panic. All other treads running fine (I successfully trap to breakpoint in it). When I press "refresh" plugin button than I have denoted error message. If I break before the death of problematic thread than "refresh" button works as expected.
Re: Eclipse debug plugin for ChibiOS/RT
Posted: Sat Aug 27, 2011 3:11 pm
by Giovanni
That error is returned when one of the registry pointers is found to be NULL. The registry is a close double linked list so it must contains no NULLs.
A possible cause is a stack overflow, the stack overflow detection is not 100% accurate being implemented in software and only at context switch time.
Giovanni
Re: Eclipse debug plugin for ChibiOS/RT
Posted: Sat Aug 27, 2011 4:12 pm
by barthess
Problem solved.
That was not stack overflow, but buffer overflow. Overflowed buffer overwrite "problematic" thread.
Re: Eclipse debug plugin for ChibiOS/RT
Posted: Tue Sep 06, 2011 8:05 pm
by barthess
When I set CH_USE_DYNAMIC to TRUE, select "Threads" tab and press refresh button, than I have following error:
"Error: error reading memory at 536879156"
All other tabs work fine. There are no error messages from OpenOCD in console. Manually that address readed fine.
Re: Eclipse debug plugin for ChibiOS/RT
Posted: Tue Sep 06, 2011 8:19 pm
by Giovanni
I test it with dynamic threads enabled and don't get that error.
The message is generated when failing to read a zero terminated string (the thread name). It is possible that that location reads fine but the location pointed by that location is invalid.
What is the content of the word located at 536879156 (0x20002034)? My hypothesis is that it is a corrupted thread name for some reason.
Giovanni
Re: Eclipse debug plugin for ChibiOS/RT
Posted: Tue Sep 06, 2011 8:26 pm
by barthess
content:
0x20002034 080004A1 00000000 55555555 55555555 55555555 55555555 55555555 55555555 08000D8F 55555555
I have no dynamic treads at all. Differences between builds only in that flag.
UPDATE
from ch.map:
COMMON 0x20001fe8 0xb0 ../chibios/os/kernel/src/chsys.o
0x20001fe8 _idle_thread_wa
COMMON 0x20002098 0x414 ../chibios/os/kernel/src/chdebug.o
0x20002098 dbg_trace_buffer
it points somewhere in idle thread.
UPDATE2
looking for 0x080004A1 gives follow info:
.text._idle_thread
0x080004a0 0x20 ../chibios/os/kernel/src/chsys.o
0x080004a0 _idle_thread
Re: Eclipse debug plugin for ChibiOS/RT
Posted: Tue Sep 06, 2011 8:34 pm
by Giovanni
Probably it is the p_name field of the idle thread and it points to 080004A1, is 080004A1 a valid address? it should be a zero terminated string.
Giovanni
Re: Eclipse debug plugin for ChibiOS/RT
Posted: Tue Sep 06, 2011 8:39 pm
by barthess
Yes, it correct address, but I can not see any readable strings in memory. Disassembler successfully jump to that address and show idle function.
Re: Eclipse debug plugin for ChibiOS/RT
Posted: Tue Sep 06, 2011 8:42 pm
by Giovanni
Is it really the p_name field? id so it must point to "idle\0" string, if the p_name points to something different then it is possible the structure got corrupted somehow.