This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] sparc-solaris stack-checking - new prologue sequence


> Date: Thu, 19 May 2011 11:20:16 +0200
> From: Jerome Guitton <guitton@adacore.com>
> 
> Ping? I'm attaching a slightly different patch after having fixed
> a small style issue.
> 
> I can now run the gdb-testsuite without crashing my sparc-solaris
> machine; not sure what have changed in the meantime. In any case, I
> had no new regressions and one new PASS (stack-checking.exp).
> 
> OK to apply?

I had wanted to give this a spin on OpenBSD/sparc, but unfortunately
my SS20 seems to have hardware issues.  Origionally I thought the
changes were restricted to 32-bit code.  But it seems this code is use
for 64-bit code as well.  So I'll give this a spin on an
OpenBSD/sparc64 machine tonight.

Some (very minor) turd shining nits:

> gdb/ChangeLog:
> 
> 	* sparc-tdep.c (sparc_skip_stack_check): Recognize a new instruction
> 	sequence for probing loops.
> 
> diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
> index 1039bd8..5f07827 100644
> --- a/gdb/sparc-tdep.c
> +++ b/gdb/sparc-tdep.c
> @@ -609,9 +609,28 @@ sparc_skip_stack_check (const CORE_ADDR start_pc)
>    CORE_ADDR pc = start_pc;
>    unsigned long insn;
>    int offset_stack_checking_sequence = 0;
> +  int probing_loop = 0;
>  
>    /* With GCC, all stack checking sequences begin with the same two
> -     instructions.  */
> +     instructions, plus an optional one in the case of a probing loop:
> +
> +         sethi <some immediate>,%g1
> +         sub %sp, %g1, %g1
> +
> +     or:
> +
> +         sethi <some immediate>,%g1
> +         sethi <some immediate>, %g4
> +         sub %sp, %g1, %g1
> +
> +     or:
> +
> +         sethi <some immediate>,%g1
> +         sub %sp, %g1, %g1
> +         sethi <some immediate>, %g4

Spacing here is a tad bit inconsistent.  Would be nice if you could
make sure there always is a space after a comma.

> +  /* optional: sethi  <some immediate>, %g4 */

And here there are two spaces after the sethi, where you use only a
single space before.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]