1

I am debugging a "Hello World" program written in C# using mdgb, but it seems gdb-style conditional breakpoints failed to set in mdbg, e.g.

  [p#:0, t#:0] mdbg> when 1 sum>100
  Error: Invalid command syntax

TODO: fixme image

This is when related syntax, but i still don't know how to setup conditional breakpoint in mdbg, althoug I read mdbg documenation [MSDN]

TODO: fixme image

So what is cond 1 sum>100 in mdbg?

How do I set a breakpoint conditionally?

Edit 1 @ThomasWeller your when clause is correct in syntax, but it seems it's not a conditional breakpoint, since g hit the breakpoint again, and the when clause not works, if it works, g should break when sum is larger than 100, but in fact g breaks when sum is 1, far smaller than 100 :(

Edit 2 when BreakpointHit 1 do echo sum>100 not works

Community
  • 1
  • 1
hugemeow
  • 7,777
  • 13
  • 50
  • 63

1 Answers1

3

Conditional Breakpoints aren't supported. If you were really really serious about getting conditional breakpoints in MDbg you could download the source and add the feature: http://www.microsoft.com/en-us/download/details.aspx?id=2282

Alternatively you could grab a free version of Visual Studio which supports conditional breakpoints.

Noah Falk
  • 41
  • 2
  • how do you know mdbg does not support conditional breakpoint? – hugemeow Apr 30 '15 at 17:37
  • 1
    I work for Microsoft on the .Net Framework team. Among other responsibilities I would consider myself the owner of the MDbg source code ; ) – Noah Falk May 02 '15 at 11:29
  • lol, mdbg is very nice tool, better with conditional breakpoint enabled:) – hugemeow May 03 '15 at 06:48
  • do you use cdb as c++ debug, i have one question here http://stackoverflow.com/questions/30011043/how-to-set-breakpoint-and-show-source-code-when-using-cdb-to-debug-c-programs – hugemeow May 03 '15 at 07:02