This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Issue with debugging information generated by compiler gcc 4.3.3.
- From: Ian Lance Taylor <iant at google dot com>
- To: sumanth <sumanth dot gundapneni at redpinesignals dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Fri, 03 Apr 2009 07:54:08 -0700
- Subject: Re: Issue with debugging information generated by compiler gcc 4.3.3.
- References: <49D5D552.6000904@redpinesignals.com>
sumanth <sumanth.gundapneni@redpinesignals.com> writes:
> I have an issue related to debugging information generated by compiler.
> DEBUGGING TYPE is DWARF2.
> COMPILER : gcc 4.3.3
> Address of local variables is not generated aptly .
> Lets take a sample code Example :
> int main ()
> {
> int a , b, c;
> a=10;
> b=20;
> c =a+b;
> return 0;
> }
>
> when I debug it with gdb , address of variables a, b, c are not as
> intended .
> All the local variables should be filled in between frame pointer and
> stack pointer ( stack is a top down stack).
> Rather the local variables address are located 8 locations below stack
> pointer.
>
> Can anyone point me to the apt solution for this problem. What macros
> should I refer to for correct debugging information generated by
> compiler.
Are you sure there is a problem? The compiler is free to place local
variables where it chooses, within certain constraints. The debugging
information must reflect the actual location of the variables. It is
permitted for variables to be below the stack pointer on a processor
which uses a red zone, such as the x86_64.
Ian