Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [rfa/6.0] fix aix inferior calls
@ 2003-09-29 20:05 Andrew Cagney
  2003-09-29 20:22 ` Kevin Buettner
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Cagney @ 2003-09-29 20:05 UTC (permalink / raw)
  To: Kevin Buettner; +Cc: gdb-patches, peter.schauer

Hello,

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"?

Andrew

PS: Thanks to peter for testing the AIX target.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [rfa/6.0] fix aix inferior calls
  2003-09-29 20:05 [rfa/6.0] fix aix inferior calls Andrew Cagney
@ 2003-09-29 20:22 ` Kevin Buettner
  2003-09-29 20:33   ` Andrew Cagney
  0 siblings, 1 reply; 6+ messages in thread
From: Kevin Buettner @ 2003-09-29 20:22 UTC (permalink / raw)
  To: Andrew Cagney, Kevin Buettner; +Cc: gdb-patches, peter.schauer

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, 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.)

Kevin


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [rfa/6.0] fix aix inferior calls
  2003-09-29 20:22 ` Kevin Buettner
@ 2003-09-29 20:33   ` Andrew Cagney
  2003-09-29 20:55     ` Andreas Schwab
  2003-09-30  0:31     ` Kevin Buettner
  0 siblings, 2 replies; 6+ messages in thread
From: Andrew Cagney @ 2003-09-29 20:33 UTC (permalink / raw)
  To: Kevin Buettner; +Cc: gdb-patches, peter.schauer

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

> 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


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

2003-09-29  Andrew Cagney  <cagney@redhat.com>

	* 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);

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [rfa/6.0] fix aix inferior calls
  2003-09-29 20:33   ` Andrew Cagney
@ 2003-09-29 20:55     ` Andreas Schwab
  2003-09-30  0:31     ` Kevin Buettner
  1 sibling, 0 replies; 6+ messages in thread
From: Andreas Schwab @ 2003-09-29 20:55 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches

Andrew Cagney <ac131313@redhat.com> writes:

> @@ -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

Typo: s/$/ of/ ?

> +       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);

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [rfa/6.0] fix aix inferior calls
  2003-09-29 20:33   ` Andrew Cagney
  2003-09-29 20:55     ` Andreas Schwab
@ 2003-09-30  0:31     ` Kevin Buettner
  2003-09-30 21:13       ` Andrew Cagney
  1 sibling, 1 reply; 6+ messages in thread
From: Kevin Buettner @ 2003-09-30  0:31 UTC (permalink / raw)
  To: Andrew Cagney, Kevin Buettner; +Cc: gdb-patches, peter.schauer

On Sep 29,  4:33pm, Andrew Cagney wrote:

> 	* rs6000-tdep.c (rs6000_gdbarch_init): Set the PowerOpen red zone
> 	to 224, not 220.

Okay, so long as you incorporate Andreas' suggested comment fix.

Kevin


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [rfa/6.0] fix aix inferior calls
  2003-09-30  0:31     ` Kevin Buettner
@ 2003-09-30 21:13       ` Andrew Cagney
  0 siblings, 0 replies; 6+ messages in thread
From: Andrew Cagney @ 2003-09-30 21:13 UTC (permalink / raw)
  To: Kevin Buettner; +Cc: gdb-patches, peter.schauer

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

> On Sep 29,  4:33pm, Andrew Cagney wrote:
> 
> 
>> 	* rs6000-tdep.c (rs6000_gdbarch_init): Set the PowerOpen red zone
>> 	to 224, not 220.
> 
> 
> Okay, so long as you incorporate Andreas' suggested comment fix.

This is what was committed.

Andrew


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

2003-09-29  Andrew Cagney  <cagney@redhat.com>

	* 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	30 Sep 2003 21:09:02 -0000
@@ -2948,8 +2948,11 @@
     /* 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 of
+       19 4 byte GPRS + 18 8 byte FPRs giving a total of 220 bytes.
+       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);

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-09-30 21:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-29 20:05 [rfa/6.0] fix aix inferior calls Andrew Cagney
2003-09-29 20:22 ` Kevin Buettner
2003-09-29 20:33   ` Andrew Cagney
2003-09-29 20:55     ` Andreas Schwab
2003-09-30  0:31     ` Kevin Buettner
2003-09-30 21:13       ` Andrew Cagney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox