debug shared library
Suppose, I debug a *nux application and put a breakpoint into a function defined by a dynamically linked used by the application. Will that breakpoint stop any other application that makes use of the same library?
Thanks |
sure, other applications should stop by a contagion magic
|
Quote:
Quote:
Most code pages of a .so are shared by all processes using that .so at the same time. Breakpoints are implemented by the debugger changing a byte of an instruction into a breakpoint instruction. So it is normal to wonder why those two facts don't combine to put that breakpoint instruction into the address space of every process using that .so. There are a number of different situations in Linux in which a page of virtual memory is shareable by multiple processes as long as none of them write to it, but any process writing to the page gets a private copy. I don't know the exact details of how that mechanism is used for breakpoints in .so mappings, but that is the basic concept. |
johnsfine, Thanks!
Anyone can give a detailed example please? |
All times are GMT -5. The time now is 10:09 AM. |