Moving the instruction pointer while debugging Java in Eclipse

后端 未结 10 1449
Happy的楠姐
Happy的楠姐 2020-12-13 23:16

Can I move the instruction pointer directly to a line of my choice (within the current method) while debugging a Java program in Eclipse (Galileo)?

相关标签:
10条回答
  • 2020-12-14 00:07

    I like ankon's answer best, but another option (that will only work for your specific instance -- if that) is to stop at a breakpoint on your if and modify the variable(s) evaluated in the conditional such that it returns false (from the "Variables" view, right click on a variable and click "Change Value...")

    0 讨论(0)
  • 2020-12-14 00:08

    Just right click on desired line and choose run to line.That's it...

    0 讨论(0)
  • 2020-12-14 00:13

    unfortunately not possible to step forward with instruction pointer (program counter), so what you need to do instead is to introduce your own "debugging" variables that you can test on - lets say you want to step around a loop that takes too long, then add a variable and test on its increased value and then encapsulate the loop in an if with that variable. I know this is ugly, but it gets it done - or you could just develop in C++ :-)

    0 讨论(0)
  • 2020-12-14 00:16

    I thought that this was totally possible in older versions of eclipse, I thought I had the memory of doing it, but I guess I just implanted that memory when I worked in Visual Studio. From what I'm reading it might come to the jvm and not eclipse itself, there are pages where it's suggested that the jvm cannot handle that.

    In my opinion Eclipse is many many times better than VS, I worked extensively in both and since I discovered Eclipse I was always in pain when I had to work in VS. But not having this feature is definitely hurting right now hehe.

    0 讨论(0)
提交回复
热议问题