This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB 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: function address from object file?


Hi,

Hi,
    I am trying to print function address by reading an object file.
But the function address are all shown to be zero. How serious is this
bug? Here is the repro:-

$ cat a.c
#include <stdio.h>

void t(void)
{
        int i=0;
        printf("%d\n",i);
}

void u(void)
{
        int i=0;
        printf("%d\n",i);
}

int main()
{
        t();
        return 0;
}


$ gcc -c -g -o a.o a.c


This is not a bug . Go look at the doco for gcc -c . It only creates object files and not executables. So these are not complete executables in the first place.So gdb is ok in what it is doing in this case.

cheers
Ramana

--
Ramana Radhakrishnan
GNU Tools
codito ergo sum (www.codito.com)


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