Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Weimin Pan <weimin.pan@oracle.com>
To: gdb-patches@sourceware.org
Subject: [PATCH PR gdb/22736] [aarch64] gdb crashes on a conditional breakpoint with cast return type
Date: Sat, 26 May 2018 00:59:00 -0000	[thread overview]
Message-ID: <1527290419-17631-1-git-send-email-weimin.pan@oracle.com> (raw)

Don't call language_pass_by_reference() with function that has no return type.

Only call language_pass_by_reference(), which returns whether or not an 
additional initial argument has been given, when return_type is not NULL
in function aarch64_push_dummy_call().

Tested on aarch64-linux-gnu. No regressions.
---
 gdb/ChangeLog      | 6 ++++++
 gdb/aarch64-tdep.c | 4 +++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 6f4153b..4c5691f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2018-05-23  Weimin Pan  <weimin.pan@oracle.com>
+
+	PR gdb/22736:
+	* aarch64-tdep.c (aarch64_push_dummy_call): Do not call
+	language_pass_by_reference if return_type is NULL.
+
 2018-05-14  Weimin Pan  <weimin.pan@oracle.com>
 
 	* minsyms.h (lookup_minimal_symbol_and_objfile): Remove declaration.
diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
index 01566b4..b4633ff 100644
--- a/gdb/aarch64-tdep.c
+++ b/gdb/aarch64-tdep.c
@@ -1426,7 +1426,9 @@ aarch64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
      given an additional initial argument, a hidden pointer to the
      return slot in memory.  */
   return_type = TYPE_TARGET_TYPE (func_type);
-  lang_struct_return = language_pass_by_reference (return_type);
+  lang_struct_return = (return_type != NULL
+			 ? language_pass_by_reference (return_type) 
+			 : 0);
 
   /* Set the return address.  For the AArch64, the return breakpoint
      is always at BP_ADDR.  */
-- 
1.8.3.1


             reply	other threads:[~2018-05-25 23:20 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-26  0:59 Weimin Pan [this message]
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
  -- strict thread matches above, loose matches on Subject: below --
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
2018-03-02 10:07 ` Yao Qi

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=1527290419-17631-1-git-send-email-weimin.pan@oracle.com \
    --to=weimin.pan@oracle.com \
    --cc=gdb-patches@sourceware.org \
    /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