This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Novice question on function addresses ofsymbol table
- From: <sko at uiuc dot edu>
- To: gdb at sources dot redhat dot com
- Date: Tue, 21 Jun 2005 15:18:41 -0500
- Subject: Novice question on function addresses ofsymbol table
- Reply-to: sko at uiuc dot edu
Hello,
I'm not sure if this is the right place to ask questions like
this, but it'd be great if anyone could give me some pointers.
I'm trying to write a simple debugger that inserts a
breakpoint to the beginning of a function.
I've set up TRACEME and everything for the child process, and
got the symbol table of the child process using ELF library
functions. I've also got the virtual address of the function
of my interest (st_value). After that, I try to insert a
breakpoint using ptrace(PTRACE_POKETEXT, ...) into that
address, but the program doesn't stop there.
So if I get a virtual address of a function from a symbol
table, is it okay to insert a breakpoint to that address to
trap at the beginning of that function?
Thanks,
Steve