Bochs debugger new feature: conditional breakpoint
Posted: Sat Jun 03, 2017 1:20 pm
Hi,
I just merged new experimental feature to Bochs debugger you might find interesting.
The feature is ‘conditional continue’ and the syntax is:
> continue if <expression>
The continue will happen ONLY when expression is evaluated as TRUE.
For this reason new operators >, <, >=, <=, ==, != were added to the expression evaluation.
So now you could set a breakpoint in the beginning of function and write rc script which looks like:
Set breakpoint
- c ; reach bp
- c if rax < 10 ; actually it turns bp to conditional, do nothing if condition is false
- c if rax < 10 ; actually it turns bp to conditional, do nothing if condition is false
- c if rax < 10 ; actually it turns bp to conditional, do nothing if condition is false
- c if rax < 10 ; actually it turns bp to conditional, do nothing if condition is false
- c if rax < 10 ; actually it turns bp to conditional, do nothing if condition is false
- c if rax < 10 ; actually it turns bp to conditional, do nothing if condition is false
- c if rax < 10 ; actually it turns bp to conditional, do nothing if condition is false
- c if rax < 10 ; actually it turns bp to conditional, do nothing if condition is false
… how many false steps are expected ?
At the end you stopped on right break point!
Collecting comments about the extension and ways to improve it, probably apply to other Bochs commands
Thanks,
Stanislav
I just merged new experimental feature to Bochs debugger you might find interesting.
The feature is ‘conditional continue’ and the syntax is:
> continue if <expression>
The continue will happen ONLY when expression is evaluated as TRUE.
For this reason new operators >, <, >=, <=, ==, != were added to the expression evaluation.
So now you could set a breakpoint in the beginning of function and write rc script which looks like:
Set breakpoint
- c ; reach bp
- c if rax < 10 ; actually it turns bp to conditional, do nothing if condition is false
- c if rax < 10 ; actually it turns bp to conditional, do nothing if condition is false
- c if rax < 10 ; actually it turns bp to conditional, do nothing if condition is false
- c if rax < 10 ; actually it turns bp to conditional, do nothing if condition is false
- c if rax < 10 ; actually it turns bp to conditional, do nothing if condition is false
- c if rax < 10 ; actually it turns bp to conditional, do nothing if condition is false
- c if rax < 10 ; actually it turns bp to conditional, do nothing if condition is false
- c if rax < 10 ; actually it turns bp to conditional, do nothing if condition is false
… how many false steps are expected ?
At the end you stopped on right break point!
Collecting comments about the extension and ways to improve it, probably apply to other Bochs commands
Thanks,
Stanislav