This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Interpreting stack frame
- From: Peter Leist <peterleist at googlemail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 23 Mar 2009 17:46:22 +0100
- Subject: Re: Interpreting stack frame
On Fri, Mar 20, 2009 at 4:54 PM, Ian Lance Taylor <iant@google.com> wrote:
> Peter Leist <peterleist@googlemail.com> writes:
>
>> How can I interpret the stack frame of the current_function? That
>> means, how can
>> I tell what is stored at the location FP+xxx. If that is not (easily)
>> possible, it would
>> help if I can somehow determine the type of data stored at that
>> location (i.g is that
>> a reference to a variable or the contents of a variable).
>
> Stack slots can be shared by different variables, so I'm not sure there
> is a coherent answer to this.
I understand that, but at a given point in the program flow the assignment
of stack slot to a variable should be fixed.
> That said, look at assign_stack_local and
> assign_stack_temp in gcc/function.c.
Thanks for the pointer, but it seams these functions are responsible only
for arguments, not for local variables (at least assign_stack_local).
What I try to achieve is: Given the frame pointer for a function X, how can I
tell which of the used stack frames hold what data (at a given time in
the program flow).
To be more exact, I would like to know that before a call is taken. I want to
tell for every stack slot of the *calling* function if the data in that slot is
passed to the called function as a reference or not....
Every debugger should be able to tell that, or am I wrong? Can I probably
extract the information from debug data? I've seen a reference to
x_stack_slot_list
in assign_stack_local.c but that doesn't seem to do the trick.
Thanks,
Peter