How to set conditional breakpoint based on string comparison in Visual Studio? [duplicate]

For use in Visual Studio, this has been answered here. In particular, the string provided in OBWANDO’s answer can be used to set the break point condition. Note, however, that it is a bit klugy. You will receive a warning message when the breakpoint is hit even though the debugger has stopped. It doesn’t appear … Read more

VS 2008 breakpoint will not currently be hit. No symbols have been loaded for this document

This may be an old question, but I wanted to answer it after I found a solution for this very problem because it was one of the most complete questions asked in regards to this topic. Intro My project is an ASP.NET application, but the base problem will happen on WinForms as well. The problem … Read more

What are data breakpoints?

Good ol’ Daniel LeCheminant has a solid answer on what a data breakpoint does, so i’ll toss in some anecdotes that highlight useful uses: Any scenario where you know what will change, but have little or no idea where the code changing it lives (since otherwise you could simply use a conditional breakpoint). Specifically, “Impossible” … Read more

how can I put a breakpoint on “something is printed to the terminal” in gdb?

Use a conditional breakpoint that checks the first parameter. On 64-bit x86 systems the condition would be: (gdb) b write if 1==$rdi On 32-bit systems, it is more complex because the parameter is on the stack, meaning that you need to cast $esp to an int * and index the fd parameter. The stack at … Read more

Is there any way to set a breakpoint in gdb that is conditional on the call stack?

Update: There is now a better answer to this question: use GDB _is_caller convenience function. The need you describe comes up quite often, usually in the context of some_utility_fn being called a lot, but you only are interested in the call which comes from some_other_fn. You could probably script this entire interaction using the new … Read more