Re: Setting breakpoint on the end of the method in Eclipse



dt wrote:
Thanks Patricia, this worked. Two things - this is "indirect", as you
said. It will certainly help me do what I wanted (my case is simple
enough for the above technique to be applied), but it still sucks

Well, that certainly is an opinion.

There is no instruction on '}' so there is no place to stop. You whine that the IDE does not add a "nop" (is there even such an instruction in the JVM?). I would whine if the IDE changed my code. I prefer breakpoints to exist only where there is a place to stop, so /my/ opinion is that it does not suck.

and this will not let you do the other thing - stop on the end of the
while loop. To make it a little clearer:

void test() {
boolean a = true;
while(a) {
if(otherMethodReturningBoolean())
a = false;
// other code here
boolean a = true;
while(b) {
if(otherMethodReturningBoolean())
b = false;
} // <--- Breakpoint here
} // <--- Breakpoint here
} // <--- Breakpoint here

Consider the two extra breakpoint possibilities (excluding method
end). How would you debug the end of while(b), while still staying in
while(a) iteration?

Put the breakpoint on the "while ( b )" line.

Right before the first instruction of a loop is the same spot as right after the last.

You get one extra stop, which can be eliminated with a conditional breakpoint if it bothers you that much.

You will also need to set a breakpoint on the first instruction after the loop, which in your case is the "while ( a )" instruction.

With the breakpoint on method exit you now have everything you asked for. It no longer sucks, does it?

--
Lew
.



Relevant Pages

  • Re: programming language
    ... you will find the source code to my bf interpreter. ... instruction_pointer is the index of the instruction currently being executed in the instruction array. ... execute() is where the action happens. ... executegets a pointer to a bf_vm, where it executes one instruction, increments the instruction pointer of the bf_vm so that it points to the next instruction (or does a loop), and returns. ...
    (comp.programming)
  • Re: How much does it take to execute MMX instruction?
    ... a unrolled loop with lots of nop's in the ... This way we have accurate enough instruction timings. ... Pentium M, in general, has latency one clock cycle less, than Pentium ...
    (comp.lang.asm.x86)
  • Re: About dispatching process
    ... (Of course somewhere within the instruction sequence, it would have to check for hierarchy.) ... Subject: About dispatching process ... A disabled loop by itsself will not generate a problem. ... For IBM-MAIN subscribe / signoff / archive access instructions, ...
    (bit.listserv.ibm-main)
  • Re: Is a RISC chip more expensive?
    ... the instruction grouping rules on the 21164 were complicated. ... and these are only as good as the compiler writer... ... What makes you think there even was a scheduler? ... of the scalar b outside the loop that modified the vector a. ...
    (comp.arch)
  • Re: Sydney-X1 FPGA Computer Challenges Commodore, Amiga and Apple
    ... DUT Phase shifts measured by a PB machine code loop counter. ... the simple empty loop takes about .75 nanoseconds per iteration. ... the memory address,%esi instruction.) This addition ... that 1 instruction per clock cycle is plausible. ...
    (sci.electronics.design)