Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] GDB debug info and SOS integration #272

Open
am11 opened this issue May 19, 2019 · 1 comment
Open

[Feature Request] GDB debug info and SOS integration #272

am11 opened this issue May 19, 2019 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@am11
Copy link
Member

am11 commented May 19, 2019

Motivation

In some platforms, LLDB is either not readily available (e.g. SmartOS) or not available for prime time debugging (e.g. Alpine Linux and other muscle-libc based distros where it crashes).
More generally:

  • chances of a working GNU debugger available via package manager (or preinstalled) on an arbitrary Unix are higher than that of LLDB.
  • the additional ~20 years of experience GDB has over LLDB makes it mature, stable and richer in terms of features, such as, non-stop debugging, reverse-debugging (and some others in lldb wishlist) etc.

Therefore, I think in addition to lldbplugin, if SOS commands and managed code debugging support is extended to GDB, it would bring about significant value for consumers.

Implementation

There are multiple extension points for GDB that IDEs and tools make use of. A quick glance at GDB frontends list, for a rough idea https://sourceware.org/gdb/wiki/GDB%20Front%20Ends.

In my understanding, one of these two GDB facilities could be used for SOS integration:

@mikem8361 mikem8361 self-assigned this May 20, 2019
@mikem8361 mikem8361 added the enhancement New feature or request label May 20, 2019
@mikem8361 mikem8361 added this to the Future milestone May 23, 2019
@mikem8361
Copy link
Member

mikem8361 commented May 23, 2019

The coreclr runtime can be built with the FFEATURE_GDBJIT that turns on building the JIT interfaces for gdb (and lldb). It is unsupported, untested and it allocates too many resources to turn on in the product.

The MI interface could be used to put the services need for SOS, but it would have to be in it's own REPL with it's own command parsing. We don't currently have the resources to do this at this time.

gdb doesn't have an extension model to allow adding the SOS commands like we do in lldb and the Windows debuggers.

We do have a dotnet CLI global tool called "dotnet-dump" that allows (just) SOS commands to be executed on an ELF core dump. It isn't a native debugger just a simple REPL that loads the SOS and provides the services it needs to read the core dump. See dotnet-dump. The next preview (6) will support Alpine and arm architectures without relying on a working lldb (or gdb).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants