Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@cygnus.com>
To: Michael Elizabeth Chastain <mec@shout.net>, thorpej@wasabisystems.com
Cc: gdb-patches@sources.redhat.com
Subject: [rfa:ppc] Fix PPC/NBSD struct return; Was: userdef.exp regression for ppc?
Date: Sat, 01 Jun 2002 10:21:00 -0000	[thread overview]
Message-ID: <3CF902B0.50405@cygnus.com> (raw)
In-Reply-To: <200206011546.g51FkMj30586@duracef.shout.net>

[-- Attachment #1: Type: text/plain, Size: 761 bytes --]

> This looks like a bug in calling functions that return a structure
> by value.  All the functions that return structures FAIL:
> 
>   print one + two
>   $1 = {x = 2147479536, y = 1099239424}
>   (gdb) FAIL: gdb.c++/userdef.exp: print one + two
> 
> The functions that return a scalar PASS:
> 
>   print one && two
>   $6 = 1
>   (gdb) PASS: gdb.c++/userdef.exp: print one && two
> 
> Look at the results in gdb.base/call-rt-st.exp and gdb.base/structs.exp.
> I bet there is a lot of juicy log info there.

Yep!  The attached fixes it.  Looks like PPC/NetBSD's custom GCC has a 
fixed struct return (I'm pretty sure that mainline GCC is broken).

The old code, for reasons I'm not sure, was failing to detect NetBSD and 
hence was failing ot set it.

Andrew


[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 1767 bytes --]

2002-06-01  Andrew Cagney  <ac131313@redhat.com>
 
 	* ppcnbsd-tdep.c (ppcnbsd_init_abi): Don't set
 	use_struct_convention to sysv_abi_broken_use_struct_convention.
 
Index: ppcnbsd-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ppcnbsd-tdep.c,v
retrieving revision 1.1
diff -p -r1.1 ppcnbsd-tdep.c
*** ppcnbsd-tdep.c	28 May 2002 18:43:07 -0000	1.1
--- ppcnbsd-tdep.c	1 Jun 2002 17:07:37 -0000
*************** ppcnbsd_init_abi (struct gdbarch_info in
*** 203,211 ****
    /* Until November 2001, gcc was not complying to the SYSV ABI for
       returning structures less than or equal to 8 bytes in size. It was
       returning everything in memory. When this was corrected, it wasn't
!      fixed for native platforms.  */
    set_gdbarch_use_struct_convention (gdbarch,
                                     ppc_sysv_abi_broken_use_struct_convention);
  
    set_solib_svr4_fetch_link_map_offsets (gdbarch,
                                  nbsd_ilp32_solib_svr4_fetch_link_map_offsets);
--- 203,217 ----
    /* Until November 2001, gcc was not complying to the SYSV ABI for
       returning structures less than or equal to 8 bytes in size. It was
       returning everything in memory. When this was corrected, it wasn't
!      fixed for native platforms.
! 
!      However, NetBSD 1.5.x uses gcc version egcs-2.91.66 19990314
!      (egcs-1.1.2 release) with local patches and that has a fixed
!      struct convention.  */
! #if 0
    set_gdbarch_use_struct_convention (gdbarch,
                                     ppc_sysv_abi_broken_use_struct_convention);
+ #endif
  
    set_solib_svr4_fetch_link_map_offsets (gdbarch,
                                  nbsd_ilp32_solib_svr4_fetch_link_map_offsets);

  reply	other threads:[~2002-06-01 17:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-01  8:46 Michael Elizabeth Chastain
2002-06-01 10:21 ` Andrew Cagney [this message]
2002-06-01 15:03   ` [rfa:ppc] Fix PPC/NBSD struct return; Was: " Jason R Thorpe
2002-06-02 11:15   ` Jason R Thorpe
2002-06-02 11:51   ` Jason R Thorpe
2002-06-02 12:24     ` Zack Weinberg
2002-06-02 13:29   ` Jason R Thorpe
2002-06-03  6:13     ` Andrew Cagney
2002-06-03 11:30 ` Michael Snyder

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=3CF902B0.50405@cygnus.com \
    --to=ac131313@cygnus.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=mec@shout.net \
    --cc=thorpej@wasabisystems.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