From: Alan Hayward <Alan.Hayward@arm.com>
To: Joel Brobecker <brobecker@adacore.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, 02 Mar 2018 12:09:00 -0000 [thread overview]
Message-ID: <BE1E90D3-583A-4635-AE80-6B7F53BE31FB@arm.com> (raw)
In-Reply-To: <20180302033204.v2wvjmquwy3dswyk@adacore.com>
> On 2 Mar 2018, at 03:32, Joel Brobecker <brobecker@adacore.com> wrote:
>
> On Thu, Mar 01, 2018 at 05:03:44PM +0000, Alan Hayward wrote:
>> On aarch64, the (int) casting in the following causes a gdb segfault:
>> $ ./gdb ./gdb
>> (gdb) b dwarf2_physname if (int)strcmp (name, "another_thread_local") == 0
>> (gdb) run a.out // use any a.out
>>
>> This is due to getting a null pointer from TYPE_TARGET_TYPE, and then
>> using it for language_pass_by_reference().
>>
>> Fixed by adding a null check, similar to other occurrences in gdb.
>>
>> Tested on aarch64 with make check using unix, native_gdbserver.
>>
>> Alan.
>>
>>
>> 2018-03-01 Alan Hayward <alan.hayward@arm.com>
>>
>> * aarch64-tdep.c (aarch64_push_dummy_call): Check for null
>> return_type.
>
> The patch looks good to me, but do you think you could add a test
> for it? Intuitively, I think this should be fairly easily doable,
> but can you confirm?
Agreed, should be easy enough.
I’ve not added anything to the .exp files yet, so this is a good excuse for me to
look into them a bit more :)
Thanks for the review.
> On 2 Mar 2018, at 10:07, Yao Qi <qiyaoltc@gmail.com> wrote:
>
> On Thu, Mar 1, 2018 at 5:03 PM, Alan Hayward <Alan.Hayward@arm.com> wrote:
>> 2018-03-01 Alan Hayward <alan.hayward@arm.com>
>>
>> * aarch64-tdep.c (aarch64_push_dummy_call): Check for null
>> return_type.
>
> Add "PR gdb/22736" in ChangeLog entry.
>
Will add.
> Any idea on why TYPE_TARGET_TYPE (func_type) is NULL? (because
> there is no strcmp debug info?)
>
The cast to (int) is causing this - remove the cast and it finds the type.
I’m assuming that’s causing it to drop the debug info.
Also, thanks for the review.
Alan.
next prev parent reply other threads:[~2018-03-02 12:09 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 [this message]
[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
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=BE1E90D3-583A-4635-AE80-6B7F53BE31FB@arm.com \
--to=alan.hayward@arm.com \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=nd@arm.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