public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Getting more information about functions arguments/locals in machine description
@ 2002-05-03  7:20 Alexandre Courbot
  2002-05-03 11:36 ` mike stump
  0 siblings, 1 reply; 2+ messages in thread
From: Alexandre Courbot @ 2002-05-03  7:20 UTC (permalink / raw)
  To: GCC List

Hi everybody, 

I somehow asked this question already a few weeks ago, but unfortunately
didn't advance in this area. A little clue or pointer would be of great
help! :) 

My problem is that I need to "declare" every argument or local variable
used by a function. Yet the FUNCTION_PROLOGUE allows me to know how many
bytes I need to allocate on the stack for them, but I need more precise
information. I need to know how many arguments/local variables have
being used and their starting offset on the stack (their size would
actually help too), so I can generate something like: 

function foo: 
  .Arg a1, a2, a3 
  .Local l1, l2, l3 

With this information, it'd be quite straightforward to to intercept the
insns accessing to the local variables/arguments and output the label of
the variable instead of an indirect reference. Yet, I still have no clue
on how to get this information. 

It seemed to me, that the data structures for per-function information
(as mentionned in the manual) could help, as you can define your own
additional data structure for functions. However, having looked
carefully in function.h and others relevant files, I see no place where
I could retrieve such information. 

Is there a possible trick here? Can someone enlighten me? :)

Thank you for your time,
Alex.
-- 
http://www.gnurou.org

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

* Re: Getting more information about functions arguments/locals in machine description
  2002-05-03  7:20 Getting more information about functions arguments/locals in machine description Alexandre Courbot
@ 2002-05-03 11:36 ` mike stump
  0 siblings, 0 replies; 2+ messages in thread
From: mike stump @ 2002-05-03 11:36 UTC (permalink / raw)
  To: alexandrecourbot, gcc

> From: Alexandre Courbot <alexandrecourbot@linuxgames.com>
> To: GCC List <gcc@gcc.gnu.org>
> Date: 03 May 2002 16:25:26 +0200

> I somehow asked this question already a few weeks ago, but
> unfortunately didn't advance in this area.

Right, that is because what you want cannot be directly supported,
sorry.  The person that designed your assembly didn't quite know what
they were doing, and really screwed it for you.  Sorry, you'll have to
take that up with them.  :-(

> A little clue or pointer would be of great help! :)

Isn't possible.

> Is there a possible trick here? Can someone enlighten me? :)

Yes, the typical solution is to build a virtual machine ontop of your
real machine that behaves like a normal machine, and then target that
machine from gcc.

If you totally ignore the assembler, and fine a manual for the machine
code, and then port gas to the machine, you'll get farther.  If the
machine code is `weird', then you really are stuck with layer of a
virtual machine on top the real one.

Since you didn't reference a document that describes the actual
machine, we cannot say more.

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

end of thread, other threads:[~2002-05-03 18:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-03  7:20 Getting more information about functions arguments/locals in machine description Alexandre Courbot
2002-05-03 11:36 ` mike stump

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).