Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

When the 'return' statement is put on the same line as the parent 'if' statement, setting a breakpoint on returning requires dealing with the assembly code and hex values (identifying the instruction that implements the return (could be a ret or a jump), then using its address to set the breakpoint.

When the return statement is kept on its own line, this is much easier.



Or using advanced GUI debuggers that allow middle statement breakpoints.


Which debuggers for C or C++ do this, and which compilers do they work with?


Visual C++, if I am not mistaken it was introduced on VS 2015.


C/C++ breakpoints still appear to be line-based in VS2017. (C# breakpoints have been statement-based for a long time...)


I see, my failure then.

When on VS, I spend most of my time on the .NET side, so I thought it was on the C++ side as well.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: