gdb
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gdb] breakpointing dynamically loaded library functions ??


From: Michael Elizabeth Chastain
Subject: Re: [Gdb] breakpointing dynamically loaded library functions ??
Date: Mon, 18 Aug 2003 03:45:29 -0400

Hi Ankit,

> what i have not been able to figure out is that how does it maintain
> consistency in library functions for different processes that would be
> using these 'shared' functions.  

The operating system takes care of that.

gdb tells the operating system "write some bytes at this address of the
target process".  If that page in the target process is shared with
other processes, the operating system makes a private copy of the page
and then modifies the private copy.  This is called "copy-on-write".

If you have Linux source code, check out kernel/ptrace.c and
mm/memory.c.  The actual copy happens in mm/memory.c,
function do_wp_page.

Hope this helps,

Michael C




reply via email to

[Prev in Thread] Current Thread [Next in Thread]