Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8500175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:52:25+00:00 2026-06-11T00:52:25+00:00

In some debuggers this is called setting a trap on a variable. What I

  • 0

In some debuggers this is called “setting a trap” on a variable. What I want to do is trigger a breakpoint on any statement that changes the object. Or changes a property of the object.

I have an NSMutableDictionary that gets a value/key added to it but I can’t find any statement that could be doing that.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T00:52:27+00:00Added an answer on June 11, 2026 at 12:52 am

    You can set a watchpoint (from here):

    Set a watchpoint on a variable when it is written to.
    (lldb) watchpoint set variable -w write global_var
    (lldb) watch set var -w write global_var
    (gdb) watch global_var
    Set a watchpoint on a memory location when it is written into. The size of the region to watch for defaults to the pointer size if no '-x byte_size' is specified. This command takes raw input, evaluated as an expression returning an unsigned integer pointing to the start of the region, after the '--' option terminator.
    (lldb) watchpoint set expression -w write -- my_ptr
    (lldb) watch set exp -w write -- my_ptr
    (gdb) watch -location g_char_ptr
    Set a condition on a watchpoint.
    (lldb) watch set var -w write global
    (lldb) watchpoint modify -c '(global==5)'
    (lldb) c
    ...
    (lldb) bt
    * thread #1: tid = 0x1c03, 0x0000000100000ef5 a.out`modify + 21 at main.cpp:16, stop reason = watchpoint 1
    frame #0: 0x0000000100000ef5 a.out`modify + 21 at main.cpp:16
    frame #1: 0x0000000100000eac a.out`main + 108 at main.cpp:25
    frame #2: 0x00007fff8ac9c7e1 libdyld.dylib`start + 1
    (lldb) frame var global
    (int32_t) global = 5
    List all watchpoints.
    (lldb) watchpoint list
    (lldb) watch l
    (gdb) info break
    Delete a watchpoint.
    (lldb) watchpoint delete 1
    (lldb) watch del 1
    (gdb) delete 1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a singleton object called PoolManager that loads and saves some data in
So I have some code that looks like this, written in and compiled with
For example I have this gem called Authlogic-openid, that plugin is outdated, no longer
For some reason, it seems that stopping at a breakpoint during debugging will kill
Some time ago I've read an article on CLR, where author showed that if
Some setup background first: I have a cronjob which runs a PHP file called
Some reasons i am experiencing this issue on my website. When the website loads
For some reason the custom setter of a property never gets called. So it
We've been coping with this issue for quite some time and find only half
I'm observing some strange behavior with a local variable within a nested for loop

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.