From: Alan Hayward <Alan.Hayward@arm.com>
To: Joel Brobecker <brobecker@adacore.com>,
Pedro Alves <palves@redhat.com>, Yao Qi <qiyaoltc@gmail.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
nd <nd@arm.com>
Subject: Re: [PATCH PR gdb/22736] [aarch64] gdb crashes on a conditional breakpoint with cast return type
Date: Fri, 09 Mar 2018 19:11:00 -0000 [thread overview]
Message-ID: <02E52921-0454-445A-AB05-D6D1FD6BDE34@arm.com> (raw)
In-Reply-To: <20180309085122.v4fzh4vcii5plkkk@adacore.com>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 3036 bytes --]
> On 9 Mar 2018, at 08:51, Joel Brobecker <brobecker@adacore.com> wrote:
>
> Hello Alan,
>
>> The target type for the *function is set to the type of the function
>> pointer, not the return type. So, for IFUNC, TYPE_CODE_FUNC target type
>> is TYPE_CODE_INT which gives the type of the function pointer. For the
>> FUNC, there is no pointer, so the target type of TYPE_CODE_FUNC is set
>> to null. That makes sense to me, but isnât immediately obvious.
>
> I don't really understand what you mean by that -- maybe it is related
> to the '*' before 'function' above? If we're talking about the
> target_type for the function, it should be the type of the return value.
> At least according to the documentation for that field in gdb_types.h.
> But maybe you're talking about something else?
Agreed that the documentation says âtypeâ should contain the type of the
function return.
Iâm not quite sure on the terminology here, but, what the gdb code is picking
up and placing into type is the type of the function entry in the elf file.
The code in find_minsym_type_and_address() ensures that a FUNC will always
have the type nodebug_text_gnu_ifunc_symbol and an IFUNC will always have
the type nodebug_text_symbol. This is completely unrelated to the return type
of the function, which is only resolved much later in call_function_by_hand_dummy().
In an ideal world, maybe the common code needs a bit of a rewrite:
The function structure needs to contain both the type of the elf entry and the
type of the return value. But, the existing value* and function* structures donât
really support adding extra fields. I wasnât really comfortable enough will this part
of the code to meddle with that.
Happy with the other comments too. Thanks!
> On 9 Mar 2018, at 16:04, Pedro Alves <palves@redhat.com> wrote:
>
> Sorry for the constant delays the past couple weeks. I've been getting
> distracted by other things more than usual. Today I'm trying to finish/post
> the ifunc-fixing series I pointed at earlier, and hopefully that will give
> me enough background to understand/review this patch (I'm afraid I haven't
> really looked at it in any detail).
>
Ok, happy to wait until you have some time. Iâm looking at pr/22943 which also
might help with my understanding of this one a little more.
>
> On 9 Mar 2018, at 16:44, Yao Qi <qiyaoltc@gmail.com> wrote:
>
> FWIW, this issue is *not* related to ifunc. As Alan described in
> previous email, ifunc symbol is OK, but normal function symbol's target
> type is NULL, because without debug information, GDB doesn't know the
> symbol is a function or not. I thought about it, but I am not confident
> that we can set symbol's target type (for example, set it void or int)
> in absent of debug information.
>
Iâd just add that even with IFUNC the type will always be set to a pointer to an
Int, regardless of the return type of the function.
Alan.
\x16º&Öéj×!zÊÞ¶êç×|ïb²Ö«r\x18\x1dnr\x17¬
next prev parent reply other threads:[~2018-03-09 19:11 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-01 17:03 Alan Hayward
2018-03-02 3:32 ` Joel Brobecker
2018-03-02 12:09 ` Alan Hayward
[not found] ` <CAH=s-PP-Xy7TrP-0zKCuA2X4A8Xgx_gHNvYewm41LPs7ZZJniA@mail.gmail.com>
2018-03-02 14:05 ` Alan Hayward
2018-03-02 15:18 ` Joel Brobecker
2018-03-05 15:57 ` Alan Hayward
2018-03-05 16:45 ` Pedro Alves
2018-03-07 11:10 ` Alan Hayward
2018-03-09 8:51 ` Joel Brobecker
2018-03-09 16:04 ` Pedro Alves
2018-03-09 16:44 ` Yao Qi
2018-03-09 19:11 ` Alan Hayward [this message]
2018-03-02 10:07 ` Yao Qi
2018-05-26 0:59 Weimin Pan
2018-05-27 3:42 ` Simon Marchi
2018-05-29 17:43 ` Wei-min Pan
2018-05-29 21:37 ` Simon Marchi
2018-05-30 0:29 ` Weimin Pan
2018-05-29 17:46 ` Pedro Alves
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=02E52921-0454-445A-AB05-D6D1FD6BDE34@arm.com \
--to=alan.hayward@arm.com \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=nd@arm.com \
--cc=palves@redhat.com \
--cc=qiyaoltc@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