From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 117609 invoked by alias); 16 Mar 2019 13:21:44 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 117306 invoked by uid 89); 16 Mar 2019 13:21:43 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Received:2bc9, HX-Spam-Relays-External:sk:mail-pf, H*u:6.1, H*UA:6.1 X-HELO: mail-pf1-f177.google.com Received: from mail-pf1-f177.google.com (HELO mail-pf1-f177.google.com) (209.85.210.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 16 Mar 2019 13:21:42 +0000 Received: by mail-pf1-f177.google.com with SMTP id n125so8234744pfn.5 for ; Sat, 16 Mar 2019 06:21:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=eHQS4puYONVKDG2qyWz1XMQfUkcd2EEHgxhAscrVKsc=; b=AOlmA7JlkeqfEpgDrxJv3WsN5SswR2RVxTj6B4JraeTvDnT78BYKDnrOLvbtcEfp8X H67BNp5UovmLFXjnpk5uekoYeGUsDmQEhiMF/OaCdTJAmaa4EHMNURSDIqLYQZOiZBtN illUtu+oBY3WlX1oCsTNoknHub7B3LrQJTC3heaEUx2AnNdmA3P6cu7ZtNUTuFeCOM6G JuZmMhf9bIf3b+8XibdkmXsyq6qRC0zO1ieLKJX1lkU48BtLc3P9MD9ONHUuv4pu91Yc 0dJ6/6FjG+o+6qYQUhINhH0k4o5gVdWH5pC+0bcJQzTceijgj2wHVqiKuoaeg44GLS1V nd8w== Return-Path: Received: from [0.0.0.0] ([103.219.192.78]) by smtp.googlemail.com with ESMTPSA id q62sm13555300pfi.183.2019.03.16.06.21.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Mar 2019 06:21:40 -0700 (PDT) Subject: Re: How to load C++ pretty-printers To: Eli Zaretskii Cc: gdb@sourceware.org References: <835zsjz0f8.fsf@gnu.org> <83sgvnx9g1.fsf@gnu.org> From: asmwarrior Message-ID: Date: Sat, 16 Mar 2019 13:21:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:54.0) Gecko/20100101 Thunderbird/54.0a1 MIME-Version: 1.0 In-Reply-To: <83sgvnx9g1.fsf@gnu.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-03/txt/msg00039.txt.bz2 On Sat Mar 16 2019 20:58:22 GMT+0800, Eli Zaretskii wrote: >> From: asmwarrior >> Date: Sat, 16 Mar 2019 20:41:13 +0800 >> >> Under My Windows 7 system, I'm using such commands(I put them in a my.gdb script file) to load and register the pretty printers. >> I put the libstdcxx folder in the same folder as the my.gdb file. >> The file "my.gdb" is a simple text script file, which contains the lines(commands) below >> >> set auto-load safe-path $debugdir;$datadir/auto-load >> python >> import sys >> sys.path.insert(0, '') >> from libstdcxx.v6.printers import register_libstdcxx_printers >> # load other pretty printers >> end > Thanks, but I don't think I understand which part(s) of this are > necessary in my case. E.g., is the "set auto-load" command > needed/relevant? Currently, I don't have an idea about whether "set auto-load" command is relevant or not. I use this script for several years. I think for your original question, you need one line: from libstdcxx.v6.printers import register_libstdcxx_printers But you should let GDB know where the "libstdcxx" folder locates. > Also, which of the commands you've shown actually loads the > pretty-printers from their file? I just type the command below: source d:/path/to/my.gdb Asmwarrior