Where does dbx get addresses for use with ptrace()?

Mark Boolootian booloo at lll-crg.llnl.gov
Thu Feb 28 11:31:10 AEST 1991


Can anyone tell me how dbx comes up with addresses to hand to ptrace()?  For
example, when breakpointing at a given line number in a C program, how does dbx 
calculate the address of the first instruction for that line (which is what I
am assuming is handed to ptrace()).  

And, while I'm at it, am I correct to assume that dbx stuffs some illegal 
instruction in place of the instruction at the breakpoint location, replacing
it with the original instruction when a "continue" is issued to the debugger?

I'm asking about dbx on a BSD-derived system.  Is dbx on SYSV different?  I
know that SYSV has the /proc directory (used for reading/writing a process as I
understand it).  Does this correspond to the core image that ptrace() on BSD
systems work with?

Thanks in advance for any info.  I can take replies via email and summarize (and
will do so unless reponses are posted).  

cheers,
mb

booloo at lll-crg.llnl.gov



More information about the Comp.unix.wizards mailing list