diff --git a/.gitignore b/.gitignore index 91ffaa7f6f10dc0a8559ece44d6930160d72a18f..a298f0fdec83d4850de874aa1bf1d4778515afba 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ result* simu-out *analysis.html +.gdb* diff --git a/flake.nix b/flake.nix index df7022e26ee795b2230f2cd767dfb9ac8c755cfd..bfbe36bfd6a4c2eb1bd7fcbc953ef0a4b476840a 100644 --- a/flake.nix +++ b/flake.nix @@ -95,6 +95,16 @@ pkgs.rPackages.viridis ]; }; + simulation-debug = simulation.overrideAttrs (finalAttrs: previousAttrs: rec { + DEBUG_SRC_DIRS = packages.batsim.DEBUG_SRC_DIRS ++ packages.edc.DEBUG_SRC_DIRS; + GDB_DIR_ARGS = packages.batsim.GDB_DIR_ARGS ++ packages.edc.GDB_DIR_ARGS; + buildInputs = previousAttrs.buildInputs ++ [ pkgs.gdb pkgs.cgdb ]; + shellHook = '' + echo Found debug_info source paths. ${builtins.concatStringsSep ":" DEBUG_SRC_DIRS} + echo Run the following command to automatically load these directories to gdb. + echo gdb \$\{GDB_DIR_ARGS\} + ''; + }); }; } );