Break on access or change of variable.

12,321 views
Skip to first unread message

Peng Yu

unread,
Jan 15, 2012, 8:46:49 PM1/15/12
to Google Chrome Developer Tools
Hi,

I don't see how to break when a variable is accessed or changed. I'm
wondering if there is a way to do so. Please let me know if I miss
anything. Thanks!

http://code.google.com/chrome/devtools/docs/scripts-breakpoints.html

--
Regards,
Peng

Yury Semikhatsky

unread,
Jan 16, 2012, 2:20:01 AM1/16/12
to Peng Yu, Google Chrome Developer Tools
Hi Peng,

You are not missing anything, data breakpoints are not supported by
Chrome Developer Tools yet.

As a workaround in some cases you could try converting your propery
into a getter and setter pair and set breakpoints inside them.

Yury

Peng Yu

unread,
Jan 16, 2012, 8:35:59 AM1/16/12
to Yury Semikhatsky, Google Chrome Developer Tools
Hi Yury,

> You are not missing anything, data breakpoints are not supported by
> Chrome Developer Tools yet.

Thanks for confirming it.

> As a workaround in some cases you could try converting your propery
> into a getter and setter pair and set breakpoints inside them.

Just to want to make sure. If I'm working some code without any of
these getter/setter pairs, in order to capture all the changes, I will
have to add getter or setter each instance a variable is accessed or
changed?

How much the performance degradation will be if all changes and
accesses are through setters and getters?

Is there any plan on implementing data breakpoint in devtools?

--
Regards,
Peng

Yury Semikhatsky

unread,
Jan 16, 2012, 9:07:14 AM1/16/12
to Peng Yu, Google Chrome Developer Tools
On Mon, Jan 16, 2012 at 5:35 PM, Peng Yu <peng...@gmail.com> wrote:
Hi Yury,

> You are not missing anything, data breakpoints are not supported by
> Chrome Developer Tools yet.

Thanks for confirming it.

> As a workaround in some cases you could try converting your propery
> into a getter and setter pair and set breakpoints inside them.

Just to want to make sure. If I'm working some code without any of
these getter/setter pairs, in order to capture all the changes, I will
have to add getter or setter each instance a variable is accessed or
changed?

That's correct. You could replace an object property with a getter/setter
pair having trivial implementation. Then you'd be able to set breakpoints
inside them. Of cause it won't work for local variables.
 
How much the performance degradation will be if all changes and
accesses are through setters and getters?

It depends on your application and how extensively the property is used.
You will need to measure it.

 
Is there any plan on implementing data breakpoint in devtools?

We've been discussing this several times but no one expressed enough
interest in implementing this. So there are no immediate plans on implementing
this feature.

Yury

 
--
Regards,
Peng

migm...@google.com

unread,
Apr 25, 2013, 3:13:04 PM4/25/13
to google-chrome-...@googlegroups.com, Peng Yu
If you go search for it, there are plenty of people asking for how to do it and it's a feature in firefox.

I totally needed this today.  Badly.  Sadface that you don't have it.  I don't easily have the ability to inject a getter/setter pair into the code that's being required into the loaded module.

mig

jor...@everyvine.com

unread,
Sep 29, 2013, 1:38:53 PM9/29/13
to google-chrome-...@googlegroups.com, Peng Yu
I would love to see this. Its not always trivial to refactor with getter / setter.


On Monday, January 16, 2012 6:07:14 AM UTC-8, Yury Semikhatsky wrote:

sandro....@gmail.com

unread,
Mar 27, 2014, 7:14:50 AM3/27/14
to google-chrome-...@googlegroups.com

conor....@gmail.com

unread,
Apr 30, 2014, 12:35:20 PM4/30/14
to google-chrome-...@googlegroups.com, sandro....@gmail.com
Wish wish wish we could have this as a built-in feature in chrome. Sometimes we are debugging 3rd-party code/libraries, and we want to know what triggered a modification of some property.

gdevqui...@gmail.com

unread,
Dec 18, 2015, 4:10:30 PM12/18/15
to Google Chrome Developer Tools, sandro....@gmail.com, conor....@gmail.com
I would pay to have this feature !!!  What happened to getting it done?  It is now the end of 2015.  I have to believe this is high on people's Dev Tools list.  Is there a current status or more current group on this outstanding request?

PhistucK

unread,
Dec 18, 2015, 4:13:50 PM12/18/15
to Google Chrome Developer Tools, sandro....@gmail.com, conor....@gmail.com
You can search crbug.com for an existing issue and star it. If you cannot find one, file a new issue using the "New issue" link on the same page.
Please, do not add a "+1" or "Me too" or "Confirmed" (or similar) comment. It just wastes the time of Chrome engineers and sends unnecessary e-mails to all of the people who starred the issue.

You can reply with a link to the found or created issue and might get triaged (and fixed) faster.

Note that if the issue gets a lot of stars, it might be implemented faster.



PhistucK

--
You received this message because you are subscribed to the Google Groups "Google Chrome Developer Tools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-develo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-chrome-developer-tools/0e106e8a-560c-435c-9671-ef04573351f2%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Tucker Connelly

unread,
Jan 12, 2016, 2:00:01 AM1/12/16
to Google Chrome Developer Tools
I too would like this feature :)

PhistucK

unread,
Jan 12, 2016, 2:03:56 AM1/12/16
to Google Chrome Developer Tools
So search for an issue at crbug.com and star it, or file one if you cannot find one?


PhistucK

On Tue, Jan 12, 2016 at 5:14 AM, Tucker Connelly <tuckerco...@gmail.com> wrote:
I too would like this feature :)

--
You received this message because you are subscribed to the Google Groups "Google Chrome Developer Tools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-develo...@googlegroups.com.

jason...@gmail.com

unread,
Mar 15, 2018, 3:32:47 AM3/15/18
to Chrome DevTools
I found this one


star to vote it, top left


On Tuesday, January 12, 2016 at 6:03:56 PM UTC+11, PhistucK wrote:
So search for an issue at crbug.com and star it, or file one if you cannot find one?


PhistucK

On Tue, Jan 12, 2016 at 5:14 AM, Tucker Connelly <tuckerco...@gmail.com> wrote:
I too would like this feature :)

--
You received this message because you are subscribed to the Google Groups "Google Chrome Developer Tools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-developer-tools+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages