Page 3 of 3
Re: Unhandled exception - how to debug
Posted: Wed Jul 17, 2019 9:01 am
by mikeprotts
Can you provide a link please (ChibiStudio for Linux)? I've not been able to find the Linux version, or do I need to extract from the Windows version?
Mike
Re: Unhandled exception - how to debug
Posted: Wed Jul 17, 2019 9:14 am
by elagil
I also did not find it. As far as I am aware, OSDN is now used for new versions of ChibiOS and ChibiStudio. Anyway, I just installed it on a fresh Windows installation.
The problem was indeed a full stack in a thread. After increasing it, the program ran fine. However, after the exception handler was called, the thread view was also broken. Only the last running thread was still visible. Is there a way to see that thread in some structure inside ChibiOS? I would really like to use my standard IDE and still be able to debug threads and stack sizes. I would be happy to know some details on the debugging information that ChibiOS stores. Maybe I can write a plugin for VS Code.
Re: Unhandled exception - how to debug
Posted: Wed Jul 17, 2019 9:15 am
by Giovanni
I noticed the old download is gone....
It was very old anyway, will prepare a new one during weekend, it will be available on OSDN.
Giovanni
Re: Unhandled exception - how to debug
Posted: Wed Jul 17, 2019 9:18 am
by Giovanni
elagil wrote: However, after the exception handler was called, the thread view was also broken. Only the last running thread was still visible. Is there a way to see that thread in some structure inside ChibiOS?
If the plugin does not work then it means that structures in RAM got corrupted (the registry) so it is unable to fetch the list. You can inspect using the debugger: look at the "ch" structure then follow the "older" and "newer" links, those go across all threads.
Giovanni
Re: Unhandled exception - how to debug
Posted: Wed Jul 17, 2019 12:37 pm
by elagil
Giovanni wrote:You can inspect using the debugger: look at the "ch" structure then follow the "older" and "newer" links, those go across all threads.
Giovanni
That is very helpful, thanks! Can you tell me, where the thread stack information is encoded? I am looking at the "rlist" field and the current/older/newer threads.
Re: Unhandled exception - how to debug
Posted: Wed Jul 17, 2019 12:44 pm
by Giovanni
Stack information is in each thread structure, there is a pointer for the stack limit.
Giovanni
Re: Unhandled exception - how to debug
Posted: Wed Jul 17, 2019 9:00 pm
by Giovanni
I uploaded the previous Linux ChibiStudio on OSDN:
https://osdn.net/projects/chibios/releases/Please consider that it is not just an unpack-and-go thing, you need to change paths from my default /home/giovanni/Projects/ChibiStudio.
Giovanni