From: Iru Cai via Gdb <gdb@sourceware.org>
To: Luis Machado <luis.machado@arm.com>
Cc: gdb@sourceware.org
Subject: Re: How to handle different sizes of pointers in GDB?
Date: Wed, 21 Aug 2024 09:51:32 +0800 [thread overview]
Message-ID: <CANL=iQRVsjvoQ619GcWq0An_uvaydhNNcGxp=OgL+Kv_n=ai3g@mail.gmail.com> (raw)
In-Reply-To: <99d3cb61-88d1-4d43-b251-25af737ba08f@arm.com>
Thanks for your help.
On Mon, Aug 19, 2024 at 6:42 PM Luis Machado <luis.machado@arm.com> wrote:
>
> From what I recall, you'll need to make sure your address class is correct
> in DWARF for the
> different pointer types. Assuming that is correct, have you also
> implemented the 3 hooks
> that deal with address classes?
>
> set_gdbarch_address_class_type_flags
> set_gdbarch_address_class_type_flags_to_name
> set_gdbarch_address_class_name_to_type_flags
>
>
Now I'm using set_gdbarch_address_class_type_flags to make the DWARF reader
set the instance_flags of the pointer types, and register a
gdbarch_pointer_to_address method. I can see GDB can call my
pointer_to_address for each pointer, and type->length() is still 8, but I
can get the address class from type->instance_flags() and use it to know
the pointer size.
> Check the s390 code for some reference in gdb/s390-tdep.c
>
> Even with those set correct, gdb can still get confused with pointer sizes
> depending on
> which gdb subsystem is handling it. The type information sometimes gets
> lost when we cross
> some gdb internal boundaries, and then we fallback to the default pointer
> size.
>
> I hope that helps some.
>
prev parent reply other threads:[~2024-08-21 1:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-19 10:20 Iru Cai via Gdb
2024-08-19 10:42 ` Luis Machado via Gdb
2024-08-21 1:51 ` Iru Cai via Gdb [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='CANL=iQRVsjvoQ619GcWq0An_uvaydhNNcGxp=OgL+Kv_n=ai3g@mail.gmail.com' \
--to=gdb@sourceware.org \
--cc=luis.machado@arm.com \
--cc=vimacs.hacks@gmail.com \
/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