This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [rfc/rfa:arm] rewrite arm_push_arguments() as a single two pass loop
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Andrew Cagney <ac131313 at cygnus dot com>
- Cc: gdb-patches at sources dot redhat dot com, Richard dot Earnshaw at arm dot com
- Date: Wed, 12 Jun 2002 14:11:56 +0100
- Subject: Re: [rfc/rfa:arm] rewrite arm_push_arguments() as a single two pass loop
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
> > Hello,
> >
> > The code to push arguments onto the stack, for many ABI's, involves two passes:
> >
> > 1. iterate over the arguments. compute the location/offset of each, accumulate results (to compute the size of the stack frame).
> >
> > 2. iterate over the arguments, compute the location/offset of each, store accordingly
> >
> > The attached patch rewrites arm_push_arguments() so that the two passes are combined into a single two-pass for-loop. The only difference between the first and second pass of the loop is that the second pass stores values. The intent is to make the maintenance of the function easier - e.g. adding FP support would now involve one addition (currently it involves two).
> >
> > Thoughts, on the general approach?
> >
> > It also adds the command ``set debug arm'' which will cause the code to print out the arguments as they are pushed.
> >
> > Ok for arm?
> > Andrew
>
> Hmm, with patch ...
>
Looks ok to me (at least, I can't spot any problems by inspection).
R.