3 ms·
Its interesting to see developers talking about and building debuggers whilst only apparently having experience of one. EDIT: apparently the following is no lo
by Normal_gaussian 7y ago
Its interesting to see developers talking about and building debuggers whilst only apparently having experience of one.
EDIT: apparently the following is no longer true
From gdb, going to Chrome dev tools was super painful. I had been used to writing high quality watch statements. watch x, and break if it is <criteria> is a very powerful debugging mechanism.
Chrome has "pin this variable and tell me its value every time I pause". This is overly manual. Its bad enough trying to get the erronous middle value when looping over a 10k array, never mind a more complex data structure where the error condition will depend on a parent/less obvious value.
Im not familiar with many debuggers, and I know I'm not a true expert in any. Id be keen to know what people think are awesome debugger features.
- nwienert 7y agoThat’s actually not true anymore, Chrome supports conditional breaks and expressions.
- hboon 7y agoEdit and continue/resume
- z3t4 7y agoif(x) throw x
- Normal_gaussian 7y agoThe reason this doesn't work in the same way is because it requires you to know where the error occurs. You tend to operate on a data structure and know that at some point x becomes y. By placing a watch on x you find out where that point is. Editing the code does not get you this (bar modern proxies in js).
- plausibilities 7y agoif(x) { debugger }
- Normal_gaussian 7y agoPlay with conditional watchpoints in gdb to understand why this does not make sense as a reply to the comment explaining why this is not a substitute.
- z3t4 7y agoAha. I sometimes use ES5 defineProperty where you can define get and set functions. I built an ORM using defineProperty. Where changing a value triggers an database update. But the best way is to avoid globals or only update it at one place.