This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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: gas preprocessor


Hi Crni,

> Is preprocessing support in gas working? Am trying to utilize it
> with gas 2.11.90.0.8 in order to create alias names for functions
> arguments instead of use [ebp+8] etc. (am using Intel syntax). What
> I'm actually looking for is gas equivalent of EQU directive commonly
> found in other (well, at least IA-32) assemblers. I know that I
> could accomplish same using gcc preprocessor but I don't like this
> solution (when debugging code using gdb I have to struggle again
> with [ebp+8] and alike). 

I believe that the short answer to your question is "no".

You can use the .set directive to set up assemble time aliases for
expressions, so you could do:

        .set foo, [ebp+8]

This will not generate a debugging entry however, so you will not be
able to see 'foo' in your GDB sessions.

You might be able to use the register aliasing ability of gcc to solve
your problem however.  For example a declaration like this:

  register int ebp_reg asm ("ebp");

would create a variable called 'ebp_reg' which was mapped onto the ebp
register and which could be viewed inside gdb.

Cheers
        Nick


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