NETMF / llilum

Development Platform for MSIL and UWP apps targeting Micro Controllers. Part of the .NET Micro Framework family.
Other
159 stars 52 forks source link

Support for threads in GDB/VS #140

Open lt72 opened 8 years ago

lt72 commented 8 years ago

We cannot currently see threads in GDB, and neither we can in VS2015. We should enable that to allow productive debugging.

smaillet-ms commented 8 years ago

This is a rather substantial work item. The current debugging architecture in VS basically looks like this: VS ---(AD7)---> MIDebugEngine ----(MI)----> GDB ---(RSP)---> PyOCD/OpenOCD

There are several components and API/protocol layers involved. The VS+MIDebugEngine is a relatively thin layer to enable VS support for Debug engines using the MI Debug protocol, such as GDB and LLDB. In turn those use another component (PyOCD or OpenOCD in our current case) as a remote debug agent talking the Remote Serial Protocol (RSP) to control the physical hardware. Thread/OS awareness exists at the RSP level and also at the MI protocol level. Thus awareness of the inner details of the scheduler's data structures must be incorporated into each RSP implementation that GDB/LLDB interacts with. There are a few options on how to get that including:

A more ambitious alternative to the above could be to build a concord based engine that could ultimately eliminate the GDB/LLDB layer thus removing one layer of cross process communication protocol. The advantage of this approach is the existing support for expression evaluation via Roslyn and architectural support for targeting different platforms need similar kinds of functionality and therefore provide some overlap/room to leverage existing work (i.e. existing .NET Native for Windows Universal applications and LLILC )