• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Re: Memory watchpoints
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re: Memory watchpoints


  • Subject: Re: Re: Memory watchpoints
  • From: "Mark Wagner" <email@hidden>
  • Date: Thu, 12 Oct 2006 11:35:12 -0700

On 10/12/06, Jim Ingham <email@hidden> wrote:
So first, you should be aware of the limitations of the watchpoint
support on Mac OS X.  This is from the gdb release notes - i.e.

file:///Developer/ADC Reference Library/releasenotes/DeveloperTools/GDB.html


> Hardware (page protection) watchpoint support > Hardware watchpoints are now supported, with a few limitations. They > are implemented using the page-protection mechanism of Mach, not > using the hardware watchpoint register. To insert a watchpoint, gdb > write-protects the entire page containing the memory address, then > traps for write faults to that page. Unfortunately, the Mach kernel > does not generate a write fault when a system call tries to write to > a protected page --- instead it returns error status to the calling > application. So, for example, if you try to read() from a file into > memory on any page that contains a watchpoint, read() will return > with EADDR, rather than triggering the watchpoint. Also, watchpoints > on stack addresses (local variables being the most likely example) > can sometimes cause unexpected results.

If this doesn't explain what you are seeing, then you are probably
running into some bug we don't know about yet.  In that case, if you
can get us a reproducible test case, please file a bug and we will
take a look at it.


That would explain it perfectly. The program does its own I/O buffering, and the watchpoint is set on one of the variables tracking the state of the buffer. The buffer itself is probably on the same memory page as the tracking variables.

--
Mark Wagner
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Memory watchpoints (From: "Mark Wagner" <email@hidden>)
 >Re: Memory watchpoints (From: "Justin C. Walker" <email@hidden>)
 >Re: Re: Memory watchpoints (From: "Mark Wagner" <email@hidden>)
 >Re: Memory watchpoints (From: Chris Espinosa <email@hidden>)
 >Re: Re: Memory watchpoints (From: "Mark Wagner" <email@hidden>)
 >Re: Memory watchpoints (From: Jim Ingham <email@hidden>)

  • Prev by Date: Re: Memory watchpoints
  • Next by Date: Re: RE: Re: Reducing memory consumption
  • Previous by thread: Re: Memory watchpoints
  • Next by thread: Re: Memory watchpoints
  • Index(es):
    • Date
    • Thread