Home » U++ TheIDE » U++ TheIDE: Other Features Wishlist and/or Bugs » Conditional breakpoints
Re: Conditional breakpoints [message #30649 is a reply to message #30119] |
Thu, 13 January 2011 15:03 |
|
I finally got some time with windows computer, so I could test what I blind coded in past few days
I extended the parser in Exp.cpp to allow comparisons, logical and bitwise operations. Hopefully with correct C++ priorities Then I added a Vector to store the conditions and Pdb::ConditionCheck() function that check whether the condition for given breakpoint is fulfilled or not by evaluating it using Pdb::Exp() call. Up to here it appears to work quite well.
I hit a problem when I tried to "cancel" the breakpoints for which condition is not fulfilled in Pdb::RunToException(). The code looks like it should be enough to break instead of returning and wait for next breakpoint:
switch(event.dwDebugEventCode) {
case EXCEPTION_DEBUG_EVENT: {
// ...
int bp=bp_set.Find((adr_t)event.u.Exception.ExceptionRecord.ExceptionAddress);
if(event.u.Exception.ExceptionRecord.ExceptionCode == EXCEPTION_BREAKPOINT && bp >= 0)
#ifdef CPU_32
context.Eip = (adr_t)event.u.Exception.ExceptionRecord.ExceptionAddress;
#else
context.Rip = (adr_t)event.u.Exception.ExceptionRecord.ExceptionAddress;
#endif
RemoveBp();
LLOG("Exception: " << FormatIntHex(event.u.Exception.ExceptionRecord.ExceptionCode) <<
" at: " << FormatIntHex(event.u.Exception.ExceptionRecord.ExceptionAddress) <<
" first: " << event.u.Exception.dwFirstChance);
if(bp>=0 && !ConditionCheck(bp))
break; // condition doesn't fit - we don't want to stop at this breakpoint
return true; //the condition is true, we should stop
// ...
This however still stops at every breakpoint, regardless if it breaks or returns. Could you give me a hint how to do this properly, please?
Later, it would be also good idea to actually do the check before switching theide back to foreground etc., but that will probably require bigger changes. For now I'm just wondering how to skip the unfitting breakpoints.
Honza
PS: I attach all the changed sources, so you can test.
EDIT: Removed attachment, newer version available below.
[Updated on: Fri, 14 January 2011 17:46] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sun May 12 00:40:48 CEST 2024
Total time taken to generate the page: 0.02792 seconds
|