dotnet / dotnet/diagnostics

[Feature Request] GDB debug info and SOS integration

Open
#272 1 comment 0 reactions 1 assignee Claimed by @mikem8361 View on GitHub
enhancement
Dominant language
C++
Stars
1.3k
Forks
404
Avg merge
2d 3h
Merged PRs (30d)
38

Description

### 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](https://lldb.llvm.org/status/projects.html)) 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:

* [JIT interface](https://www.sourceware.org/gdb/current/onlinedocs/gdb/JIT-Interface.html#JIT-Interface):
* used by LLVM and v8 engine. LLVM provides DWARF debugging information to GDB.
* Mono added its support in 2009 https://github.com/mono/mono/commit/9c7af7f2ce58d37976ea45cfbd94d037a89cfd8d#diff-499ab2170cdda019ebc31342389233b3R5545
* [Machine interface](https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI.html) (invokes with `--interpreter` switch).
* From home page:
> Note that GDB/MI is still under construction, so some of the features described below are incomplete and subject to change (see GDB/MI Development and Front Ends).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.