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]

Novice question on function addresses ofsymbol table


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


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