• 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: How do I set a watchpoint?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I set a watchpoint?


  • Subject: Re: How do I set a watchpoint?
  • From: Kate Stone <email@hidden>
  • Date: Sat, 23 May 2015 15:04:56 -0700

You can evaluate an Objective-C _expression_ in a Swift frame by overriding the default language like so:

(lldb) expr -fx --language=objc++ -- $rax
(unsigned long) $0 = 0x00006080000c2ca0

… and then set a conditional breakpoint on free that tests the first argument to see if it matches:

(lldb) breakpoint set -n free -c "$arg1 == 0x00006080000c2ca0”

Of course this will slow down calls to free dramatically so you may need to be rather patient if there’s a lot of heap activity between setting the breakpoint and freeing the pointer you’re looking for.  I don’t think watchpoints are going to do you much good here because freeing an allocation doesn’t change the allocated memory, just the bookkeeping in malloc’s internal data structures.

Kate Stone email@hidden
 Xcode Runtime Analysis Tools
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
  • Follow-Ups:
    • Re: How do I set a watchpoint?
      • From: Jens Alfke <email@hidden>
References: 
 >How do I set a watchpoint? (From: Jens Alfke <email@hidden>)

  • Prev by Date: How do I set a watchpoint?
  • Next by Date: Re: How do I set a watchpoint?
  • Previous by thread: How do I set a watchpoint?
  • Next by thread: Re: How do I set a watchpoint?
  • Index(es):
    • Date
    • Thread