From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24496 invoked by alias); 29 Sep 2003 20:33:45 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 24489 invoked from network); 29 Sep 2003 20:33:44 -0000 Received: from unknown (HELO localhost.redhat.com) (207.219.125.105) by sources.redhat.com with SMTP; 29 Sep 2003 20:33:44 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 5CDFA2B89; Mon, 29 Sep 2003 16:33:43 -0400 (EDT) Message-ID: <3F789727.3080704@redhat.com> Date: Mon, 29 Sep 2003 20:33:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030820 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kevin Buettner Cc: gdb-patches@sources.redhat.com, peter.schauer@regent.e-technik.tu-muenchen.de Subject: Re: [rfa/6.0] fix aix inferior calls References: <3F789078.3000100@redhat.com> <1030929202202.ZM15766@localhost.localdomain> Content-Type: multipart/mixed; boundary="------------010409040702050801000304" X-SW-Source: 2003-09/txt/msg00637.txt.bz2 This is a multi-part message in MIME format. --------------010409040702050801000304 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1460 > On Sep 29, 4:05pm, Andrew Cagney wrote: > > >> The PowerOpen doco requires at least 220 bytes of space, beyond the end >> of stack, but forgets to mention that 220 isn't frame [16 byte] aligned. >> Consequently, an assert checking stack alignment fails and inferior >> calls on AIX doesn't work. That will learn me for not checking the math. >> >> Anyway, ok for "the late breaking 6.0 patch"? > > > I didn't see a patch attached, Doh! > but if it allocates 220 bytes of space > and then allocates any extra space to get to a 16 byte alignment, it's > okay with me. (Anything which is roughly equivalent is fine too - > e.g, aligning first and then allocating 224 bytes is okay too.) The code looks like this: sp = gdbarch_frame_align (current_gdbarch, old_sp); /* NOTE: cagney/2003-08-13: Skip the "red zone". For some ABIs, a function can use memory beyond the inner most stack address. AMD64 called that region the "red zone". Skip at least the "red zone" size before allocating any space on the stack. */ if (INNER_THAN (1, 2)) sp -= gdbarch_frame_red_zone_size (current_gdbarch); else sp += gdbarch_frame_red_zone_size (current_gdbarch); /* Still aligned? */ gdb_assert (sp == gdbarch_frame_align (current_gdbarch, sp)); so the attached modifies rs6000 to comply with red-zone's requirements vis: > By default, zero bytes are allocated. The value must be aligned > (@pxref{frame_align}). Andrew --------------010409040702050801000304 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 1147 2003-09-29 Andrew Cagney * rs6000-tdep.c (rs6000_gdbarch_init): Set the PowerOpen red zone to 224, not 220. Index: rs6000-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v retrieving revision 1.145.2.2 diff -u -r1.145.2.2 rs6000-tdep.c --- rs6000-tdep.c 18 Aug 2003 20:12:31 -0000 1.145.2.2 +++ rs6000-tdep.c 29 Sep 2003 19:56:54 -0000 @@ -2948,8 +2948,10 @@ /* PPC64 SYSV. */ set_gdbarch_frame_red_zone_size (gdbarch, 288); else if (!sysv_abi && wordsize == 4) - /* PowerOpen / AIX 32 bit. */ - set_gdbarch_frame_red_zone_size (gdbarch, 220); + /* PowerOpen / AIX 32 bit. The saved area or red zone, consists + 19 4 byte GPRS + 18 8 byte FPRs giving a total of 220. Problem + is, 220 isn't frame (16 byte) aligned. Round it up to 224. */ + set_gdbarch_frame_red_zone_size (gdbarch, 224); set_gdbarch_deprecated_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos); set_gdbarch_deprecated_push_return_address (gdbarch, ppc_push_return_address); set_gdbarch_believe_pcc_promotion (gdbarch, 1); --------------010409040702050801000304--