-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into flake-substitution
- Loading branch information
Showing
157 changed files
with
879 additions
and
668 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
# Check if -latomic is needed | ||
# This is needed for std::atomic on some platforms | ||
# We did not manage to test this reliably on all platforms, so we hardcode | ||
# it for now. | ||
if host_machine.cpu_family() == 'arm' | ||
deps_other += cxx.find_library('atomic') | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
if host_machine.system() == 'windows' | ||
# https://learn.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt?view=msvc-170 | ||
# #define _WIN32_WINNT_WIN8 0x0602 | ||
# We currently don't use any API which requires higher than this. | ||
add_project_arguments([ '-D_WIN32_WINNT=0x0602' ], language: 'cpp') | ||
endif |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Debugging Nix | ||
|
||
This section shows how to build and debug Nix with debug symbols enabled. | ||
|
||
## Building Nix with Debug Symbols | ||
|
||
In the development shell, set the `mesonBuildType` environment variable to `debug` before configuring the build: | ||
|
||
```console | ||
[nix-shell]$ export mesonBuildType=debugoptimized | ||
``` | ||
|
||
Then, proceed to build Nix as described in [Building Nix](./building.md). | ||
This will build Nix with debug symbols, which are essential for effective debugging. | ||
|
||
## Debugging the Nix Binary | ||
|
||
Obtain your preferred debugger within the development shell: | ||
|
||
```console | ||
[nix-shell]$ nix-shell -p gdb | ||
``` | ||
|
||
On macOS, use `lldb`: | ||
|
||
```console | ||
[nix-shell]$ nix-shell -p lldb | ||
``` | ||
|
||
### Launching the Debugger | ||
|
||
To debug the Nix binary, run: | ||
|
||
```console | ||
[nix-shell]$ gdb --args ../outputs/out/bin/nix | ||
``` | ||
|
||
On macOS, use `lldb`: | ||
|
||
```console | ||
[nix-shell]$ lldb -- ../outputs/out/bin/nix | ||
``` | ||
|
||
### Using the Debugger | ||
|
||
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. | ||
|
||
On macOS, use `lldb`: | ||
|
||
```lldb | ||
(lldb) breakpoint set --name main | ||
(lldb) process launch -- <arguments> | ||
``` | ||
|
||
Refer to the [LLDB Tutorial](https://lldb.llvm.org/use/tutorial.html) for comprehensive usage instructions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.