Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!lll-winken!lll-crg.llnl.gov From: booloo@lll-crg.llnl.gov (Mark Boolootian) Newsgroups: comp.unix.wizards Subject: Where does dbx get addresses for use with ptrace()? Message-ID: <92124@lll-winken.LLNL.GOV> Date: 28 Feb 91 00:31:10 GMT Sender: usenet@lll-winken.LLNL.GOV Organization: Lawrence Livermore National Laboratory Lines: 21 Nntp-Posting-Host: lll-crg.llnl.gov 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@lll-crg.llnl.gov