Search code examples
javaandroideclipsedebuggingconditional-breakpoint

Is it possible to link conditional breakpoints and scrapbook in Eclipse?


Is it possible to link conditional breakpoints and scrapbook in Eclipse? I would like to have a conditional breakpoint trigger a piece of scrapbook code to be run (automatically). Something like...

if(x==4) //Conditional Breakpoint
->Run Scrapbook Code

I know this would be trivial by modifying the source but needs to be done against production code or during Codelock. Alternatively, is there any way of doing this using some other tools? *Note, this is for Android Development (Not sure if that'll affect solutions)


Solution

  • Only way I know of is a combination of a conditional break point and use of the display view.

    First you would create your conditional break point by

    1. Right-clicking your break point
    2. Go to Breakpoint Properties
    3. Enable Condition
    4. Enter in your conditional

    Then run your application and once your debugger hits your breakpoint

    1. Go to the Display view
    2. Enter in whatever piece of code you want to test
    3. Execute that statement(s)