Skip to content

Commit

Permalink
Recomend gdb by default for linux
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelvanstraten committed Nov 1, 2024
1 parent ba63f19 commit 5187596
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions doc/manual/source/development/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,45 @@ debugging.

### Installing a Debugger

Install your preferred debugger within the development shell. For example, to
install `lldb`:
Install your preferred debugger within the development shell.

```console
[nix-shell]$ nix shell nixpkgs#gdb
```

For macOS systems, use `lldb`:

```console
[nix-shell]$ nix shell nixpkgs#lldb
```

### Launching the Debugger

To debug the Nix binary you just built:
To debug the Nix binary you just run:

```console
[nix-shell]$ gdb --args ./subprojects/nix/nix
```

#### On macOS:

```console
[nix-shell]$ lldb -- ./subprojects/nix/nix
```

### Using the Debugger

Inside `lldb`, you can set breakpoints, run the program, and inspect variables:
Inside the debugger, you can set breakpoints, run the program, and inspect variables.

```gdb
(gdb) break main
(gdb) run <arguments>
```

Refer to the [GDB Documentation](https://www.gnu.org/software/gdb/documentation/) for
comprehensive usage instructions.

#### Using LLDB (macOS):

```lldb
(lldb) breakpoint set --name main
Expand Down

0 comments on commit 5187596

Please sign in to comment.