This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: finding a function with address
- To: mathieu_dube at videotron dot ca
- Subject: Re: finding a function with address
- From: jtc at redback dot com (J.T. Conklin)
- Date: 01 Feb 2001 15:56:00 -0800
- Cc: gdb at sources dot redhat dot com
- References: <0102011549450J.24336@therver.local2.lan>
- Reply-To: jtc at redback dot com
>>>>> "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