From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by sourceware.org (Postfix) with ESMTPS id A07F1385842D for ; Wed, 6 Oct 2021 08:56:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A07F1385842D Received: by mail-wr1-x432.google.com with SMTP id r7so6482662wrc.10 for ; Wed, 06 Oct 2021 01:56:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AvN4HAWusW7A70GLjqnNlWwyvBEtDA+IMeWyv7MKl6A=; b=Z5CKvsSF5epVzcQDK5KNWtOE8fLmbG6uFwqgWTi3yPTpbZNyr7m5ebLzvOFxg/p5L1 Gp+WpzdQoLkwrZFDnh1UfkyqM5KPK6OnmQakf5K8LpCDIs2S3Nk6fGLI/qBNCdy2+XWd Bla/LJe/XZHCnDs1vQxpcjraOCE+7iSkGfiAMihJqfnQRG4Rg+mNtRkBjRMnn5K2MWfI E8Yjq8FVpQ+vHS05ic+YkDKNHJvhampKN0X3P3Is5OxPE6+VP4bbucNCjkxpqNqYp7m1 ntLL1Y3mVNsM2IxH6pe1GssTCG3XaB14fWycD7VOB3/Nzpx6HJSkiMbytRtaPmqrYhaV FfBA== X-Gm-Message-State: AOAM532yPus+ldBeBmG8NgEoNANdXZ9Yz7HcE99uaD5LFzWDWRRcVqpk lIivlj+Ci9UY1bH2OdbgH7o/DJoEFMXRzFITNTU= X-Google-Smtp-Source: ABdhPJzRMHtrS8xzKO+Uiqz/XnT2hiZu9nb0HroMZUulBrkof1hMrYFBevoo8fqAeoEOO9HeFnQxPz6O2ZFfHYdiTts= X-Received: by 2002:a7b:cb04:: with SMTP id u4mr8397439wmj.176.1633510598536; Wed, 06 Oct 2021 01:56:38 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Wed, 6 Oct 2021 09:56:27 +0100 Message-ID: Subject: Re: Why I cannot see content of std::vector in the gdb? To: unlvsur unlvsur Cc: "unlvsur unlvsur via Libstdc++" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2021 08:56:41 -0000 On Wed, 6 Oct 2021 at 03:18, unlvsur unlvsur wrote: > > c++ - Inspecting standard container (std::map) contents with gdb - Stack Overflow > > I just saw your (jwakely) answer that libstdc++ supports pretty printer for gdb. But it does not work? Any configs I missed here? That should work, and does work for me. Obviously your GDB needs to have Python support compiled in. Check "show auto-load python-scripts" and "info auto-load python-scripts" and see what it prints out. See https://sourceware.org/gdb/current/onlinedocs/gdb/Python-Auto_002dloading.html My ~/.gdbinit has these lines to enable me to load the printers.py scripts from all my self-installed GCC builds under ~/gcc-version: add-auto-load-safe-path /home/jwakely/gcc-versions/ add-auto-load-safe-path /home/jwakely/src/gcc/build-x86/gcc/.gdbinit (The second line is for debugging GCC itself, via the gdb helpers that are part of the GCC sources). Note that auto-loading the libstdc++ printers only works for libstdc++.so and not libstdc++.a, so if you built your gcc with --disable-shared then you'll need to manually load the printers.