From: Philippe Waroquiers <philippe.waroquiers@skynet.be>
To: Eli Zaretskii <eliz@gnu.org>
Cc: brobecker@adacore.com, asmwarrior@gmail.com,
simon.marchi@polymtl.ca, gdb@sourceware.org
Subject: Re: How to load C++ pretty-printers
Date: Sun, 17 Mar 2019 17:17:00 -0000 [thread overview]
Message-ID: <1552843052.6197.15.camel@skynet.be> (raw)
In-Reply-To: <83zhptwma9.fsf@gnu.org>
On Sun, 2019-03-17 at 17:30 +0200, Eli Zaretskii wrote:
> > From: Philippe Waroquiers <philippe.waroquiers@skynet.be>
> > Cc: Eli Zaretskii <eliz@gnu.org>, Simon Marchi <simon.marchi@polymtl.ca>,
> > 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 = {<std::_Vector_base<so_list*, std::allocator<so_list*> >> = {
    _M_impl = {<std::allocator<so_list*>> = {<__gnu_cxx::new_allocator<so_list*>> = {<No
data fields>}, <No data fields>}, _M_start = 0x563c90cb1140,Â
      _M_finish = 0x563c90cb1190,Â
      _M_end_of_storage = 0x563c90cb11c0}}, <No data fields>}
(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 <class 'gdb.error'> No type named so_list*.:Â
type = class std::vector<so_list*, std::allocator<so_list*> >Â
    [with _Tp = so_list *, _Alloc = std::allocator<so_list*>]Â
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
prev parent reply other threads:[~2019-03-17 17:17 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-16 8:30 Eli Zaretskii
2019-03-16 12:41 ` asmwarrior
2019-03-16 12:58 ` Eli Zaretskii
2019-03-16 13:21 ` asmwarrior
2019-03-16 14:25 ` Simon Marchi
2019-03-16 16:00 ` Eli Zaretskii
2019-03-17 1:47 ` asmwarrior
2019-03-17 11:03 ` Joel Brobecker
2019-03-17 12:39 ` Philippe Waroquiers
2019-03-17 15:31 ` Eli Zaretskii
2019-03-17 17:17 ` Philippe Waroquiers [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1552843052.6197.15.camel@skynet.be \
--to=philippe.waroquiers@skynet.be \
--cc=asmwarrior@gmail.com \
--cc=brobecker@adacore.com \
--cc=eliz@gnu.org \
--cc=gdb@sourceware.org \
--cc=simon.marchi@polymtl.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox