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]

Re: finding a function with address


>>>>> "Mathieu" == Mathieu Dube <mathieu_dube@videotron.ca> writes:
Mathieu> Im debugging an application with gdb and when the app
Mathieu> segfaults gdb outputs : 0x400da0a4 in ?? ()
Mathieu>
Mathieu> I would like to find out the name of the function that should
Mathieu> be in the place of the "??".

GDB should be able to determine the name of the function if it has a
symbol for that address.  If it doesn't, perhaps the PC has gone
outside your programs boundaries.  One common way this occurs is
when a function pointer is corrupted.

For example:
        $ cat foo.c
        int (*foo)() = 0x12345678;

        main()
        {
                foo();
        }
        $ gcc foo.c
        $ gdb a.out
        .
        .
        .
        (gdb) run
        Starting program: /tmp/a.out

        Program received signal SIGSEGV, Segmentation fault.
        0x12345678 in ?? ()
        (gdb) bt
        #0      0x12345678 in ?? ()
        #1      0x10ee in main ()


Perhaps you could share more information?  What is the target?  Is the
executable linked staticly or dynamically?  Is 0x400da0a4 within the
text segment of your executable.  Can you still get a backtrace (the
stack might not be corrupted)?

        --jtc

-- 
J.T. Conklin
RedBack Networks

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