From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16714 invoked by alias); 17 Mar 2019 17:17:38 -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 16702 invoked by uid 89); 17 Mar 2019 17:17:38 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.1 spammy=H*i:sk:83zhptw, H*f:sk:83zhptw, HContent-Transfer-Encoding:8bit X-HELO: mailsec102.isp.belgacom.be Received: from mailsec102.isp.belgacom.be (HELO mailsec102.isp.belgacom.be) (195.238.20.98) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 17 Mar 2019 17:17:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=skynet.be; i=@skynet.be; q=dns/txt; s=securemail; t=1552843054; x=1584379054; h=message-id:subject:from:to:cc:date:in-reply-to: references:mime-version:content-transfer-encoding; bh=D5oEAFHWmrrSTHgApXKd0FO6wvATItFKY6e2r9PS7Y4=; b=oLveSNG8fVQDvUYGMi7enLDZoMOICqYPg/K9pV+qMhMjc5VFuBBXfaV3 Y1jh9DWzYfMf6GV9+mFFUxfboyYsgA==; Received: from 147.122-130-109.adsl-dyn.isp.belgacom.be (HELO md) ([109.130.122.147]) by relay.skynet.be with ESMTP/TLS/AES256-GCM-SHA384; 17 Mar 2019 18:17:32 +0100 Message-ID: <1552843052.6197.15.camel@skynet.be> Subject: Re: How to load C++ pretty-printers From: Philippe Waroquiers To: Eli Zaretskii Cc: brobecker@adacore.com, asmwarrior@gmail.com, simon.marchi@polymtl.ca, gdb@sourceware.org Date: Sun, 17 Mar 2019 17:17:00 -0000 In-Reply-To: <83zhptwma9.fsf@gnu.org> References: <835zsjz0f8.fsf@gnu.org> <83sgvnx9g1.fsf@gnu.org> <83o96ayfky.fsf@gnu.org> <20190317110310.GA4414@adacore.com> <1552826392.6197.11.camel@skynet.be> <83zhptwma9.fsf@gnu.org> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2019-03/txt/msg00051.txt.bz2 On Sun, 2019-03-17 at 17:30 +0200, Eli Zaretskii wrote: > > From: Philippe Waroquiers > > Cc: Eli Zaretskii , Simon Marchi , > > gdb@sourceware.org > > Date: Sun, 17 Mar 2019 13:39:52 +0100 > > > > But then: > >  p current_program_space->added_solibs[0] > > One of the arguments you tried to pass to operator[] could not be converted to what > > the function wants. > > (why is then GDB not telling me what the function wants ?). > > I am finally doing > > p (*(struct so_list*)0x56275a765a60) > > > > But that all looks like a 'backward' user experience: > > Is that a problem with GDB or with the pretty-printer? If the latter, > it might be worth telling this to the GCC folks. I think it is a GDB problem: same behaviour with pretty printers disabled: (top-gdb) p current_program_space->added_solibs $4 = { >> = {     _M_impl = {> = {<__gnu_cxx::new_allocator> = {}, }, _M_start = 0x563c90cb1140,        _M_finish = 0x563c90cb1190,        _M_end_of_storage = 0x563c90cb11c0}}, } (top-gdb) p current_program_space->added_solibs[0] One of the arguments you tried to pass to operator[] could not be converted to what the function wants. (top-gdb)  Another strange thing in this area: with pretty printers disabled, doing ptype current_program_space->added_solibs gives first a python error: Python Exception No type named so_list*.:  type = class std::vector >      [with _Tp = so_list *, _Alloc = std::allocator]  while ptype so_list* tells it is a known type: (top-gdb) ptype so_list* type = struct so_list {     so_list *next;     lm_info_base *lm_info;     char so_original_name[512];     char so_name[512];     program_space *pspace;     bfd *abfd;     char symbols_loaded;     objfile *objfile;     target_section *sections;     target_section *sections_end;     CORE_ADDR addr_low;     CORE_ADDR addr_high; } * That also looks like a GDB problem (maybe ptype is missing the logic to consider so_list as a struct ?). Maybe there is a link between the 2 problems ? Philippe