Skip to content

gdb pretty printing #221

@BKSalman

Description

@BKSalman

Hello :)

when I use rust-gdb it doesn't include the rust pretty printer

when I run:

rust-gdb

then inside gdb:

(gdb) info pretty-printer
(gdb)

I get nothing, which means the pretty printer is not loaded

I don't know much about gdb itself, but I'm trying to debug the issue, but I still don't know what causes it

this is my flake.nix

{
  description = "basic rust development evnvironment";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
    rust-overlay.url = "github:oxalica/rust-overlay";
  };

  outputs = {nixpkgs, rust-overlay, ...}:
      let 
        system = "x86_64-linux";
        pkgs = import nixpkgs { inherit system; overlays = [ rust-overlay.overlays.default ]; };
      in
    with pkgs; {
      devShells.${system}.default = mkShell {

          packages = [
            ((rust-bin.fromRustupToolchainFile ./rust-toolchain.toml).override {
              extensions = ["rustfmt" "clippy" "rust-analyzer" "rust-std" "rust-src"];
            })

            gdb
            gdbgui
            python3
          ];
          
          nativeBuildInputs = [ ];
          
          buildInputs = [
            udev
            pkg-config
          ];
        };

      formatter.x86_64-linux = legacyPackages.${system}.nixpkgs-fmt;
    };
}

UPDATE:

it works when I manually source the python file with something like this:

(gdb) source /nix/store/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-rust-default-1.86.0/lib/rustlib/etc/gdb_load_rust_pretty_printers.py

but this is obviously not ideal, but I'm not sure why it doesn't source it by itself 🤔

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions