News for hackers. Stuff that matters.
Re:C++ Just My Code Stepping in Visual Studio by 1_player on Sunday July 01, 2018 @02:27PM (#17436823)
The problem is that the normal implementation of a breakpoint/step is replace a single byte with a 0xCC opcode (INT 3), which will be hit by every thread. Making it lock onto a single thread would require a conditional breakpoint, checking the thread ID every time that code path is executed, which might potentially use a lot of CPU. I'm not sure that kind of conditional breakpoint has hardware support.

It's definitely possible to implement, but not as easy as using a regular INT 3 instruction.

Re:C++ Just My Code Stepping in Visual Studio by nitwit005 on Sunday July 01, 2018 @06:19PM (#17437983)
Not sure anyone would care about that cost. Generally people are glad to waste CPU time instead of human time.
Re:C++ Just My Code Stepping in Visual Studio by legulere on Sunday July 01, 2018 @05:25PM (#17437697)
Should be doable with help from the operating system to have thread-local storage for the code segment when debugging.
Re:C++ Just My Code Stepping in Visual Studio by 1_player on Sunday July 01, 2018 @06:05PM (#17437903)
That sounds like a pretty good idea, would be nice to see gdb implement something like that.